Skip to content

Commit

Permalink
fix TTF parsing bugs (#579)
Browse files Browse the repository at this point in the history
* ttf: support version 0.5 of "maxp" table (used by fonts with CFF
outlines)

* ttf: do not try to read data outside of the stream of "post" table,
fixes #351

* ttf: version10 -> is_version10
  • Loading branch information
armijnhemel authored Feb 5, 2022
1 parent b45d470 commit 8068182
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion font/ttf.ksy
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,14 @@ types:
- id: num_glyphs
type: u2
doc: 'The number of glyphs in the font.'
- id: version10_body
type: maxp_version10_body
if: is_version10
instances:
is_version10:
value: table_version_number.major == 1 and table_version_number.minor == 0
maxp_version10_body:
seq:
- id: max_points
type: u2
doc: 'Maximum points in a non-composite glyph.'
Expand Down Expand Up @@ -887,7 +895,7 @@ types:
- id: glyph_names
type: pascal_string
repeat: until
repeat-until: _.length == 0
repeat-until: _.length == 0 or _io.eof
seq:
- id: format
type: fixed
Expand Down

0 comments on commit 8068182

Please sign in to comment.