Hi,
  When view a font by ftview -e unic option, the glyphs are sorted by unicode,
however if switch the render mode to embolden or outline by pressing Space key,
the unicode index is totally ignored and fallback to raw glyph index.

The attached patch fix this issue.

  See also: https://bugzilla.novell.com/show_bug.cgi?id=159304

Regards
James Su
diff -ur ft2demos-2.1.10.old/src/ftview.c ft2demos-2.1.10/src/ftview.c
--- ft2demos-2.1.10.old/src/ftview.c	2005-05-26 02:31:14.000000000 +0800
+++ ft2demos-2.1.10/src/ftview.c	2006-03-18 09:32:41.000000000 +0800
@@ -84,6 +84,7 @@
     FTC_ScalerRec  scaler;
     FT_Stroker     stroker = NULL;
     int            i;
+    FT_ULong       gindex;
     grBitmap       bit3;
 
 
@@ -117,20 +118,18 @@
     y = start_y;
 
     i = first_index;
-    i = first_index;
 
-    while ( i < face->num_glyphs )
+    while ( i < num_indices)
     {
       int           left, top, x_advance, y_advance, x_top, y_top;
       FT_GlyphSlot  slot = size->face->glyph;
       FT_Glyph      glyphp;
 
-#if 0
-      gindex = *(unsigned char*)p;
-      if ( encoding == FT_ENCODING_NONE )
+      gindex = i;
+      if ( encoding != FT_ENCODING_NONE )
         gindex = get_glyph_index( gindex );
-#endif
-      error = FT_Load_Glyph( size->face, i, FT_LOAD_NO_BITMAP );
+
+      error = FT_Load_Glyph( size->face, gindex, FT_LOAD_NO_BITMAP );
       if ( !error && slot->format == FT_GLYPH_FORMAT_OUTLINE )
       {
         FT_Glyph  glyphb;
@@ -199,6 +198,7 @@
     FT_F26Dot6     start_x, start_y, step_x, step_y, x, y;
     FTC_ScalerRec  scaler;
     int            i;
+    FT_ULong       gindex;
     grBitmap       bit3;
 
 
@@ -222,20 +222,18 @@
     y = start_y;
 
     i = first_index;
-    i = first_index;
 
-    while ( i < face->num_glyphs )
+    while ( i < num_indices)
     {
       int           left, top, x_advance, y_advance, x_top, y_top;
       FT_GlyphSlot  slot = size->face->glyph;
       FT_Glyph      glyphp;
 
-#if 0
-      gindex = *(unsigned char*)p;
-      if ( encoding == FT_ENCODING_NONE )
+      gindex = i;
+      if ( encoding != FT_ENCODING_NONE )
         gindex = get_glyph_index( gindex );
-#endif
-      error = FT_Load_Glyph( size->face, i, FT_LOAD_DEFAULT );
+
+      error = FT_Load_Glyph( size->face, gindex, FT_LOAD_DEFAULT );
       if ( !error )
       {
         FT_Glyph  glyphb;
_______________________________________________
Freetype-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/freetype-devel

Reply via email to