Bug 114603 - kpdf doesn't render greek symbols in pdf created by OO.o2 from MSWord document (MathType equation object)
Summary: kpdf doesn't render greek symbols in pdf created by OO.o2 from MSWord documen...
Status: RESOLVED FIXED
Alias: None
Product: kpdf
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Albert Astals Cid
URL:
Keywords:
: 117762 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-10-18 11:57 UTC by Tobi Vollebregt
Modified: 2005-12-06 01:02 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
the pdf that's rendered incorrectly (224.95 KB, application/pdf)
2005-10-18 11:58 UTC, Tobi Vollebregt
Details
screenshot of kpdf with freetype 2.1.10 (left) and kpdf with freetype 2.1.7 (right) (47.17 KB, image/png)
2005-10-21 10:03 UTC, Tobi Vollebregt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tobi Vollebregt 2005-10-18 11:57:18 UTC
Version:            (using KDE KDE 3.4.3)
Installed from:    Debian testing/unstable Packages
Compiler:          gcc 4.0.x 
OS:                Linux

KPDF doesn't render some greek symbols in a pdf file. The pdf file was created by OO.o2. The original document was a MSWord document with a MathType equation object in it. Many Greek symbols in these equation objects render as small rectangles instead of the right symbol. Acroread7 displays the pdf correctly. I'll attach the respective pdf.
Comment 1 Tobi Vollebregt 2005-10-18 11:58:37 UTC
Created attachment 13038 [details]
the pdf that's rendered incorrectly
Comment 2 Albert Astals Cid 2005-10-18 23:22:47 UTC
Renders without problems here, the only problem i think you could have is that the Symbol font is not embedded into the pdf so it needs to be installed in your system, but Symbol is quite common anyway. 

Can you check you have s050000l.pfb in any of these folders?

/usr/share/ghostscript/fonts
/usr/pkg/share/ghostscript/fonts
/usr/local/share/ghostscript/fonts
/usr/share/fonts/default/Type1
/usr/X11R6/lib/X11/fonts/Type1
/usr/share/fonts/type1/gsfonts
/usr/share/fonts/default/ghostscript/
/usr/share/fonts/Type1
Comment 3 Thiago Macieira 2005-10-19 04:33:33 UTC
I see squares in kpdf r470926 and I have that file:

$ locate s050000l.pfb
/usr/share/fonts/default/ghostscript/s050000l.pfb

The KGhostview part shows the Greek letters correctly. freetype is version 1.3.1, fontconfig (libfontconfig.so.1.0.4) is version 2.2.99, libXft.so.2.1.1 is version 2.1.2 (sic), in case that helps.
Comment 4 Albert Astals Cid 2005-10-19 09:04:31 UTC
freetype 1.3.1 ???? This is from 1999 !!!
Comment 5 Tobi Vollebregt 2005-10-19 14:41:51 UTC
The file s050000l.pfb is available on my system: /usr/share/fonts/type1/gsfonts/s050000l.pfb

FreeType is version 2.1.7-2.4ubuntu1 (running Ubuntu as you see, version 5.10, ie. Breezy Badger).

I'll try to figure out if this directory is missing in a font path variable somewhere, or if this bug is related to the Ubuntu FreeType package.
Comment 6 Albert Astals Cid 2005-10-19 15:03:25 UTC
Well, there is at least one bug for Ubuntu that Riddell (KUbuntu developer) confirmed me that it happened using their official package but not if he used a self compiled 2.1.10 version.
Comment 7 Tobi Vollebregt 2005-10-19 16:36:09 UTC
I don't think it's the same bug, this one doesn't crash konqueror. Also everything is shown correctly except some symbols. It's not like nothing is shown.

Anyway if you've any suggestions on how to fix (even if it involves patching, recompiling stuff, etc. [I'm a developer myself]) I'd be glad to hear.
Comment 8 Thiago Macieira 2005-10-20 08:26:20 UTC
Sorry, I didn't notice that I have both freetype 1.x and 2.x. The 2.x series is 2.1.9.
Comment 9 Albert Astals Cid 2005-10-20 08:26:34 UTC
Well, i did not mention a crash, it was a misrendering also. The easiest thing you can try to do is download freetype 2.1.10 from freetype page, compile it in your home and then
ldd `which kpdf` | grep freetype
to know the freetype lib kpdf is using, rename it and make it a symbolic link to the lib you compiled in your home. Then try if that document renders correctly, if it does bug ubtuntu to update their freetype version. After that bring your original lib back.
Comment 10 Tobi Vollebregt 2005-10-20 19:56:55 UTC
I tried this (downloading, compiling freetype 2.1.10 and running kpdf with this version of freetype), but it doesn't make a difference. Actually, it does make a difference - the font in the kpdf menus look slightly different, but it doesn't fix this bug. Unfortunately.
Comment 11 Albert Astals Cid 2005-10-20 21:22:22 UTC
Strange, can you please post a screenshot?
Comment 12 Tobi Vollebregt 2005-10-21 10:03:26 UTC
Created attachment 13097 [details]
screenshot of kpdf with freetype 2.1.10 (left) and kpdf with freetype 2.1.7 (right)
Comment 13 Tobi Vollebregt 2005-10-21 15:08:52 UTC
I tried the live cd, no success.
Also I tried to figure out if kpdf actually loads the font, ie. I did:

