Vertical metrics standards

I have some naive questions. This article from the Glyphs team dives into the complex issue of vertical metrics; even after reading it numerous times I still don’t fully understand the intricacies. In the past I’ve gone with “the Google strategy” outlined in the article, since it appears to be a well-rounded solution.

What I’d like to know is: Do you use one of their recommended methods for setting hhea, typo, and win values? Is it necessary to use a different method because of the needs of the typeface? Does each foundry have a standard so all their fonts work well together in their own library?

Comments

  • Thomas Phinney
    Thomas Phinney Posts: 3,132
    Generally, “the needs of the typeface” only dictate a different strategy if there is something unusual about the typeface. The most common form this takes is in terms of language support, but it can be just design — such as a huge difference in cap height vs x-height.

    This sort of info will tend to make its way into published guidance, though.

    The most recent version of the Google guidance on this, with their special treatment for CJK borrowed from Adobe, is here: https://googlefonts.github.io/gf-guide/metrics.html
  • Johannes Neumeier
    Johannes Neumeier Posts: 405
    edited April 2025
    More or less, yes. The article is great for all the in-depth and historical context. The GF strategy can be summed up even shorter, and I'm glad it's the one that is also remotely memorable:

    - Use Typo Metrics
    - set win values on absolute font extrema
    - set typo/hhea to visually include important bits; forms default line height in relation to em
    - 0 typo/hhea line gap for consistency
  • Generally, “the needs of the typeface” only dictate a different strategy if there is something unusual about the typeface. The most common form this takes is in terms of language support, but it can be just design — such as a huge difference in cap height vs x-height.

    This sort of info will tend to make its way into published guidance, though.

    The most recent version of the Google guidance on this, with their special treatment for CJK borrowed from Adobe, is here: https://googlefonts.github.io/gf-guide/metrics.html
    Thanks for linking to the Google Fonts Guide. I didn’t realize they created an index like that! The logic behind their decisions is exactly what I was hoping to learn more about, so this is perfect.
  • 2. Vertical metrics must be consistent across a family.
    Each font in a family must share the same vertical metrics values.

    this strikes me as pretty aggressive. there are cases where, for example, the x-height changes sufficiently across an axis that you might want to introduce more vertical breathing room by default. worth noting Glyphs can’t handle this in variable fonts right now, you would have to add MVAR/VVAR afterward 


  • there are cases where, for example, the x-height changes sufficiently across an axis that you might want to introduce more vertical breathing room by default.  
    It's all trade-offs. Without equalization across a family, if a paragraph of text has a bold word in the middle, the line heights would be inconsistent. Probably only subtly inconsistent; but if it's that subtle, when why not subtly increase the vertical space for all parts of the family and remove the inconsistency?
  • jeremy tribby
    jeremy tribby Posts: 286
    edited April 2025
    right, yeah, weight would be a pretty unusual example. on the other side of the coin is something like an optical axis (and maybe a user who wants font-optical-sizing: auto) where I think it’s pretty reasonable if the weights are consistent at a given size
  • As an amateur I also strugle with the vertical metrics in my fonts. I picked up the „Ascender 900 / Descender 300 / Line Gap 0” approach for my font with 1000-UPM and implemented this. 

    Though this screenshot of a test website shows a shift in baseline/x-height/capheight within the usWin settings compared to Hhea and OS/2.

    Is this a problem, that I need to fix (how?), or is this what it shoud be? 
  • Thank you for your comments, @John_Hudson! So my uncertainty isn't without reason. Your experience comes with a touch of humor :) 
  • ... This is supposed to work independently of the linespacing metrics, but historically was misapplied in Microsft’s old GDI text engine and used to determine linespacing. 

    Being precise, that's not accurate, since GDI itself didn't have any APIs that did multi-line layout. However, it is true that GDI would report that height and things built on top of GDI that do multi-line layout would use that to determine linespacing.
  • John Hudson
    John Hudson Posts: 3,655
    Thanks, Peter, for the more precise explanation.