72 |
# endif |
# endif |
73 |
#endif |
#endif |
74 |
fprintf( stderr, " -n print SFNT name tables\n" ); |
fprintf( stderr, " -n print SFNT name tables\n" ); |
75 |
|
fprintf( stderr, " -c show the contents of charmaps\n" ); |
76 |
fprintf( stderr, "\n" ); |
fprintf( stderr, "\n" ); |
77 |
|
|
78 |
exit( 1 ); |
exit( 1 ); |
494 |
|
|
495 |
|
|
496 |
void |
void |
497 |
Print_Charmaps( FT_Face face ) |
Print_Charmaps( FT_Face face, |
498 |
|
int verbose ) |
499 |
{ |
{ |
500 |
int i; |
int i, active; |
501 |
|
|
502 |
|
|
503 |
|
if ( verbose ) |
504 |
|
active = FT_Get_Charmap_Index( face->charmap ); |
505 |
|
|
506 |
/* CharMaps */ |
/* CharMaps */ |
507 |
printf( "charmaps\n" ); |
printf( "charmaps\n" ); |
512 |
i, |
i, |
513 |
face->charmaps[i]->platform_id, |
face->charmaps[i]->platform_id, |
514 |
face->charmaps[i]->encoding_id ); |
face->charmaps[i]->encoding_id ); |
515 |
|
|
516 |
|
if ( ( verbose && i == active ) || verbose > 1 ) |
517 |
|
{ |
518 |
|
FT_ULong charcode; |
519 |
|
FT_UInt gindex; |
520 |
|
|
521 |
|
|
522 |
|
FT_Set_Charmap( face, face->charmaps[i] ); |
523 |
|
|
524 |
|
charcode = FT_Get_First_Char( face, &gindex ); |
525 |
|
while ( gindex ) |
526 |
|
{ |
527 |
|
printf( " 0x%04lx => %d\n", charcode, gindex ); |
528 |
|
charcode = FT_Get_Next_Char( face, charcode, &gindex ); |
529 |
|
} |
530 |
|
printf( "\n" ); |
531 |
|
} |
532 |
} |
} |
533 |
} |
} |
534 |
|
|
543 |
char* execname; |
char* execname; |
544 |
int num_faces; |
int num_faces; |
545 |
int option; |
int option; |
546 |
|
int verbose_cmap = 0; |
547 |
|
|
548 |
FT_Library library; /* the FreeType library */ |
FT_Library library; /* the FreeType library */ |
549 |
FT_Face face; /* the font face */ |
FT_Face face; /* the font face */ |
553 |
|
|
554 |
while ( 1 ) |
while ( 1 ) |
555 |
{ |
{ |
556 |
option = getopt( argc, argv, "dl:n" ); |
option = getopt( argc, argv, "dl:nc" ); |
557 |
|
|
558 |
if ( option == -1 ) |
if ( option == -1 ) |
559 |
break; |
break; |
570 |
usage( execname ); |
usage( execname ); |
571 |
break; |
break; |
572 |
|
|
573 |
|
case 'c': |
574 |
|
verbose_cmap++; |
575 |
|
break; |
576 |
|
|
577 |
case 'n': |
case 'n': |
578 |
name_tables = 1; |
name_tables = 1; |
579 |
break; |
break; |
686 |
if ( face->num_charmaps ) |
if ( face->num_charmaps ) |
687 |
{ |
{ |
688 |
printf( "\n" ); |
printf( "\n" ); |
689 |
Print_Charmaps( face ); |
Print_Charmaps( face, verbose_cmap ); |
690 |
} |
} |
691 |
|
|
692 |
FT_Done_Face( face ); |
FT_Done_Face( face ); |