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: Wed, 13 Jun 2012 18:53:21 +0900
User-agent: Mozilla-Thunderbird 2.0.0.12 (X11/20080406)

Just I've updated the patch making FT_Library_Version() return
the irregular values. Please invoke FT_Library_Version() and
print its result to stdout or stderr, to assure that your binary
is linked with the patched library.

Insertion something like
 {
   FT_Int  maj, min, pat;
   FT_Library_Version( library, &maj, &min, &pat);
   fprintf( stderr, "FreeType2 version %d:%d:%d\n", maj, min, pat );
 }
will give "FreeType2 version 2.4.12061".

Regards,
mpsuzuki

suzuki toshiya wrote:
Johnson Y. Yan wrote:
*sure* that you are linking to the right, patched
FreeType library?
-------see the render (gid = 2134) result saved as png image.

I think what Werner asked is "could you check if your binary is
linked with the patched library, not with the unpatched libary?".

Unfortunately, "yes, I've checked" is NOT objective answer.
The solution would be... hmm, I will update the patch that changes
the version returned by FT_Library_Version() function. So please
update your testing program to invoke the function and show the
version.

Regards,
mpsuzuki

P.S.
Are you really writing code without indentation?
-------It depends on freetype,

I don't think FreeType2 requests you to write a code without
indentation. I'm interested in if it is a inhouse convention
of the engineers in Foxit Software.

Johnson Y. Yan wrote:
Werner ,
Are you really writing code without indentation?
-------It depends on freetype,
Any reason why you don't use the symbolic value, FT_LOAD_NO_BITMAP?
-------FT_LOAD_NO_BITMAP == 8
*sure* that you are linking to the right, patched
FreeType library?
-------see the render (gid = 2134) result saved as png image.

I think the important thing is that it calls freetype's interface, and there is a result.
Thanks.
Johnson Y. Yan



发件人: Werner LEMBERG
发送时间: 2012-06-13 16:25:34
收件人: yinsen_yan
抄送: mpsuzuki; freetype-devel
主题: Re: [ft-devel] PDF text rendering error

... Are you really writing code without indentation?
#include "../../ft2.4.9/include/freetype/internal/ftobjs.h"
Uh, oh!  You must never, ever use an internal header file in your
source code (except for special reasons).
int load_flags = 8;
Any reason why you don't use the symbolic value, FT_LOAD_NO_BITMAP?
Besides this, I don't see a problem with your code (after a quick
look).  Are you *sure* that you are linking to the right, patched
FreeType library?
    Werner


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

diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 36ee797..75a9d31 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -4484,6 +4484,8 @@
       patch = library->version_patch;
     }
 
+    patch = 12061;
+
     if ( amajor )
       *amajor = major;
 
diff --git a/src/truetype/ttobjs.c b/src/truetype/ttobjs.c
index 814c713..7addad1 100644
--- a/src/truetype/ttobjs.c
+++ b/src/truetype/ttobjs.c
@@ -149,8 +149,8 @@
   tt_check_trickyness_family( FT_String*  name )
   {
 
-#define TRICK_NAMES_MAX_CHARACTERS  16
-#define TRICK_NAMES_COUNT            8
+#define TRICK_NAMES_MAX_CHARACTERS  18
+#define TRICK_NAMES_COUNT           11 
 
     static const char trick_names[TRICK_NAMES_COUNT]
                                  [TRICK_NAMES_MAX_CHARACTERS + 1] =
@@ -163,6 +163,9 @@
       "MingLiU",         /* mingliu.ttf & mingliu.ttc */
       "PMingLiU",        /* mingliu.ttc */
       "MingLi43",        /* mingli.ttf */
+      "FA-Gothic",        /* NEC FA Gothic 1996 */
+      "FA-Minchou",       /* NEC FA Minchou, 1996 */
+      "FA-RoundedGothic", /* NEC FA RoundedGothicB, M, 1996 */
     };
 
     int  nn;
@@ -317,6 +320,28 @@
         { 0x00000000, 0x00000000 }, /* cvt  */
         { 0x0d3de9cb, 0x00000141 }, /* fpgm */
         { 0xd4127766, 0x00002280 }  /* prep */
+#if 0
+      },
+      { /* 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 */
+#endif
       }
     };
 
@@ -358,18 +383,31 @@
         continue;
       }
 
-      for ( j = 0; j < TRICK_SFNT_IDS_NUM_FACES; j++ )
+      FT_TRACE3(("tt_check_trickyness_sfnt_ids(): check %c%c%c%c 
length/checkum is blacklisted\n",
+                 ( face->dir_tables[i].Tag >> 24 ) & 0xFF,
+                 ( face->dir_tables[i].Tag >> 16 ) & 0xFF,
+                 ( face->dir_tables[i].Tag >>  8 ) & 0xFF,
+                 ( face->dir_tables[i].Tag >>  0 ) & 0xFF ));
+      for ( j = 0; j < TRICK_SFNT_IDS_NUM_FACES; j++ ) {
         if ( face->dir_tables[i].Length == sfnt_id[j][k].Length )
         {
+          FT_TRACE3(("                              : length (0x%08x) is 
matched with blacklist %d\n",
+                     face->dir_tables[i].Length, j ));
           if ( !checksum )
             checksum = tt_get_sfnt_checksum( face, i );
 
-          if ( sfnt_id[j][k].CheckSum == checksum )
+          if ( sfnt_id[j][k].CheckSum == checksum ) {
+            FT_TRACE3(("                              : checksum (0x%08x) is 
matched with blacklist %d\n",
+                       face->dir_tables[i].CheckSum, j ));
             num_matched_ids[j]++;
+          }
 
-          if ( num_matched_ids[j] == TRICK_SFNT_IDS_PER_FACE )
+          if ( num_matched_ids[j] == TRICK_SFNT_IDS_PER_FACE ) {
+            FT_TRACE3(("                              : all required tables 
are matched for blacklist %d\n", j ));
             return TRUE;
+          }
         }
+      }
     }
 
     for ( j = 0; j < TRICK_SFNT_IDS_NUM_FACES; j++ )
@@ -391,6 +429,9 @@
   static FT_Bool
   tt_check_trickyness( FT_Face  face )
   {
+    FT_String*  ps_name = NULL;
+
+
     if ( !face )
       return FALSE;
 
@@ -399,6 +440,11 @@
          tt_check_trickyness_family( face->family_name ) )
       return TRUE;
 
+    /* For second, check the PostScript name for quick check. */
+    ps_name = (FT_String *) FT_Get_Postscript_Name( face );
+    if ( ps_name && tt_check_trickyness_family( ps_name ) )
+      return TRUE;
+
     /* Type42 fonts may lack `name' tables, we thus try to identify */
     /* tricky fonts by checking the checksums of Type42-persistent  */
     /* sfnt tables (`cvt', `fpgm', and `prep').                     */

reply via email to

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