Bug 691997 - Chinese texts displays are incorrect
Summary: Chinese texts displays are incorrect
Status: RESOLVED FIXED
Alias: None
Product: MuPDF
Classification: Unclassified
Component: mupdf (show other bugs)
Version: unspecified
Hardware: PC Windows XP
: P4 normal
Assignee: Tor Andersson
URL: http://code.google.com/p/sumatrapdf/i...
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-23 05:01 UTC by harrison.m.black
Modified: 2011-02-23 16:47 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments
testing file for reporting MuPDF bug (569.35 KB, application/octet-stream)
2011-02-23 05:05 UTC, harrison.m.black
Details

Note You need to log in before you can comment on or make changes to this bug.
Description harrison.m.black 2011-02-23 05:01:19 UTC
testing file attached, please compare MuPDF display with Acrobat, then you can see Chinese texts displays are incorrect.
Comment 1 harrison.m.black 2011-02-23 05:05:07 UTC
Created attachment 7281 [details]
testing file for reporting MuPDF bug
Comment 2 Tor Andersson 2011-02-23 11:27:39 UTC
The infamous DynaLab fonts! I have added a fix using the freetype function to check for DynaLab fonts. This requires a relatively new version of freetype to work properly (2.4.3 or newer).
Comment 3 Tor Andersson 2011-02-23 11:33:25 UTC
On further testing, the fix is not necessary on freetype >= 2.4.3 at all. Upgrade your system freetype (or compile with the freetype from mupdf-thirdparty.zip).
Comment 4 zeniko 2011-02-23 13:35:58 UTC
Even with Freetype 2.4.4, this document (mainly the title) misrenders in comparison to Adobe Reader.
Comment 5 Tor Andersson 2011-02-23 14:32:14 UTC
The trickyness tests in freetype 2.4.4 are more extensive than in 2.4.3, and fail on the subset fonts in the file since the family_name isn't set. The only reason it "worked" in 2.4.3 was that the default if the family_name is null was to be tricky. The font DLCRoundBold isn't in freetype's list of known dynalab fonts.

I've reverted the patch so now mupdf will apply the hinting workaround for all truetype CJK fonts. It should not have any visual artefacts, since the hinting is run at a glyph size of 1000x1000 before the outline is scaled to the real size.
Comment 6 zeniko 2011-02-23 15:55:27 UTC
The new patch seems to be too broad. I've got documents containing e.g. a Type 2 Verdana subset with an Adobe-Identity CMap that's now got hinting enabled and no longer looks the same as in Adobe Reader.

Wouldn't an explicit fontname list the safer choice (similar to what FreeType does in tt_check_trickyness_family)?
Comment 7 Tor Andersson 2011-02-23 16:47:32 UTC
I think I have a function to relatively safely identify DynaLab fonts by their name. The set of names from freetype plus checking for a "DF" or "DLC" prefix both with full and subset (ABCDEF+DF...) forms. Hopefully this won't catch too many false positives.

I also added a message with pdf_logfont when forced hinting is turned on (check by setting environment variable MULOG=f).