* 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.
This commit is contained in:
Alexei Podtelezhnikov 2022-10-03 17:13:30 +00:00
parent b93f20ab7a
commit 8faf57dd17

14
src/cache/ftccmap.c vendored
View File

@ -297,19 +297,17 @@
if ( cmap_index < face->num_charmaps )
{
FT_CharMap old, cmap = NULL;
FT_CharMap old = face->charmap;
FT_CharMap cmap = face->charmaps[cmap_index];
old = face->charmap;
cmap = face->charmaps[cmap_index];
if ( old != cmap && !no_cmap_change )
FT_Set_Charmap( face, cmap );
if ( !no_cmap_change )
face->charmap = cmap;
gindex = FT_Get_Char_Index( face, char_code );
if ( old != cmap && !no_cmap_change )
FT_Set_Charmap( face, old );
if ( !no_cmap_change )
face->charmap = old;
}
FTC_CMAP_NODE( node )->indices[char_code -