/[freetype]/ft2demos/src/ftdump.c
ViewVC logotype

Diff of /ft2demos/src/ftdump.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.20 by olvaffe, Wed Nov 30 06:16:15 2005 UTC revision 1.21 by wl, Wed Nov 30 08:45:12 2005 UTC
# Line 2  Line 2 
2  /*                                                                          */  /*                                                                          */
3  /*  The FreeType project -- a free and portable quality TrueType renderer.  */  /*  The FreeType project -- a free and portable quality TrueType renderer.  */
4  /*                                                                          */  /*                                                                          */
5  /*  Copyright 1996-2000, 2003, 2004 by                                      */  /*  Copyright 1996-2000, 2003, 2004, 2005 by                                */
6  /*  D. Turner, R.Wilhelm, and W. Lemberg                                    */  /*  D. Turner, R.Wilhelm, and W. Lemberg                                    */
7  /*                                                                          */  /*                                                                          */
8  /****************************************************************************/  /****************************************************************************/
# Line 31  Line 31 
31    FT_Error  error;    FT_Error  error;
32    
33    int  comma_flag  = 0;    int  comma_flag  = 0;
34      int  verbose     = 0;
35    int  debug       = 0;    int  debug       = 0;
36    int  trace_level = 0;    int  trace_level = 0;
37    int  name_tables = 0;    int  name_tables = 0;
# Line 72  Line 73 
73  #  endif  #  endif
74  #endif  #endif
75      fprintf( stderr, "  -n        print SFNT name tables\n" );      fprintf( stderr, "  -n        print SFNT name tables\n" );
76      fprintf( stderr, "  -c        show the contents of charmaps\n" );      fprintf( stderr, "  -v        be verbose\n" );
77      fprintf( stderr, "\n" );      fprintf( stderr, "\n" );
78    
79      exit( 1 );      exit( 1 );
# Line 494  Line 495 
495    
496    
497    void    void
498    Print_Charmaps( FT_Face  face,    Print_Charmaps( FT_Face  face )
                   int      verbose )  
499    {    {
500      int  i, active;      int  i, active = -1;
501    
502    
503      if ( verbose )      if ( face->charmap )
504      {        active = FT_Get_Charmap_Index( face->charmap );
       if ( face->charmap )  
         active = FT_Get_Charmap_Index( face->charmap );  
       else  
         active = -1;  
     }  
505    
506      /* CharMaps */      /* CharMaps */
507      printf( "charmaps\n" );      printf( "charmaps\n" );
508    
509      for( i = 0; i < face->num_charmaps; i++ )      for( i = 0; i < face->num_charmaps; i++ )
510      {      {
511        printf( "   %d: platform: %d, encoding: %d\n",        printf( "   %d: platform %d, encoding %d",
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          if ( i == active )
516            printf( " (active)" );
517          printf ( "\n" );
518    
519        if ( ( verbose && i == active ) || verbose > 1 )        if ( verbose )
520        {        {
521          FT_ULong  charcode;          FT_ULong  charcode;
522          FT_UInt   gindex;          FT_UInt   gindex;
# Line 548  Line 546 
546      char*  execname;      char*  execname;
547      int    num_faces;      int    num_faces;
548      int    option;      int    option;
     int    verbose_cmap = 0;  
549    
550      FT_Library  library;      /* the FreeType library */      FT_Library  library;      /* the FreeType library */
551      FT_Face     face;         /* the font face        */      FT_Face     face;         /* the font face        */
# Line 558  Line 555 
555    
556      while ( 1 )      while ( 1 )
557      {      {
558        option = getopt( argc, argv, "dl:nc" );        option = getopt( argc, argv, "dl:nv" );
559    
560        if ( option == -1 )        if ( option == -1 )
561          break;          break;
# Line 575  Line 572 
572            usage( execname );            usage( execname );
573          break;          break;
574    
       case 'c':  
         verbose_cmap++;  
         break;  
   
575        case 'n':        case 'n':
576          name_tables = 1;          name_tables = 1;
577          break;          break;
578    
579          case 'v':
580            verbose = 1;
581            break;
582    
583        default:        default:
584          usage( execname );          usage( execname );
585          break;          break;
# Line 691  Line 688 
688        if ( face->num_charmaps )        if ( face->num_charmaps )
689        {        {
690          printf( "\n" );          printf( "\n" );
691          Print_Charmaps( face, verbose_cmap );          Print_Charmaps( face );
692        }        }
693    
694        FT_Done_Face( face );        FT_Done_Face( face );

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26