/[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.18 by werner, Mon May 10 20:54:54 2004 UTC revision 1.19 by olvaffe, Wed Nov 30 05:18:10 2005 UTC
# Line 72  Line 72 
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 );
# Line 493  Line 494 
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" );
# Line 507  Line 512 
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    
# Line 521  Line 543 
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        */
# Line 530  Line 553 
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;
# Line 547  Line 570 
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;
# Line 659  Line 686 
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 );

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19

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