Skip to content

Add support for "Link Metrics..." custom parameters#1778

Merged
anthrotype merged 8 commits into
mainfrom
link-metrics
Nov 27, 2025
Merged

Add support for "Link Metrics..." custom parameters#1778
anthrotype merged 8 commits into
mainfrom
link-metrics

Conversation

@anthrotype

Copy link
Copy Markdown
Member

Fixes #1716

the implementation is intended to match fontmake's (inline comments point to the relevant lines in glyphsLib).

I still haven't had the chance to test this with GSF but will do tomorrow

@cmyr cmyr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A couple little notes inline, but looks good!

Comment thread glyphs-reader/src/font.rs Outdated
/// Returns None if no linking is configured, meaning this master uses its own metrics.
///
/// See <https://github.com/googlefonts/glyphsLib/blob/a045b48/Lib/glyphsLib/classes.py#L1641-L1665>
pub fn metrics_source_id<'a>(&'a self, font: &'a Font) -> Option<&'a str> {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thought: instead of having this kind of annoying method call, could we just compute this when we convert from RawFont to Font, and store it in the master directly?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

is that what you had in mind? 209b58c

Comment thread glyphs2fontir/src/source.rs Outdated
and provide a method similar to glyphsLib's metricSource that returns the
optional master layer id associated with a given master through one of
these custom parameters.

part of #1716
…etrics custom param is present

Fixes #1716

matching glyphsLib and fontmake
@anthrotype

Copy link
Copy Markdown
Member Author

I get identicall ttx-diff output for HVAR and gvar tables for GSF-full.glyphspackage after applying this PR 🎉

@anthrotype anthrotype added this pull request to the merge queue Nov 27, 2025
Merged via the queue into main with commit 3e82ffc Nov 27, 2025
12 checks passed
@anthrotype anthrotype deleted the link-metrics branch November 27, 2025 17:34
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.

Support "Link Metrics ..." custom parameters in Glyphs format

2 participants