Skip to content

Vertical metrics patch 3#148

Merged
rsms merged 2 commits intorsms:masterfrom
thundernixon:vert-metrics-patch-3
Apr 2, 2019
Merged

Vertical metrics patch 3#148
rsms merged 2 commits intorsms:masterfrom
thundernixon:vert-metrics-patch-3

Conversation

@thundernixon
Copy link
Contributor

My comment at #145 (comment) details several issues in the vertical metrics of Inter.

This PR solves these, plus another issue I uncovered along the way.

The approach that ended up working well:

  • Setting descender, winDescent, hheaDescender, typoDescender all at the same value – a bit past the lowest descender
  • Setting ascender, winAscent, hheaAscender, typoAscender all the same – the same amount past cap height that descender values go below baseline
  • Add alignment zones at those two values (thanks for the idea, GlyphsApp tutorial!)
  • Bit 7 (use typo values) is set to true (not sure how critical this is, but it probably doesn’t hurt, because Google Fonts checks for this)

Results

Text is nicely vertically-aligned in containers:

image

Default line height is within the range of comparable fonts:

image

All bounding boxes are consistent height between styles in the variable font:

image

Caveat

I'm not 100% sure how this will render in Windows. As far as I know, some double-stacking accents will be partially cutoff, some of the time on Windows. It's possible we can fix this by increasing the winAscent value, but I think we should prioritize how this impacts general UI usage above how Windows displays certain accents.


Another issue that this avoids

As I was experimenting, I found that bounding boxes were different, depending on the content of the text (at least in Sketch – I didn't do comprehensive tests). Not good! This was solved by the overshooting ascender & descender values, plus by setting alignment zones at these values.

image

@rsms
Copy link
Owner

rsms commented Apr 2, 2019

Just tried this out in a few apps and it seems to work perfectly.

Nice work! 💯

@rsms rsms merged commit 0d7694a into rsms:master Apr 2, 2019
@rsms
Copy link
Owner

rsms commented Apr 2, 2019

Just released v3.5 containing these changes.

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