* src/pfr/pfrobjs.c (pfr_face_init): detect non-scalable fonts correctly. fixes bug #17876
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
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;