shithub: freetype+ttf2subf

Download patch

ref: 2dd1e657ba9c39868e6213b7281b416c92235f39
parent: 3704aa4525cddf6132e3dab55b6653958e2c239a
author: David Turner <[email protected]>
date: Thu Apr 24 17:12:18 EDT 2003

* src/pcf/pcfread.c (pcf_load_font): fixed the computation of
        face->num_glyphs, this required increase the value by 1 to respect
        the convention that gindex 0 always corresponds to the "missing
        glyph".

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2003-04-24  David Turner  <[email protected]>
+
+        * src/pcf/pcfread.c (pcf_load_font): fixed the computation of
+        face->num_glyphs, this required increase the value by 1 to respect
+        the convention that gindex 0 always corresponds to the "missing
+        glyph".
+
 2003-04-24  Werner Lemberg  <[email protected]>
 
 	* builds/unix/unix-cc.in (CFLAGS): Add @CPPFLAGS@.
--- a/src/pcf/pcfread.c
+++ b/src/pcf/pcfread.c
@@ -972,7 +972,13 @@
       else
         root->family_name = 0;
 
-      root->num_glyphs = face->nmetrics;
+     /* note: we shift all glyph indices by +1 since we must
+      * respect the convention that glyph 0 always correspond
+      * to the "missing glyph".
+      *
+      * this implies bumping the number of "available" glyphs by 1
+      */
+      root->num_glyphs = face->nmetrics + 1;
 
       root->num_fixed_sizes = 1;
       if ( FT_NEW_ARRAY( root->available_sizes, 1 ) )