Setting Vertical Metrics

Hi,
I have read through the Vertical Metrics tutorial and tried to calculate all the value with the Webfont strategy which is a compromised strategy. Here’s the link to the tutorial I mentioned:
https://www.glyphsapp.com/tutorials/vertical-metrics

Below is my calculations:
hheaAscender = UPM × winAscent ÷ ( winAscent + winDescent ) round this value
= 1000x900 ÷ (900+300) = 750

hheaDescender = typoAscender − UPM
= 765-1000 = -235

hheaLineGap = winAscent + winDescent − UPM
=900+300-1000 =200

typoAscender = hheaAscender = 750
typoDescender = hheaDescender = -235
typoLineGap = hheaLineGap = 200

The problem is earlier in the tutorial stated that “There is one thing you need to watch out for, though. For whatever reason, the difference between typoAscender and typoDescender should be as large as the font’s UPM (usually 1000)” The UPM of my font is also 1000. But when use the values calculated earlier, 750+235 is 985.

I’m wondering if I should change the typoAscender (and HheadAscender) value to 765 (which is also the setting of the Ascender of the font metrics as well. What would be your recommendations?

Thanks :slight_smile:

765 or 750? You calculate 750 but set 765.

Well… the calculation is 750. But if I set it at 750, then the typoAscender + typoDescender would be 985 which is different from the UPM. And the tutorial specifically said that we have to watch out for this value. That’s why I’m not sure what to do.

The webfont strategy calculates the hhea and OS/2 descender values by subtracting the UPM from the ascender values. So, the ascender and descender values must line up to the UPM.

I just realized I have a little typo in the 2nd line. It assumes you have a value for typoAscender but that is only calculated in step 4. (‘Calculated’ may be the wrong word, they are simply the same in the webfont strategy.) It should read hheaAscender. Maybe that was the source of the miscalculation? So, I assume your winAscent and winDescent values are 900 and 300, here we go:

  1. hheaAscender and typoAscender = 1000 × 900 ÷ ( 900 + 300 ) = 750
  2. hheaDescender and typoDescender = 750 − 1000 = –250
  3. hheaLineGap and typoLineGap = 900 + 300 − 1000 = 200
1 Like

Thank you so much for the details reply, Mekkablue. When I first calculated, I used the definition of typoAscender under the OS/2. That’s why I used 765. Anyway, now it’s clear that you replaced it with hheaAsender value.

I have another question below:

Regarding the win span, I have read somewhere that it should be 1.2 or 1.25 times UPM. That’s why I chose the winAscent =900 and winDescent=300 (900+300=1200 or 1.2 x UPM). The actual highest and lowest of my glyphs are roughly 30 units less (870 and 270). In this case, should I go with the winAscent=870 and WinDescent=270 instead, or should I stick with the rule of thumb of 1.2 x UPM and use 900 and 300?

Can you point me to the source? Who says that and which reason do they give?

These are your winAscent and winDescent values, then. No need to go any higher.

1 Like

I saw it from https://grahamwideman.wikispaces.com/Font+Vertical+Metrics

Under typofile: John Hudson setting cross-platform vertical metric, the winAscent+winDescent = UPMx1.2 to 1.25

Perhaps it just meant as examples, not rule of thumbs?

This is the most relevant topic I could find, so had to revive it.
I’m working on a display font now, and I’ve managed to fit everything (incl accented letters) to 1000 UPM:

My descender is at -192, so for the ascender I just set 1000-192 which is 808.
Yes it’s the UPM dogma but I mean all major typefaces still use it e.g. Proxima Nova, Gotham etc. you name it, so there must be a reason.
Now, I also know that they use WinAscent + WinDescent = 1200 (add 20% to the UPM).

So my question is, do I need to add that extra 20% for Win values in my font here? I don’t think I need to because nothing in my font extends Ascender value, and that little space formed between yMax and Ascender is enough for me to consider it for leading, so I set my LineGap to 0 (zero)

Please let me know if I’m doing something wrong here. Thanks.

You don’t “need” to, but you can.

There is no reason to keep anything inside the UPM. The limit is the winAscent + winDescent as those are actually limiting the drawing. And because in older versions of Windows and office those values are also used to calculate the line hight, it is advisable to use the same numbers for all metics to have the same line spacing everywhere.

But I don’t see much fonts that have the same values for Ascender and WinAscend. WinAscend + WinDescend is almost always 1200 while the Ascender + Descender is 1000.

Will it make more sense, if for this font of mine I set typo line gap to 200 and make WinAscend 1008 and WinDescend 192 ? Which will mean that hheaAscender will be 1008 and hheaDescender will be -192.

I just tested it through MyFonts validator and my original settings passed the test for vertical metrics.

Have you read this: Vertical Metrics | Glyphs

Yes, but it’s just too confusing for me. I guess my initial calculations fit with Microsoft Strategy.
In webfont strategy, when you say to round this value up, do you mean like for example round -192.5 to -193? Or do you mean to round it to -200 altogether?

1 Like