[base] Fix support for format 13 charmaps.

According to the OpenType specification of the 'cmap' table, the pair (0,6)
for platform and encoding IDs is used for format 13 charmap tables.  Commit
ba6f3e18 (from 2017-01-17) introduced the `TT_APPLE_ID_FULL_UNICODE` macro
(i.e., encoding_id == 6, added to OpenType 1.8); however, the corresponding
cmap selection code wasn't updated.

Unicode's Last Resort font (https://github.com/unicode-org/last-resort-font)
can be used to test a format 13 charmap.

Fixes issue #1383.

* src/base/ftobjc.s (find_unicode_charmap): Support
  `TT_APPLE_ID_FULL_UNICODE`.

Signed-off-by: Celeste Liu <uwu@coelacanthus.name>
This commit is contained in:
Celeste Liu
2026-01-04 01:35:57 +08:00
committed by Werner Lemberg
parent fc85a25584
commit 914b474030

View File

@@ -1413,7 +1413,10 @@
if ( ( cur[0]->platform_id == TT_PLATFORM_MICROSOFT &&
cur[0]->encoding_id == TT_MS_ID_UCS_4 ) ||
( cur[0]->platform_id == TT_PLATFORM_APPLE_UNICODE &&
cur[0]->encoding_id == TT_APPLE_ID_UNICODE_32 ) )
cur[0]->encoding_id == TT_APPLE_ID_UNICODE_32 ) ||
( cur[0]->platform_id == TT_PLATFORM_APPLE_UNICODE &&
cur[0]->encoding_id == TT_APPLE_ID_FULL_UNICODE &&
FT_Get_CMap_Format( cur[0] ) == 13 ) )
{
face->charmap = cur[0];
return FT_Err_Ok;