From 914b47403052ad6979029f51de925cd7f96053c1 Mon Sep 17 00:00:00 2001 From: Celeste Liu Date: Sun, 4 Jan 2026 01:35:57 +0800 Subject: [PATCH] [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 --- src/base/ftobjs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c index cced4fed0..7c4aedf6a 100644 --- a/src/base/ftobjs.c +++ b/src/base/ftobjs.c @@ -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;