Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subset fails: OTS parsing error: hhea: misaligned table #119

Closed
OlegKunitsyn opened this issue Mar 3, 2023 · 2 comments · Fixed by #124
Closed

Subset fails: OTS parsing error: hhea: misaligned table #119

OlegKunitsyn opened this issue Mar 3, 2023 · 2 comments · Fixed by #124
Labels
Milestone

Comments

@OlegKunitsyn
Copy link
Contributor

Any subset of OpenSans-Regular.ttf throws an error in FF and Chrome:
OTS parsing error: hhea: misaligned table

@bsweeney
Copy link
Member

bsweeney commented Mar 3, 2023

Any issues during subset creation? I'm able to create a subset but during the process there's a parsing issue. This could be the cause of the invalid formatting of the subset.

Undefined offset: XXX in D:\code\php-font-lib\php-font-lib\src\FontLib\Glyph\OutlineComposite.php on line 230

(the specific offset depends on the subset)

@bsweeney
Copy link
Member

It looks like the mis-aligned table issue is actually caused by a lack of table padding in the generated font. Tables are supposed to conform to a 4-byte block size (i.e. the size of the table should be a multiple of 4). If the table doesn't fully fill a block php-font-lib should be padding it out but it was not.

bsweeney added a commit that referenced this issue Oct 16, 2023
Per the spec:

> The length of any table is a multiple of four bytes, or that tables are padded with zero to four byte-aligned offsets. Actual table lengths recorded in the TableDirectory should not include padding.

fixes #119
bsweeney added a commit that referenced this issue Oct 16, 2023
Per the spec:

> The length of any table is a multiple of four bytes, or that tables are padded with zero to four byte-aligned offsets. Actual table lengths recorded in the TableDirectory should not include padding.

fixes #119
bsweeney added a commit that referenced this issue Oct 16, 2023
Per the spec:

> The length of any table is a multiple of four bytes, or that tables are padded with zero to four byte-aligned offsets. Actual table lengths recorded in the TableDirectory should not include padding.

fixes #119
bsweeney added a commit that referenced this issue Dec 12, 2023
Per the spec:

> The length of any table is a multiple of four bytes, or that tables are padded with zero to four byte-aligned offsets. Actual table lengths recorded in the TableDirectory should not include padding.

fixes #119
bsweeney added a commit that referenced this issue Dec 12, 2023
Per the spec:

> The length of any table is a multiple of four bytes, or that tables are padded with zero to four byte-aligned offsets. Actual table lengths recorded in the TableDirectory should not include padding.

fixes #119
bsweeney added a commit that referenced this issue Dec 30, 2023
Per the spec:

> The length of any table is a multiple of four bytes, or that tables are padded with zero to four byte-aligned offsets. Actual table lengths recorded in the TableDirectory should not include padding.

fixes #119
bsweeney added a commit that referenced this issue Jan 6, 2024
Per the spec:

> The length of any table is a multiple of four bytes, or that tables are padded with zero to four byte-aligned offsets. Actual table lengths recorded in the TableDirectory should not include padding.

fixes #119
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants