shithub: freetype+ttf2subf

Download patch

ref: 34fcd0b409ddba4ff7ecbf84d46093491b53e6c4
parent: 384be23418f8204baf785191a49f447d4ab40b9e
author: David Turner <[email protected]>
date: Fri Jan 5 10:55:59 EST 2007

* src/pfr/pfrobjs.c (pfr_face_init): detect non-scalable fonts
	correctly. fixes bug #17876

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2007-01-04  David Turner  <[email protected]>
 
+	* src/pfr/pfrobjs.c (pfr_face_init): detect non-scalable fonts
+	correctly. fixes bug #17876
+
 	* src/truetype/ttobjs.h, src/truetype/ttobjs.c, 
 	src/truetype/ttgload.c: do not allocate interpreter-specific
 	tables in memory if we're not going to load glyphs with it
--- a/src/pfr/pfrobjs.c
+++ b/src/pfr/pfrobjs.c
@@ -131,6 +131,19 @@
       pfrface->num_glyphs = phy_font->num_chars + 1;
       pfrface->face_flags = FT_FACE_FLAG_SCALABLE;
 
+      /* if all characters point to the same gps_offset 0, we */
+      /* assume the font only contains bitmaps                */
+      {
+        FT_UInt  nn;
+
+        for ( nn = 0; nn < phy_font->num_chars; nn++ )
+          if ( phy_font->chars[nn].gps_offset != 0 )
+            break;
+
+        if ( nn == phy_font->num_chars )
+          pfrface->face_flags = 0;  /* not SCALABLE !! */
+      }
+
       if ( (phy_font->flags & PFR_PHY_PROPORTIONAL) == 0 )
         pfrface->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;