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

Implement dependencies on required font tables in OpenType format #353

Merged

Conversation

brendanzab
Copy link
Member

@brendanzab brendanzab commented Apr 29, 2022

This allows for dependencies between the required font tables in OpenType. I still need to figure out how to allow for dependencies on optional font tables, but I think it’s nice to make progress on this!

To do this I added the following builtins to Fathom:

  • Option : Type -> Type
  • some : fun (A : Type) -> A -> Option A
  • none : fun (A : Type) -> Option A
  • fold : fun (A : Type) (B : Type) -> B -> (A -> B) -> Option A -> B
  • array8_find : fun (len : U8) (A : Type) -> (A -> Bool) -> Array8 len A -> Option A
  • array16_find : fun (len : U16) (A : Type) -> (A -> Bool) -> Array16 len A -> Option A
  • array32_find : fun (len : U32) (A : Type) -> (A -> Bool) -> Array32 len A -> Option A
  • array64_find : fun (len : U64) (A : Type) -> (A -> Bool) -> Array64 len A -> Option A
  • unwrap : fun (A : Type) -> Option A -> Format (where Repr (unwrap A option_a) = A)

It was a fun idea to try to use more understnable names, but this makes it a bit easier to keep track of the names.
@brendanzab brendanzab changed the title Opentype/format table dependencies Implement dependencies on required font tables in OpenType format Apr 29, 2022
doc/reference.md Outdated Show resolved Hide resolved
@mikeday
Copy link
Contributor

mikeday commented Apr 29, 2022

Very exciting stuff!

@wezm
Copy link
Contributor

wezm commented Apr 29, 2022

All those new built-ins look like they will be super useful!

@brendanzab
Copy link
Member Author

I might go ahead and merge this if folks are cool with it! Unless you want to merge #351 first?

@wezm
Copy link
Contributor

wezm commented Apr 29, 2022

Fine with me, merge away!

@brendanzab brendanzab merged commit b8e8b31 into yeslogic:main May 2, 2022
@brendanzab brendanzab deleted the opentype/format-table-dependencies branch May 2, 2022 23:42
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