... |
... |
@@ -824,6 +824,83 @@ |
824
|
824
|
}
|
825
|
825
|
|
826
|
826
|
|
|
827
|
+ static void
|
|
828
|
+ header( FT_Face face )
|
|
829
|
+ {
|
|
830
|
+ const FT_String* target =
|
|
831
|
+ render_mode == FT_RENDER_MODE_NORMAL ? "normal" :
|
|
832
|
+ render_mode == FT_RENDER_MODE_LIGHT ? "light" :
|
|
833
|
+ render_mode == FT_RENDER_MODE_MONO ? "mono" :
|
|
834
|
+ render_mode == FT_RENDER_MODE_LCD ? "lcd" :
|
|
835
|
+ render_mode == FT_RENDER_MODE_LCD_V ? "lcd-v" :
|
|
836
|
+ render_mode == FT_RENDER_MODE_SDF ? "sdf" : "";
|
|
837
|
+ const FT_String* module_name = FT_FACE_DRIVER_NAME( face );
|
|
838
|
+ const FT_String* hinting_engine = "";
|
|
839
|
+ FT_UInt prop;
|
|
840
|
+
|
|
841
|
+
|
|
842
|
+ if ( !FT_IS_SCALABLE( face ) )
|
|
843
|
+ hinting_engine = "bitmap";
|
|
844
|
+
|
|
845
|
+ else if ( load_flags & FT_LOAD_NO_SCALE )
|
|
846
|
+ hinting_engine = "unscaled";
|
|
847
|
+
|
|
848
|
+ else if ( load_flags & FT_LOAD_NO_HINTING )
|
|
849
|
+ hinting_engine = "unhinted";
|
|
850
|
+
|
|
851
|
+ else if ( render_mode == FT_RENDER_MODE_LIGHT )
|
|
852
|
+ hinting_engine = "auto";
|
|
853
|
+
|
|
854
|
+ else if ( load_flags == FT_LOAD_FORCE_AUTOHINT )
|
|
855
|
+ hinting_engine = "auto";
|
|
856
|
+
|
|
857
|
+ else if ( !FT_Property_Get( lib, module_name,
|
|
858
|
+ "interpreter-version", &prop ) )
|
|
859
|
+ {
|
|
860
|
+ switch ( prop )
|
|
861
|
+ {
|
|
862
|
+ case TT_INTERPRETER_VERSION_35:
|
|
863
|
+ hinting_engine = "v35";
|
|
864
|
+ break;
|
|
865
|
+ case TT_INTERPRETER_VERSION_38:
|
|
866
|
+ hinting_engine = "v38";
|
|
867
|
+ break;
|
|
868
|
+ case TT_INTERPRETER_VERSION_40:
|
|
869
|
+ hinting_engine = "v40";
|
|
870
|
+ break;
|
|
871
|
+ }
|
|
872
|
+ }
|
|
873
|
+
|
|
874
|
+ else if ( !FT_Property_Get( lib, module_name,
|
|
875
|
+ "hinting-engine", &prop ) )
|
|
876
|
+ {
|
|
877
|
+ switch ( prop )
|
|
878
|
+ {
|
|
879
|
+ case FT_HINTING_FREETYPE:
|
|
880
|
+ hinting_engine = "FT";
|
|
881
|
+ break;
|
|
882
|
+ case FT_HINTING_ADOBE:
|
|
883
|
+ hinting_engine = "Adobe";
|
|
884
|
+ break;
|
|
885
|
+ }
|
|
886
|
+ }
|
|
887
|
+
|
|
888
|
+ printf( "\n"
|
|
889
|
+ "family: %s\n"
|
|
890
|
+ " style: %s\n"
|
|
891
|
+ "driver: %s %s\n"
|
|
892
|
+ "target: %s\n"
|
|
893
|
+ " flags: 0x%X\n"
|
|
894
|
+ "glyphs: %ld\n",
|
|
895
|
+ face->family_name,
|
|
896
|
+ face->style_name,
|
|
897
|
+ module_name, hinting_engine,
|
|
898
|
+ target,
|
|
899
|
+ load_flags,
|
|
900
|
+ face->num_glyphs );
|
|
901
|
+ }
|
|
902
|
+
|
|
903
|
+
|
827
|
904
|
static FT_Error
|
828
|
905
|
get_face( FT_Face* face )
|
829
|
906
|
{
|
... |
... |
@@ -1250,15 +1327,7 @@ |
1250
|
1327
|
putchar( '-' );
|
1251
|
1328
|
putchar( '\n' );
|
1252
|
1329
|
|
1253
|
|
- printf( "\n"
|
1254
|
|
- "family: %s\n"
|
1255
|
|
- " style: %s\n"
|
1256
|
|
- "driver: %s\n"
|
1257
|
|
- "glyphs: %ld\n",
|
1258
|
|
- face->family_name,
|
1259
|
|
- face->style_name,
|
1260
|
|
- FT_FACE_DRIVER_NAME( face ),
|
1261
|
|
- face->num_glyphs );
|
|
1330
|
+ header( face );
|
1262
|
1331
|
|
1263
|
1332
|
if ( !face->num_glyphs )
|
1264
|
1333
|
goto Exit;
|
... |
... |
@@ -1303,31 +1372,16 @@ |
1303
|
1372
|
font_type.flags = load_flags;
|
1304
|
1373
|
|
1305
|
1374
|
printf( "\n"
|
1306
|
|
- "glyph indices: from %d to %d\n"
|
1307
|
|
- "face size: %u ppem\n"
|
1308
|
1375
|
"font preloading into memory: %s\n"
|
1309
|
1376
|
"maximum cache size: %lu KiByte\n",
|
1310
|
|
- first_index, last_index,
|
1311
|
|
- size,
|
1312
|
1377
|
preload ? "yes" : "no",
|
1313
|
1378
|
max_bytes / 1024 );
|
1314
|
1379
|
|
1315
|
1380
|
printf( "\n"
|
1316
|
|
- "load flags: 0x%X\n"
|
1317
|
|
- "render mode: %u\n",
|
1318
|
|
- load_flags,
|
1319
|
|
- render_mode );
|
1320
|
|
-
|
1321
|
|
- printf( "\n"
|
1322
|
|
- "T1/CFF hinting engine set to `%s'\n"
|
1323
|
|
- "TrueType interpreter set to version %d\n",
|
1324
|
|
- engine,
|
1325
|
|
- version );
|
1326
|
|
-
|
1327
|
|
- printf( "\n"
|
|
1381
|
+ "testing glyph indices from %d to %d at %u ppem\n"
|
1328
|
1382
|
"number of seconds for each test: %s%g\n",
|
1329
|
|
- max_iter ? "at most " : "",
|
1330
|
|
- max_time );
|
|
1383
|
+ first_index, last_index, size,
|
|
1384
|
+ max_iter ? "at most " : "", max_time );
|
1331
|
1385
|
if ( max_iter )
|
1332
|
1386
|
printf( "number of iterations for each test: at most %d\n",
|
1333
|
1387
|
max_iter );
|