summaryrefslogtreecommitdiff
path: root/src/sfnt/ttcmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sfnt/ttcmap.c')
-rw-r--r--src/sfnt/ttcmap.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/sfnt/ttcmap.c b/src/sfnt/ttcmap.c
index b995e5c05..f6c02f907 100644
--- a/src/sfnt/ttcmap.c
+++ b/src/sfnt/ttcmap.c
@@ -547,9 +547,19 @@
}
}
- /* jump to next sub-header, i.e. higher byte value */
+ /* If `charcode' is <= 0xFF, retry with `charcode + 1'. If */
+ /* `charcode' is 0x100 after the loop, do nothing since we have */
+ /* just reached the first sub-header for two-byte character codes. */
+ /* */
+ /* For all other cases, we jump to the next sub-header and adjust */
+ /* `charcode' accordingly. */
Next_SubHeader:
- charcode = FT_PAD_FLOOR( charcode, 256 ) + 256;
+ if ( charcode <= 0xFF )
+ charcode++;
+ else if ( charcode == 0x100 )
+ ;
+ else
+ charcode = FT_PAD_FLOOR( charcode, 0x100 ) + 0x100;
}
Exit: