* src/tools/ftfuzzer/ftfuzzer.cc: Handle fixed sizes (#46211).
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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
diff --git a/ChangeLog b/ChangeLog
index ef51026..0edd845 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-10-15 Bungeman <bungeman@gmail.com>
+ Werner Lemberg <wl@gnu.org>
+
+ * src/tools/ftfuzzer/ftfuzzer.cc: Handle fixed sizes (#46211).
+
2015-10-15 Werner Lemberg <wl@gnu.org>
[base] Compute MD5 checksums only if explicitly requested.
diff --git a/src/tools/ftfuzzer/ftfuzzer.cc b/src/tools/ftfuzzer/ftfuzzer.cc
index c4f5977..e5ab293 100644
--- a/src/tools/ftfuzzer/ftfuzzer.cc
+++ b/src/tools/ftfuzzer/ftfuzzer.cc
@@ -131,42 +131,59 @@ using namespace std;
&face ) )
continue;
- // set up 20pt at 72dpi as an arbitrary size
- FT_Set_Char_Size( face, 20, 20, 72, 72 );
-
- // test MM interface only for a face without a selected instance
- if ( instance_index == 0 )
- setIntermediateAxis( face );
-
- // loop over all glyphs
- for ( unsigned int glyph_index = 0;
- glyph_index < (unsigned int)face->num_glyphs;
- glyph_index++ )
+ // loop over all bitmap stroke sizes
+ // and an arbitrary size for outlines
+ for ( long fixed_sizes_index = 0;
+ fixed_sizes_index < face->num_fixed_sizes + 1;
+ fixed_sizes_index++ )
{
- if ( FT_Load_Glyph( face, glyph_index, load_flags ) )
- continue;
-
- // Rendering is the most expensive and the least interesting part.
- //
- // if ( FT_Render_Glyph( face->glyph, render_mode) )
- // continue;
- // FT_GlyphSlot_Embolden( face->glyph );
+ FT_Int32 flags = load_flags;
+
+ if ( !fixed_sizes_index )
+ {
+ // set up 20pt at 72dpi as an arbitrary size
+ FT_Set_Char_Size( face, 20, 20, 72, 72 );
+ flags |= FT_LOAD_NO_BITMAP;
+ }
+ else
+ {
+ FT_Select_Size( face, fixed_sizes_index - 1 );
+ flags |= FT_LOAD_COLOR;
+ }
+
+ // test MM interface only for a face without a selected instance
+ if ( instance_index == 0 )
+ setIntermediateAxis( face );
+
+ // loop over all glyphs
+ for ( unsigned int glyph_index = 0;
+ glyph_index < (unsigned int)face->num_glyphs;
+ glyph_index++ )
+ {
+ if ( FT_Load_Glyph( face, glyph_index, flags ) )
+ continue;
+
+ // Rendering is the most expensive and the least interesting part.
+ //
+ // if ( FT_Render_Glyph( face->glyph, render_mode) )
+ // continue;
+ // FT_GlyphSlot_Embolden( face->glyph );
#if 0
- FT_Glyph glyph;
- if ( !FT_Get_Glyph( face->glyph, &glyph ) )
- FT_Done_Glyph( glyph );
+ FT_Glyph glyph;
+ if ( !FT_Get_Glyph( face->glyph, &glyph ) )
+ FT_Done_Glyph( glyph );
- FT_Outline* outline = &face->glyph->outline;
- FT_Matrix rot30 = { 0xDDB4, -0x8000, 0x8000, 0xDDB4 };
+ FT_Outline* outline = &face->glyph->outline;
+ FT_Matrix rot30 = { 0xDDB4, -0x8000, 0x8000, 0xDDB4 };
- FT_Outline_Transform( outline, &rot30 );
+ FT_Outline_Transform( outline, &rot30 );
- FT_BBox bbox;
- FT_Outline_Get_BBox( outline, &bbox );
+ FT_BBox bbox;
+ FT_Outline_Get_BBox( outline, &bbox );
#endif
+ }
}
-
FT_Done_Face( face );
}
}