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

Define remaining required OpenType tables #351

Merged
merged 4 commits into from
May 4, 2022
Merged

Define remaining required OpenType tables #351

merged 4 commits into from
May 4, 2022

Conversation

wezm
Copy link
Contributor

@wezm wezm commented Apr 28, 2022

This adds:

  • OS/2
  • post
  • Enable the name records in the name table.

post version 2 (embedded Pascal string glyph names) does not currently parse the names. I think this would be possible if there was a way to get the maximum (numeric) value from an array. That maximum value is the number of glyph names to read, which would allow something like

let pascal_string = {
    length <- u8,
    string <- array8 length u8
};

string_data <- array16 num_strings pascal_string,

Also is there a better way to handle the layering of versions in OS/2?

@mikeday
Copy link
Contributor

mikeday commented Apr 28, 2022

It might be time to make an issue for "sequences of unspecified length", with the glyph names example and also the glyf flags example and others as we encounter them.

formats/opentype.fathom Outdated Show resolved Hide resolved
@brendanzab
Copy link
Member

It might be time to make an issue for "sequences of unspecified length", with the glyph names example and also the glyf flags example and others as we encounter them.

I did have #310 open which might do part of what we need, but I wasn't entirely happy with how I implemented the binary parser portion of it. Haven't got back to it yet.

@wezm
Copy link
Contributor Author

wezm commented Apr 28, 2022

It might be time to make an issue for "sequences of unspecified length", with the glyph names example and also the glyf flags example and others as we encounter them.

I opened #352 for this.

Base automatically changed from glyf to main April 28, 2022 02:03
@@ -1314,8 +1489,8 @@ let table_directory = fun (file_start : Pos) => {
maxp.num_glyphs,
},
name <- required_table "name" name_table,
os2 <- required_table "OS/2" unknown_table,
post <- required_table "post" unknown_table,
os2 <- required_table_with_len "OS/2" os2_table,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brendanzab I rebased on main. I added this new function because OS/2 needs access to the table length. Not sure if this is the best way or not.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh cool, yeah I think this is ok for now! 👍

@wezm wezm merged commit aecf919 into main May 4, 2022
@wezm wezm deleted the extend-opentype branch May 4, 2022 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants