shithub: freetype+ttf2subf

Download patch

ref: 1ae134a2337b4a9adb06478cd444d79569e37767
parent: d41aecdbc0c71a6660e5e037605529b9a0f6f4fe
author: David Turner <[email protected]>
date: Tue Feb 21 11:50:17 EST 2006

* src/sfnt/sfobjs.c (sfnt_face_load): fixed silly bug that
    prevented embedded bitmaps from being correctly listed and used

    * src/pfr/pfrsbit.c: fixed handling of character advances

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-02-21  David Turner  <[email protected]>
+
+    * src/sfnt/sfobjs.c (sfnt_face_load): fixed silly bug that
+    prevented embedded bitmaps from being correctly listed and used
+
+    * src/pfr/pfrsbit.c: fixed handling of character advances
+
 2006-02-20  David Turner  <[email protected]>
 
 	Support binary compatibility with the X.Org server's Xfont library. 
--- a/src/pfr/pfrsbit.c
+++ b/src/pfr/pfrsbit.c
@@ -605,11 +605,20 @@
       FT_Byte*  p;
 
 
-      advance = FT_MulDiv( size->root.metrics.x_ppem << 8,
+      /* compute linear advance */
+      advance = character->advance;
+      if ( phys->metrics_resolution != phys->outline_resolution )
+        advance = FT_MulDiv( advance,
+                             phys->outline_resolution,
+                             phys->metrics_resolution );
+
+      glyph->root.linearHoriAdvance = advance;
+
+      /* compute default advance, i.e. scaled advance. This can be overriden */
+      /* in the bitmap header of certain glyphs...                           */
+      advance = FT_MulDiv( (FT_Fixed)size->root.metrics.x_ppem << 8,
                            character->advance,
                            phys->metrics_resolution );
-
-      /* XXX: handle linearHoriAdvance correctly! */
 
       if ( FT_STREAM_SEEK( face->header.gps_section_offset + gps_offset ) ||
            FT_FRAME_ENTER( gps_size )                                     )
--- a/src/sfnt/sfobjs.c
+++ b/src/sfnt/sfobjs.c
@@ -915,7 +915,7 @@
         FT_UInt  i, count;
 
 
-#ifdef FT_OPTIMIZE_MEMORY
+#if defined FT_OPTIMIZE_MEMORY && !defined FT_CONFIG_OPTION_OLD_INTERNALS
         count = face->sbit_num_strikes;
 #else
         count = (FT_UInt)face->num_sbit_strikes;