Skip to content

Write variable vertical metrics#1489

Closed
Hoolean wants to merge 5 commits into
googlefonts:mainfrom
Hoolean:write-vertical-variable
Closed

Write variable vertical metrics#1489
Hoolean wants to merge 5 commits into
googlefonts:mainfrom
Hoolean:write-vertical-variable

Conversation

@Hoolean

@Hoolean Hoolean commented May 25, 2025

Copy link
Copy Markdown
Contributor

This is the final puzzle piece from #1388 (🎊): writing variable heights to eliminate the remaining diffs for vertical fonts on crater. In particular, the main changes in this PR are to:

  • Refactor HVAR for reuse to write VVAR
  • Populate vertical gvar phantom points

Question before merging

This PR will need furnishing with tests. However, before doing so, there is one issue I would like to address:

When a glyph instance's height or vertical origin is absent, the default value must be derived from the global metrics at that location. This can sometimes crash fontc, as outlines may be at positions where global metrics are undefined, e.g. for designspace sparse layers or Glyphsapp brace layers, and fontc does not implement metrics interpolation yet.

What solution do we want to get vertical metrics over the line?

  1. If we fetch metrics as lazily as possible, we can limit present-day panics to a much rarer and avoidable case that is unlikely to appear on crater
    • i.e. by only getting metrics when a default is really needed, only vertical fonts that define sparse glyphs but do not give explicit heights or origins are affected
  2. Alternatively, we wait for interpolated metrics
  3. ...or is there a third option?

@Hoolean

Hoolean commented May 25, 2025

Copy link
Copy Markdown
Contributor Author

(the failing tests are from the issue described above)

@Hoolean

Hoolean commented Aug 3, 2025

Copy link
Copy Markdown
Contributor Author

A small update: this can be rebased on main to resolve the Qs in the PR after #1518 is merged

@rsheeter

Copy link
Copy Markdown
Contributor

I apologize, I didn't notice this and managed to do duplicative work in #1666, including tests and code sharing. @anthrotype has volunteered to port the remaining things we need from here, such as gvar phantom points, as follow-on PRs.

Thank you for your work on vertical, without what you started in #1388, the addition of interpolated metrics, etc we would likely still be punting on it. Instead I'm hoping to see a nice +x on crater soon :)

@rsheeter rsheeter closed this Sep 30, 2025
anthrotype pushed a commit that referenced this pull request Sep 30, 2025
anthrotype pushed a commit that referenced this pull request Sep 30, 2025
anthrotype pushed a commit that referenced this pull request Sep 30, 2025
anthrotype pushed a commit that referenced this pull request Sep 30, 2025
anthrotype pushed a commit that referenced this pull request Oct 4, 2025
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