freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Git][freetype/freetype-demos][master] * src/ftdump.c (Print_Charmaps):


From: Alexei Podtelezhnikov (@apodtele)
Subject: [Git][freetype/freetype-demos][master] * src/ftdump.c (Print_Charmaps): Add PCF/BDF/FNT charset info.
Date: Sat, 01 May 2021 03:41:56 +0000

Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType Demo Programs

Commits:

2 changed files:

Changes:

  • ChangeLog
    1
    +2021-04-30  Alexei Podtelezhnikov  <apodtele@gmail.com>
    
    2
    +
    
    3
    +	* src/ftdump.c (Print_Charmaps): Add PCF/BDF/FNT charset info.
    
    4
    +
    
    1 5
     2021-04-10  Alexei Podtelezhnikov  <apodtele@gmail.com>
    
    2 6
     
    
    3 7
     	* graph/rules.mk: Warn about missing graphics driver.
    

  • src/ftdump.c
    ... ... @@ -15,6 +15,8 @@
    15 15
     #include FT_TRUETYPE_TABLES_H
    
    16 16
     #include FT_TRUETYPE_TAGS_H
    
    17 17
     #include FT_MULTIPLE_MASTERS_H
    
    18
    +#include FT_BDF_H
    
    19
    +#include FT_WINFONTS_H
    
    18 20
     
    
    19 21
       /* showing driver name */
    
    20 22
     #include FT_MODULE_H
    
    ... ... @@ -503,30 +505,36 @@
    503 505
     
    
    504 506
         for( i = 0; i < face->num_charmaps; i++ )
    
    505 507
         {
    
    506
    -      FT_Long   format  = FT_Get_CMap_Format( face->charmaps[i] );
    
    507
    -      FT_ULong  lang_id = FT_Get_CMap_Language_ID( face->charmaps[i] );
    
    508
    +      FT_CharMap   cmap = face->charmaps[i];
    
    509
    +      FT_Long      format  = FT_Get_CMap_Format( cmap );
    
    510
    +      FT_ULong     lang_id = FT_Get_CMap_Language_ID( cmap );
    
    511
    +      const char*  encoding;
    
    512
    +      const char*  registry;
    
    508 513
     
    
    514
    +      FT_WinFNT_HeaderRec  header;
    
    509 515
     
    
    510
    -      if ( format >= 0 )
    
    511
    -        printf( "  %2d: format %2ld, platform %u, encoding %2u",
    
    512
    -                i,
    
    513
    -                format,
    
    514
    -                face->charmaps[i]->platform_id,
    
    515
    -                face->charmaps[i]->encoding_id );
    
    516
    -      else
    
    517
    -        printf( "  %2d: synthetic, platform %u, encoding %2u",
    
    518
    -                i,
    
    519
    -                face->charmaps[i]->platform_id,
    
    520
    -                face->charmaps[i]->encoding_id );
    
    521 516
     
    
    522
    -      if ( lang_id == 0xFFFFFFFFUL )
    
    523
    -        printf( "   (Unicode Variation Sequences)" );
    
    524
    -      else
    
    525
    -        printf( "   language %lu",
    
    526
    -                lang_id );
    
    517
    +      printf( cmap->encoding ? " %c%2d: %c%c%c%c"
    
    518
    +                             : " %c%2d: none",
    
    519
    +              i == active ? '*' : ' ',
    
    520
    +              i,
    
    521
    +              cmap->encoding >> 24,
    
    522
    +              cmap->encoding >> 16,
    
    523
    +              cmap->encoding >> 8,
    
    524
    +              cmap->encoding );
    
    527 525
     
    
    528
    -      if ( i == active )
    
    529
    -        printf( " (active)" );
    
    526
    +      printf( ", platform %u, encoding %2u",
    
    527
    +              cmap->platform_id,
    
    528
    +              cmap->encoding_id );
    
    529
    +
    
    530
    +      if ( format >= 0 )
    
    531
    +        printf( lang_id != 0xFFFFFFFFUL ? ", format %2lu, language %lu "
    
    532
    +                                        : ", format %2lu, UVS",
    
    533
    +                format, lang_id );
    
    534
    +      else if ( !FT_Get_BDF_Charset_ID( face, &encoding, &registry ) )
    
    535
    +        printf( ", charset %s-%s", registry, encoding );
    
    536
    +      else if ( !FT_Get_WinFNT_Header( face, &header ) )
    
    537
    +        printf( ", charset %d", header.charset );
    
    530 538
     
    
    531 539
           printf ( "\n" );
    
    532 540
     
    
    ... ... @@ -537,7 +545,7 @@
    537 545
             FT_String  buf[32];
    
    538 546
     
    
    539 547
     
    
    540
    -        FT_Set_Charmap( face, face->charmaps[i] );
    
    548
    +        FT_Set_Charmap( face, cmap );
    
    541 549
     
    
    542 550
             charcode = FT_Get_First_Char( face, &gindex );
    
    543 551
             while ( gindex )
    
    ... ... @@ -562,7 +570,7 @@
    562 570
             const char*  f3 = "";
    
    563 571
     
    
    564 572
     
    
    565
    -        FT_Set_Charmap( face, face->charmaps[i] );
    
    573
    +        FT_Set_Charmap( face, cmap );
    
    566 574
     
    
    567 575
             next = FT_Get_First_Char( face, &gindex );
    
    568 576
             while ( gindex )
    


  • reply via email to

    [Prev in Thread] Current Thread [Next in Thread]