[texworks] compiling in Win7

Bruno Voisin bvoisin at me.com
Sat Feb 27 10:17:58 CET 2010


Le 27 févr. 2010 à 09:15, Benny Lautrup a écrit :

> Finally, the display problem with pdf-images produced by Mathematica has not disappeared after my compilation (see my previous mail with a short example).

That seems to confirm the interpretation by Stefan <http://tug.org/pipermail/texworks/2010q1/002322.html> that the problem originates from the patched version of the Poppler library used to build TeXworks, leading on Windows only to the bug you saw.

Looking at TeXworks' source repository, there is a poppler-patches section http://code.google.com/p/texworks/source/browse/trunk#trunk/poppler-patches> and in it a font-handling patch <http://code.google.com/p/texworks/source/browse/trunk/poppler-patches/poppler-font-handling.patch> which might be the one involved in your issue.

For example there's code to use system fonts for fonts not embedded in the PDF file to be viewed (namely for you the Times-Roman font):

+AC_ARG_ENABLE(windows-fonts,
+              AC_HELP_STRING([--enable-windows-fonts],
+                             [Use Windows system fonts when fonts are not embedded in the PDF.]),
+              enable_windows_fonts=$enableval,
+              enable_windows_fonts="no")
+AH_TEMPLATE([ENABLE_WINDOWS_FONTS], [Enable Windows font support.])
+if test x$enable_windows_fonts = xyes; then
+    AC_TRY_LINK([
+        #include <windows.h>
+        #include <shlobj.h>
+    ], [
+        HMODULE hLib = LoadLibrary("shell32.dll");
+        return 0;
+    ],
+    [ has_windows_api=yes ],
+    [ has_windows_api=no ])
+    if test x$has_windows_api = xyes; then
+        AC_DEFINE(ENABLE_WINDOWS_FONTS, 1, [Use Windows system fonts])
+    else
+        AC_MSG_WARN("Windows font support is not available on this platform.")
+        enable_windows_fonts="no"
+    fi
+fi
+AM_CONDITIONAL(ENABLE_WINDOWS_FONTS, test x$enable_windows_fonts = xyes)

and then later there's even code to deal with Times-Roman etc. specifically on Windows:

diff --git a/poppler/GlobalParamsWin.cc b/poppler/GlobalParamsWin.cc
index 015f0d3..264d13c 100644
--- a/poppler/GlobalParamsWin.cc
+++ b/poppler/GlobalParamsWin.cc
@@ -72,7 +72,8 @@ static struct {
     {"Times-Italic",          "n021023l.pfb", "timesi.ttf"},
     {"Times-Roman",           "n021003l.pfb", "times.ttf"},
     // TODO: not sure if "wingding.ttf" is right
-    {"ZapfDingbats",          "d050000l.pfb", "wingding.ttf"},
+// no, the symbol sets are quite different
+//    {"ZapfDingbats",          "d050000l.pfb", "wingding.ttf"},
 
     // those seem to be frequently accessed by PDF files and I kind of guess
     // which font file do the refer to

Oddly, at the end of the patch there's

+/* Use Mac system fonts */
+#ifndef ENABLE_MAC_FONTS
+#undef ENABLE_MAC_FONTS
+#endif
+

but no similar instruction for Windows which would I imagine write

+/* Use Windows system fonts */
+#ifndef ENABLE_WINDOWS_FONTS
+#undef ENABLE_WINDOWS_FONTS
+#endif
+

Unfortunately I cannot be of help here, having never done that type of programming. I'm only guessing based the comments and obvious interpretation of the lines in the code. I just hope that the above does make sens and I'm not wasting anybody's time.

Beware too of another issue that might be involved: your document requires Times Roman, but the font that Windows provide is called Times New Roman and is subtly different (and similarly Mac and Linux machines use Helvetica while Windows uses Arial which is similar but yet subtly different, etc.); I would have imagined the OSes dealt with the substitution of one font for the other transparently, but maybe not.

Bruno


More information about the texworks mailing list