freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] PDF text rendering error


From: suzuki toshiya
Subject: Re: [ft-devel] PDF text rendering error
Date: Mon, 11 Jun 2012 17:40:17 +0900
User-agent: Mozilla-Thunderbird 2.0.0.12 (X11/20080406)

Attached is my proposal to fix this issue, please try.

In my case (Debian GNU/Linux xpdf-3.02-11), using the
patched freetype library by LD_PRELOAD, xpdf shows
readable result (without patch, the result is unreadable).

Regards,
mpsuzuki

suzuki toshiya wrote:
Johnson Y. Yan wrote (2012/06/11 16:03):
Werner and Toshiya-san,

I  put the font as a tricky font to deal with.
static const char trick_names[TRICK_NAMES_COUNT]
                                 [TRICK_NAMES_MAX_CHARACTERS + 1] =
    {
      "DFKaiSho-SB",     /* dfkaisb.ttf */
      "DFKaiShu",
      "DFKai-SB",        /* kaiu.ttf */
      "HuaTianKaiTi?",   /* htkt2.ttf */
      "HuaTianSongTi?",  /* htst3.ttf */
      "MingLiU",         /* mingliu.ttf & mingliu.ttc */
      "PMingLiU",        /* mingliu.ttc */
      "MingLi43",        /* mingli.ttf */
"BKLGIB+FA" ---------------------------------------- this is the embeded font in th document.
    };
it still render error. .

Including the randomization prefix to the tricky font name list is bad idea.


I opened the embeded font use font lab, found the gid = 2134 is like this, please see the attach bitmap, some of lines form a 0 area areas, then fill the area(have no area), Does freetype made special processing?

Johnson Y. Yan



发件人: Werner LEMBERG
发送时间: 2012-06-11 12:55:42
收件人: yinsen_yan
抄送: freetype-devel; mpsuzuki
主题: Re: PDF text rendering error

Do you mean the font must be rendered use
TT_CONFIG_OPTION_BYTECODE_INTERPRETER?
No, the FreeType *library* must be built with it: Edit ftoption.h to
set this flag, then recompile.
Additionally, hinting must be enabled for this font, this is,
FT_LOAD_NO_SCALE doesn't work here.
Normally, those steps are (more or less) handled automatically by
FreeType, since we maintain a list of `tricky' font like the one you
have encountered in the PDF; see file `ttobjs.c'.  The subsetted font
in question, however, which identifies itself as
  BKLGIB+FA-RoundGothicB
FA 丸ゴシックB and FA-RoundGothicB are trademarks of NEC Office Systems,Ltd.
isn't in this list; for the NEC FA fonts (and others), a second
mechanism is used which doesn't work with subsetted fonts.
Toshiya-san, any ideas?
    Werner


_______________________________________________
Freetype-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/freetype-devel

diff --git a/src/truetype/ttobjs.c b/src/truetype/ttobjs.c
index 814c713..1f8a768 100644
--- a/src/truetype/ttobjs.c
+++ b/src/truetype/ttobjs.c
@@ -244,7 +244,7 @@
   tt_check_trickyness_sfnt_ids( TT_Face  face )
   {
 #define TRICK_SFNT_IDS_PER_FACE   3
-#define TRICK_SFNT_IDS_NUM_FACES  13
+#define TRICK_SFNT_IDS_NUM_FACES  17
 
     static const tt_sfnt_id_rec sfnt_id[TRICK_SFNT_IDS_NUM_FACES]
                                        [TRICK_SFNT_IDS_PER_FACE] = {
@@ -317,6 +317,26 @@
         { 0x00000000, 0x00000000 }, /* cvt  */
         { 0x0d3de9cb, 0x00000141 }, /* fpgm */
         { 0xd4127766, 0x00002280 }  /* prep */
+      },
+      { /* NEC FA-Gothic, 1996 */
+        { 0x00000000, 0x00000000 }, /* cvt  */
+        { 0x4a692698, 0x000001f0 }, /* fpgm */
+        { 0x340d4346, 0x00001fca }  /* prep */
+      },
+      { /* NEC FA-Minchou, 1996 */
+        { 0x00000000, 0x00000000 }, /* cvt  */
+        { 0xcd34c604, 0x00000166 }, /* fpgm */
+        { 0x6cf31046, 0x000022b0 }  /* prep */
+      },
+      { /* NEC FA-RoundGothicB, 1996 */
+        { 0x00000000, 0x00000000 }, /* cvt  */
+        { 0x5da75315, 0x0000019d }, /* fpgm */
+        { 0x40745a5f, 0x000022e0 }  /* prep */
+      },
+      { /* NEC FA-RoundGothicM, 1996 */
+        { 0x00000000, 0x00000000 }, /* cvt  */
+        { 0xf055fc48, 0x000001c2 }, /* fpgm */
+        { 0x3900ded3, 0x00001e18 }  /* prep */
       }
     };
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]