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

Use fontations Glyph enum #382

Merged
merged 2 commits into from
Aug 10, 2023
Merged

Use fontations Glyph enum #382

merged 2 commits into from
Aug 10, 2023

Conversation

cmyr
Copy link
Member

@cmyr cmyr commented Aug 8, 2023

A bit of cleanup on top of #379.

This renames the backend 'Glyph' type to 'NamedGlyph', and turns it into a simple struct, containing a write-fonts Glyph and the associated name.

This also lets us delete the GlyphPersistable type, since we don't need to store a flag indicating whether the glyph is simple or composite.

Base automatically changed from fix-breakage to main August 8, 2023 18:02
This renames the backend 'Glyph' type to 'NamedGlyph', and turns it into
a simple struct, containing a `write-fonts` Glyph and the associated
name.

This also lets us delete the GlyphPersistable type, since we don't need
to store a flag indicating whether the glyph is simple or composite.
Composite(GlyphName, CompositeGlyph),
pub struct NamedGlyph {
pub name: GlyphName,
pub glyph: Glyph,
}
Copy link
Contributor

Choose a reason for hiding this comment

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

NamedGlyph suggests the existence of other types but there really aren't any. I'd rather call this Glyph and rename the Glyph nested within, e.g.

/// A glyph and its associated name
///
/// See <https://learn.microsoft.com/en-us/typography/opentype/spec/glyf>
#[derive(Debug, Clone)]
pub struct Glyph {
    pub name: GlyphName,
    pub data: GlyphData,
}

Copy link
Contributor

@rsheeter rsheeter left a comment

Choose a reason for hiding this comment

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

LGTM with one nit re naming (the hardest part)

NamedGlyph goes back to Glyph, and we import write_fonts Glyph as
RawGlyph.
@cmyr cmyr merged commit 6cc05ae into main Aug 10, 2023
8 checks passed
@cmyr cmyr deleted the use-fontations-glyph branch August 10, 2023 22:56
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