On 2010 Nov 17, Kan-Ru Chen wrote: > jida...@jidanni.org writes: > >> Can anybody read the Chinese these days with xpdf anymore? >> wget -O x.pdf >> http://www1.hl.gov.tw/bus/upload/%AA%E1%BD%AC%AB%C8%B9B%A5%FA%C2%D7%BDu%AE%C9%B6%A1%AA%ED.pdf >> xpdf x.pdf >> See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=591094 >> Should I dump xpdf and instead use what? >> Thanks. > > I could confirm the Chinese characters were broken inside my evince. > > I guess, since poppler disabled hinting, the bytecode interpreter wasn't > used at all. IIRC, it was disabled for correctness or better print > quality, because grid fitting is not suitable for printing. I used to > have a patched version installed locally some time ago. > > Screenshot attached.
In my experience, that sort of broken output for Chinese glyphs is always due to a missing or disabled bytecode interpreter in FreeType. There are two ways that can happen: (1) FreeType was built with the bytecode interpreter disabled. This was the default before 2.4 (and the 2.4.x versions can still be configured this way, but I'm not sure why anyone would do that). Later 2.3.x versions (I think) of FreeType have a workaround that tries to fix Chinese fonts based on their name. This may or may not work, depending on exactly how the font was embedded in the PDF file. I.e., FreeType 2.4.x should always work; FreeType 2.3.x may or may not work. (2) FreeType hinting was disabled. In Xpdf 3.02, there is a compile-time check for FreeType's bytecode interpreter -- if the interpreter is available, then hinting is enabled, otherwise hinting is disabled. This means that, if Xpdf 3.02 is compiled with a 2.3.x version of FreeType without the bytecode interpreter, and then FreeType is later upgraded to 2.4.x, then Xpdf will still disable hinting. I believe some Linux distributions (and code forks, like Poppler) may also modify the Xpdf code to disable hinting. (Certain fonts look better when FreeType's auto-hinting is disabled.) If you want to debug the problem, I would recommend doing this: (1) Download the Xpdf binaries from my ftp site. They're staticly linked to FreeType (a 2.3.x version, with the bytecode interpreter enabled). You can just unpack the tar file in /tmp and run it from there -- no need to install anything. If that displays the Chinese text correctly, then the problem is almost certainly as described above. (2) Install FreeType 2.4.x, and make sure the bytecode interpreter is enabled. Build Xpdf 3.02pl5 from the unmodified source code from my ftp site. If that works, then my guess is that the issue is one of: (a) The Xpdf package released by your distribution has been modified to disable hinting (b) The Xpdf package released by your distribution was built with FreeType 2.3.x with the bytecode interpreter disabled (and not re-built after FreeType was upgraded to 2.4.x). The next release of Xpdf (3.03) will have a run-time option (xpdfrc setting) to enable/disable FreeType hinting. Of course, I can't control modifications made by Debian packagers, the Poppler project, etc. - Derek -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org