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

[write-fonts] glyf & loca improvements #558

Merged
merged 1 commit into from
Aug 3, 2023
Merged

Conversation

cmyr
Copy link
Member

@cmyr cmyr commented Aug 3, 2023

This adds a loca module and a Loca table, and also adds a Glyph enum to represent either a simple or composite glyph.

A follow-up patch will add a builder type for constructing the glyf and loca tables.

I noticed that a lot of this stuff had been implemented in fontc, but it feels like it really belongs here.

@cmyr cmyr mentioned this pull request Aug 3, 2023
Copy link
Member

@dfrg dfrg left a comment

Choose a reason for hiding this comment

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

Glad to see this getting some attention. LGTM

}

/// 'true' if the glyph contains no contours or components
pub fn is_empty(&self) -> bool {
Copy link
Member

Choose a reason for hiding this comment

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

General curiosity: should we have an Empty variant? This is a bit weird on the read-fonts side too. I believe I updated the loca table at some point to return Result<Option<.. to capture this but it didn't feel good.

Copy link
Member Author

Choose a reason for hiding this comment

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

Interesting idea, maybe worth opening an issue to discuss? It's true that something has probably gone wrong if you ever have a simple or composite glyph that's empty, I'm not sure how that would happen intentionally.

This adds a loca module and a Loca table, and also adds a Glyph enum to
represent either a simple or composite glyph.

A follow-up patch will add a builder type for constructing the glyf and
loca tables.
@cmyr cmyr merged commit 12f70f7 into main Aug 3, 2023
7 checks passed
@cmyr cmyr deleted the glyf-loca-improvements branch August 3, 2023 18:16
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.

2 participants