Commit 34fcd0b409ddba4ff7ecbf84d46093491b53e6c4

David Turner 2007-01-05T15:55:59

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

diff --git a/ChangeLog b/ChangeLog
index 2358cbd..f6d20cd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2007-01-04  David Turner  <david@freetype.org>
 
+	* 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
diff --git a/src/pfr/pfrobjs.c b/src/pfr/pfrobjs.c
index f891cf5..976ab4a 100644
--- 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;