summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSigrid <ftrvxmtrx@gmail.com>2020-08-05 14:25:21 +0200
committerSigrid <ftrvxmtrx@gmail.com>2020-08-05 14:25:21 +0200
commit1cddff55da9e7fad085bb446ae9c786e9511c8d3 (patch)
treee694ba1a5712222ed2ea12a0761332b87fd9bb52
parente1da4f17500da3350ffd32de3819094ea1e42ee9 (diff)
downloadplan9front-1cddff55da9e7fad085bb446ae9c786e9511c8d3.tar.xz
libttf: fix cmap subtable offset type and rank UCS-4 higher (more codepoints). fixes runes > 0xffff
-rw-r--r--sys/src/libttf/cmap.c10
1 files 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 */