From 1cddff55da9e7fad085bb446ae9c786e9511c8d3 Mon Sep 17 00:00:00 2001 From: Sigrid Date: Wed, 5 Aug 2020 14:25:21 +0200 Subject: [PATCH] libttf: fix cmap subtable offset type and rank UCS-4 higher (more codepoints). fixes runes > 0xffff --- sys/src/libttf/cmap.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/src/libttf/cmap.c b/sys/src/libttf/cmap.c index 94092f03e..fe957c88d 100644 --- a/sys/src/libttf/cmap.c +++ b/sys/src/libttf/cmap.c @@ -90,9 +90,9 @@ static int ttfgotosub(TTFontU *f) { int i; - u16int nsub, id, sid, off; + u16int nsub, id, sid; int rank, maxrank; - u32int maxoff; + u32int maxoff, off; #define SUBID(a,b) ((a)<<16|(b)) if(ttfgototable(f, "cmap") < 0) @@ -106,13 +106,13 @@ ttfgotosub(TTFontU *f) case SUBID(0, 4): /* Unicode 2.0 or later (BMP and non-BMP) */ rank = 100; break; + case SUBID(3, 10): /* Windows, UCS-4 */ + rank = 80; + break; case SUBID(0, 0): /* Unicode default */ case SUBID(0, 1): /* Unicode 1.1 */ case SUBID(0, 2): /* ISO 10646 */ case SUBID(0, 3): /* Unicode 2.0 (BMP) */ - rank = 80; - break; - case SUBID(3, 10): /* Windows, UCS-4 */ rank = 60; break; case SUBID(3, 1): /* Windows, UCS-2 */