diff options
author | philg314 <philg314@fastmail.com> | 2022-08-11 11:42:22 +0000 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2024-07-28 16:59:40 +0000 |
commit | 7532e3ad70441041395c77d12424edd31cf63a42 (patch) | |
tree | 58afcb1b9e86537f90b88a70335528faaf994557 /write.c | |
parent | 6eeb52757c9d2d1f40a3d31a6b6d3925dc17fbb2 (diff) |
Fix `cmap` Subtable Format 4 `entrySelector`
https://docs.microsoft.com/en-us/typography/opentype/spec/cmap defines
`entrySelector` as "Log2 of the maximum power of 2 less than or equal to
numTables (log2(searchRange/2), which is equal to floor(log2(segCount)))"
Part-of: <https://gitlab.freedesktop.org/xorg/app/fonttosfnt/-/merge_requests/17>
Diffstat (limited to 'write.c')
-rw-r--r-- | write.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -875,7 +875,7 @@ writecmap(FILE* out, FontPtr font) /* How baroque can you get? */ writeUSHORT(out, segcount * 2); /* segCountX2 */ writeUSHORT(out, 2 * two_log2_floor(segcount)); /* searchRange */ - writeUSHORT(out, 1 + log2_floor(segcount)); /* entrySelector */ + writeUSHORT(out, log2_floor(segcount)); /* entrySelector */ writeUSHORT(out, 2 * (segcount - two_log2_floor(segcount))); /* rangeShift */ |