mirror of
https://github.com/freetype/freetype.git
synced 2026-10-23 11:08:54 +03:00
[base] Reject 'cmap' format 15 as an active charmap.
Like format 14, cmap format 15 is a supplemental Unicode variation-sequence subtable and cannot be selected as the face's ordinary character map. Assisted-by: OpenAI Codex <noreply@openai.com> * src/base/ftobjs.c (FT_Set_Charmap, find_unicode_charmap): Implement it.
This commit is contained in:
committed by
Werner Lemberg
parent
02881ccbfe
commit
ba4ee6c6bd
@@ -1461,8 +1461,14 @@
|
||||
{
|
||||
if ( cur[0]->encoding == FT_ENCODING_UNICODE )
|
||||
{
|
||||
face->charmap = cur[0];
|
||||
return FT_Err_Ok;
|
||||
FT_Long format = FT_Get_CMap_Format( cur[0] );
|
||||
|
||||
|
||||
if ( format != 14 && format != 15 )
|
||||
{
|
||||
face->charmap = cur[0];
|
||||
return FT_Err_Ok;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3796,11 +3802,16 @@
|
||||
|
||||
for ( ; cur < limit; cur++ )
|
||||
{
|
||||
if ( cur[0] == charmap &&
|
||||
FT_Get_CMap_Format ( charmap ) != 14 )
|
||||
if ( cur[0] == charmap )
|
||||
{
|
||||
face->charmap = cur[0];
|
||||
return FT_Err_Ok;
|
||||
FT_Long format = FT_Get_CMap_Format( charmap );
|
||||
|
||||
|
||||
if ( format != 14 && format != 15 )
|
||||
{
|
||||
face->charmap = cur[0];
|
||||
return FT_Err_Ok;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user