You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cannot produce outlines for TrueType fonts with 65536 glyphs #213
For TrueType fonts with the maximum number of glyphs, the code below early returns because the range of u16 is exceeded, leading to loca table parsing failing:
In principle, this should not be that hard to fix because a usize (actual_total) is cast to a u16 just to be cast back to a usize in read_array. But I'm not sure what a clean fix would look like.
Activity
laurmaedje commentedon Jun 4, 2026
In principle, this should not be that hard to fix because a usize (
actual_total) is cast to au16just to be cast back to a usize inread_array. But I'm not sure what a clean fix would look like.I'm also not sure what the idea behind this is:
ttf-parser/src/tables/loca.rs
Lines 30 to 37 in 6e75b3c
ttf-parser/src/tables/loca.rs
Lines 78 to 80 in 6e75b3c
At first glance, this seems like the last glyph simply cannot be outlined (which is better than no glyph being outlinable! but not ideal.)
RazrFalcon commentedon Jun 5, 2026
Ugh... so we have to switch u16 to u32 for count, slices, etc. That's would be a lot of work.
0xFFFF + 1 would overflow. That's what this check for. Overly verbose, sure, but still.
patch failure mode if font has 65536 glyphs. Tests passed.