freetype-commit
[Top][All Lists]
Advanced

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

[Git][freetype/freetype][master] * src/cache/ftccmap.c (FTC_CMapCache_Lo


From: Alexei Podtelezhnikov (@apodtele)
Subject: [Git][freetype/freetype][master] * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Avoid `FT_Set_Charmap`.
Date: Mon, 03 Oct 2022 17:13:33 +0000

Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType

Commits:

  • 8faf57dd
    by Alexei Podtelezhnikov at 2022-10-03T17:13:30+00:00
    * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Avoid `FT_Set_Charmap`.
    
    Set charmap aggressively without all validations of `FT_Set_Charmap`
    because we take it from the available array and only temporarily.
    Even CMap Format 14 will gracefully return 0.

1 changed file:

Changes:

  • src/cache/ftccmap.c
    ... ... @@ -297,19 +297,17 @@
    297 297
     
    
    298 298
           if ( cmap_index < face->num_charmaps )
    
    299 299
           {
    
    300
    -        FT_CharMap  old, cmap  = NULL;
    
    300
    +        FT_CharMap  old  = face->charmap;
    
    301
    +        FT_CharMap  cmap = face->charmaps[cmap_index];
    
    301 302
     
    
    302 303
     
    
    303
    -        old  = face->charmap;
    
    304
    -        cmap = face->charmaps[cmap_index];
    
    305
    -
    
    306
    -        if ( old != cmap && !no_cmap_change )
    
    307
    -          FT_Set_Charmap( face, cmap );
    
    304
    +        if ( !no_cmap_change )
    
    305
    +          face->charmap = cmap;
    
    308 306
     
    
    309 307
             gindex = FT_Get_Char_Index( face, char_code );
    
    310 308
     
    
    311
    -        if ( old != cmap && !no_cmap_change )
    
    312
    -          FT_Set_Charmap( face, old );
    
    309
    +        if ( !no_cmap_change )
    
    310
    +          face->charmap = old;
    
    313 311
           }
    
    314 312
     
    
    315 313
           FTC_CMAP_NODE( node )->indices[char_code -
    


  • reply via email to

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