[texworks] error in image display

Benny Lautrup lautrup at nbi.dk
Sat Feb 27 10:45:19 CET 2010

Hi Bruno,

Thanks for the comments. Neither do I dare to enter into the patching
business right now.

I have just tested 0.2r466, and it has no problems with fonts or images. So
the problem has been created by a revision since then. That should help the
specialists in tracking down what is going on.

By the way, version 0.2r466 is MUCH faster than 0.3r571. Why is that?


-----Original Message-----
From: texworks-bounces at tug.org [mailto:texworks-bounces at tug.org] On Behalf
Of Bruno Voisin
Sent: 27. februar 2010 10:18
To: Discuss the TeXworks front end.
Subject: Re: [texworks] compiling in Win7

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

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
and in it a font-handling patch
er-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_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
+        enable_windows_fonts="no"
+    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
     // which font file do the refer to

Oddly, at the end of the patch there's

+/* Use Mac system fonts */

but no similar instruction for Windows which would I imagine write

+/* Use Windows system fonts */

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.


No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 9.0.733 / Virus Database: 271.1.1/2712 - Release Date: 02/26/10

More information about the texworks mailing list