On 03/23/2016 01:33 AM, Jens Reyer wrote: [...] > Ok. So we need to package these TrueType fonts again. > > See also #814844 (wine: fonts-wine fonts are not found). I assume > upstream's fix for that bug now triggers your issue.
See attached InstallAndUseFonts.patch (applies to git branch stretch, where we currently package the fonts from). It: - adds the ttf fonts - backports upstream's patch to take the fontdir specified at build time into account - sets fontdir /usr/share/wine/fonts This should solve all user visible fonts related issues in both wine and wine-development. > However I just noted that the TrueType fonts are generated by upstream. > So we should regenerate before we can package them. Initially I thought that this requires to manually change the Makefile to build the TrueType fonts. However I noted that this happens upstream in "maintainer mode". I implemented that, see attached RebuildFonts.patch (for branch stretch). Upstream's maintainer mode sets the CFLAG "-Werror". I reported the first build failure on a warning at https://bugs.winehq.org/show_bug.cgi?id=40391. (btw: we also get e.g. "warning: 'install_wine_gecko' defined but not used [-Wunused-function]" if we use disable/external-installers.patch). I workarounded this by specifying "-Wno-error". However upstream told me in that bug report that it is risky to rebuild the TrueType fonts, because they use a forked fontforge. So what should we do? - Don't ship the TrueType fonts (see the already reported issues, bad idea)? - Ship pre-built TrueType fonts (only InstallAndUseFonts.patch)? - Regenerate the TrueType fonts (both patches) What do you think? Greets jre
diff --git a/debian/changelog b/debian/changelog index 89263dd..f280179 100644 --- a/debian/changelog +++ b/debian/changelog @@ -19,6 +19,10 @@ wine (1.8.1-3) UNRELEASED; urgency=medium - Break older wine32|64 which don't have a reverse version requirement. - Re-enable "err" level output by default (closes: #816014). - Drop version output (closes: #816017). + - Install wine's TrueType fonts (closes: #818925). + - Set fontdir /usr/share/wine/fonts. + - Add fontdir.patch to take into account the build time configuration + (closes: #814844). -- Jens Reyer <jre.wine...@gmail.com> Sun, 13 Mar 2016 02:40:12 +0100 diff --git a/debian/fonts-wine.install b/debian/fonts-wine.install index 7977454..4b761c9 100644 --- a/debian/fonts-wine.install +++ b/debian/fonts-wine.install @@ -1 +1,7 @@ fonts/*.fon usr/share/wine/fonts + +fonts/symbol.ttf usr/share/wine/fonts +fonts/tahoma.ttf usr/share/wine/fonts +fonts/marlett.ttf usr/share/wine/fonts +fonts/tahomabd.ttf usr/share/wine/fonts +fonts/wingding.ttf usr/share/wine/fonts diff --git a/debian/patches/fontdir.patch b/debian/patches/fontdir.patch new file mode 100644 index 0000000..ecc802b --- /dev/null +++ b/debian/patches/fontdir.patch @@ -0,0 +1,103 @@ +Description: gdi32: Take into account the fontdir directory specified at build time. +Origin: http://source.winehq.org/git/wine.git/commit/1eac54ef7d6d90fcc973c5ea92a53be73f61ff12 +Bug: https://bugs.winehq.org/show_bug.cgi?id=40312 +Bug-Debian: https://bugs.debian.org/814844 +Applied-Upstream: 1.9.6 + +--- a/dlls/gdi32/Makefile.in ++++ b/dlls/gdi32/Makefile.in +@@ -49,3 +49,5 @@ C_SRCS = \ + vertical.c + + RC_SRCS = gdi32.rc ++ ++freetype_EXTRADEFS = -DWINE_FONT_DIR=\"`$(MAKEDEP) -R ${datadir}/wine ${fontdir}`\" +--- a/dlls/gdi32/freetype.c ++++ b/dlls/gdi32/freetype.c +@@ -213,6 +213,10 @@ MAKE_FUNCPTR(FcPatternGetString); + #define GET_BE_WORD(x) RtlUshortByteSwap(x) + #endif + ++#ifndef WINE_FONT_DIR ++#define WINE_FONT_DIR "fonts" ++#endif ++ + /* This is basically a copy of FT_Bitmap_Size with an extra element added */ + typedef struct { + FT_Short height; +@@ -2960,22 +2964,44 @@ static void load_mac_fonts(void) + + #endif + ++static char *get_font_dir(void) ++{ ++ const char *build_dir, *data_dir; ++ char *name = NULL; ++ ++ if ((data_dir = wine_get_data_dir())) ++ { ++ if (!(name = HeapAlloc( GetProcessHeap(), 0, strlen(data_dir) + 1 + sizeof(WINE_FONT_DIR) ))) ++ return NULL; ++ strcpy( name, data_dir ); ++ strcat( name, "/" ); ++ strcat( name, WINE_FONT_DIR ); ++ } ++ else if ((build_dir = wine_get_build_dir())) ++ { ++ if (!(name = HeapAlloc( GetProcessHeap(), 0, strlen(build_dir) + sizeof("/fonts") ))) ++ return NULL; ++ strcpy( name, build_dir ); ++ strcat( name, "/fonts" ); ++ } ++ return name; ++} ++ + static char *get_data_dir_path( LPCWSTR file ) + { + char *unix_name = NULL; +- const char *data_dir = wine_get_data_dir(); +- +- if (!data_dir) data_dir = wine_get_build_dir(); ++ char *font_dir = get_font_dir(); + +- if (data_dir) ++ if (font_dir) + { + INT len = WideCharToMultiByte(CP_UNIXCP, 0, file, -1, NULL, 0, NULL, NULL); + +- unix_name = HeapAlloc(GetProcessHeap(), 0, strlen(data_dir) + len + sizeof("/fonts/")); +- strcpy(unix_name, data_dir); +- strcat(unix_name, "/fonts/"); ++ unix_name = HeapAlloc(GetProcessHeap(), 0, strlen(font_dir) + len + 1 ); ++ strcpy(unix_name, font_dir); ++ strcat(unix_name, "/"); + + WideCharToMultiByte(CP_UNIXCP, 0, file, -1, unix_name + strlen(unix_name), len, NULL, NULL); ++ HeapFree( GetProcessHeap(), 0, font_dir ); + } + return unix_name; + } +@@ -4121,7 +4147,6 @@ static void init_font_list(void) + DWORD valuelen, datalen, i = 0, type, dlen, vlen; + WCHAR windowsdir[MAX_PATH]; + char *unixname; +- const char *data_dir; + + delete_external_font_keys(); + +@@ -4137,13 +4162,9 @@ static void init_font_list(void) + HeapFree(GetProcessHeap(), 0, unixname); + } + +- /* load the system truetype fonts */ +- data_dir = wine_get_data_dir(); +- if (!data_dir) data_dir = wine_get_build_dir(); +- if (data_dir && (unixname = HeapAlloc(GetProcessHeap(), 0, strlen(data_dir) + sizeof("/fonts/")))) ++ /* load the wine fonts */ ++ if ((unixname = get_font_dir())) + { +- strcpy(unixname, data_dir); +- strcat(unixname, "/fonts/"); + ReadFontDir(unixname, TRUE); + HeapFree(GetProcessHeap(), 0, unixname); + } diff --git a/debian/patches/makefile.patch b/debian/patches/makefile.patch index b70aa83..ac2685e 100644 --- a/debian/patches/makefile.patch +++ b/debian/patches/makefile.patch @@ -20,7 +20,7 @@ author: Michael Gilbert <mgilb...@debian.org> mandir = @mandir@ -fontdir = ${datadir}/wine/fonts -includedir = @includedir@/wine -+fontdir = ${datadir}/wine ++fontdir = /usr/share/wine/fonts +includedir = @includedir@ dlldir = @dlldir@ fakedlldir = ${dlldir}/fakedlls diff --git a/debian/patches/series b/debian/patches/series index 221ac45..47c832a 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,4 @@ +fontdir.patch makefile.patch kfreebsd.patch sfnt2fon.patch
diff --git a/debian/clean b/debian/clean index d0f69a9..330960c 100644 --- a/debian/clean +++ b/debian/clean @@ -45,6 +45,7 @@ dlls/opengl32/opengl32.spec # font files fonts/*.fon +fonts/*.ttf fonts/Makefile tools/sfnt2fon/sfnt2fon tools/sfnt2fon/sfnt2fon.o diff --git a/debian/control.in b/debian/control.in index 4ed092d..7bb597d 100644 --- a/debian/control.in +++ b/debian/control.in @@ -61,6 +61,10 @@ Build-Depends: libfontconfig1-dev, freebsd-glue [kfreebsd-any], ocl-icd-opencl-dev, + icoutils, + librsvg2-bin, + imagemagick, + fontforge-nox, Standards-Version: 3.9.7 Homepage: http://www.winehq.org/ Vcs-Browser: https://anonscm.debian.org/git/pkg-wine/wine.git diff --git a/debian/rules b/debian/rules index bee2b0c..9be0f25 100755 --- a/debian/rules +++ b/debian/rules @@ -33,6 +33,7 @@ CONFLAGS=--with-gnutls \ --without-gphoto \ --without-gstreamer \ --disable-tests \ + --enable-maintainer-mode \ --libdir=/$(LIBDIR) \ --bindir=/$(BINDIR) \ --mandir=/$(MANDIR) \ @@ -56,6 +57,9 @@ export DEB_CFLAGS_MAINT_APPEND+=-march=armv5t export DEB_LDFLAGS_MAINT_APPEND+=-march=armv5t endif +# override maintainer mode config +export DEB_CFLAGS_MAINT_APPEND+=-Wno-error + # additional files to generate INSTALLS=$(shell ls debian/*VERSION* | sed s/VERSION/$(VERSION)/) \ debian/bug-control \