strace -e trace=file kpdf 2>&1 | grep font

it touched the directory containing s050000l.pfb, but it didn't open the file itself.
Comment 14 Albert Astals Cid 2005-10-21 22:24:56 UTC
I don't get a open over the file either, but that's maybe because freetype has it already in cache?
Is there any possibility that you update to the kde 3.5 branch so you can use File->Properties->Fonts to see if it is really using that file (it should)
Comment 15 Tobi Vollebregt 2005-10-21 22:40:21 UTC
There is; actually I'm already running some parts of KDE of 3.5 branch, it's just that kpdf is not yet packaged for kubuntu.

I'll try to schedule some time next week to try to package it myself (I've a little bit experience with packaging). Can't promise anything though, I'm pretty busy next two weeks.
Comment 16 Jonathan Riddell 2005-10-21 23:38:22 UTC
You can try out kpdf from KDE 3.5 using the packages at

http://www.kubuntu.org/announcements/kde-35beta2.php
Comment 17 Thiago Macieira 2005-10-22 01:08:16 UTC
Thankfully I can :-)

The Fonts tab says:
NimbusRomNo9L-Regu - Type 1 - Embedded
NimbusRomNo9L-ReguItal - Type 1 - Embedded
Symbol - Type 1 - Not Embedded - /usr/X11R6/lib/X11/fonts/TTF/Vera.ttf

So something thought Symbol and Vera were similar :-)

I don't see that font as a substitution in qtconfig. I've never understood fontconfig/freetype/Xft, so I don't know where to look for the config.
Comment 18 Albert Astals Cid 2005-10-22 11:26:15 UTC
Yeah, that IS a problem, let me try to see why this could happen.
Comment 19 Tobi Vollebregt 2005-10-22 11:47:52 UTC
I'd swear I had already added a kde35beta2 repository to my sources.list, but apparently I hadn't :s

Anyway, I updated & upgraded, the fonts tab says:
NimbusRomNo9L-Regu - Type 1 - Embedded
NimbusRomNo9L-ReguItal - Type 1 - Embedded
Symbol - Type 1 - Not Embedded - /usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf

Same behaviour here, only the location of Vera.ttf is different.
Comment 20 Albert Astals Cid 2005-10-22 11:52:58 UTC
Well, i think i found how to fix the problem (at least for thiago).

One is properly configure your fontconfig so that it knows what font you want to use as Symbol font, that is

<alias>
    <family>Symbol</family>
    <accept><family>Standard Symbols L</family></accept>
</alias>

somewhere in your /etc/fonts/fonts.conf

The other involves a patch i'm doing right now.
Comment 21 Albert Astals Cid 2005-10-22 12:02:33 UTC
The patch you should try (without having added the above lines to the fotns.conf file) is

Index: xpdf/xpdf/GlobalParams.cc
===================================================================
--- xpdf/xpdf/GlobalParams.cc   (revisión: 472738)
+++ xpdf/xpdf/GlobalParams.cc   (copia de trabajo)
@@ -1142,10 +1142,6 @@
 #endif
   for (i = 0; displayFontTab[i].name; ++i) {
     fontName = new GString(displayFontTab[i].name);
-    if (getDisplayFont(fontName)) {
-      delete fontName;
-      continue;
-    }
     fileName = NULL;
     kind = displayFontT1; // make gcc happy
     if (dir) {


Please report it that fixes the problem
Comment 22 Tobi Vollebregt 2005-10-22 13:25:27 UTC
Your first solution solves the problem:
<alias> 
     <family>Symbol</family> 
     <accept><family>Standard Symbols L</family></accept> 
</alias> 

I did not yet try the patch, I'll report as soon as I've done that.
Comment 23 Tobi Vollebregt 2005-10-22 15:35:08 UTC
Your patch doesn't fix the bug.
Comment 24 Thiago Macieira 2005-10-22 18:52:33 UTC
The source-code patch from comment #21 works for me.
Comment 25 Albert Astals Cid 2005-10-22 18:54:51 UTC
Tobi are you sure you installed correctly and you are running the patched version? It's strange it works for Thiago and not for you.
Comment 26 Tobi Vollebregt 2005-10-22 21:12:09 UTC
I'm sorry, the patch from comment #21 works for me too.

I don't know what I did wrong: I'm sure I compiled, installed and executed the right binary, but maybe I should have killed open kpdf instances? If it was reused that may have been the problem. Anyway, I added a printf to the code to make sure I'm right this time..

I marked the bug as RESOLVED assuming this patch goes directly into SVN.
Comment 27 Thiago Macieira 2005-10-23 00:04:01 UTC
Reopening the bug until the patch is actually committed to Subversion
Comment 28 Albert Astals Cid 2005-10-23 00:20:28 UTC
I actually already commited the patch in r473205 and r473206
Comment 29 Thiago Macieira 2005-12-06 01:02:36 UTC
*** Bug 117762 has been marked as a duplicate of this bug. ***