Vertical Metrics calculator

selfbuildtype's picture

I've put together a document that does the calculations required for cross-platform vertical metrics. The calculations are based on the methods described by John Hudson in this thread:

This document was put together in iWork 09 Numbers and I've exported an Excel version so hopefully all the (simple) calculations have survived intact. Also thanks/apologies to Karsten Lücke who’s diagram I have ‘borrowed’ and butchered for my own needs. The document contains two methods: John Hudson’s original method (under ‘Best Practices’ in the previously linked article) and the revised method suggested by Read Roberts (under ‘Update’ in the article). As far as I understand the jury is still out on which method it is best to use. Default values in the document are all taken from John’s original article and all values are positive so you should manually change them to negative figures when inputting them into FontLab.

Comments, suggestions and reworks are welcome!

EDIT: The forum won't allow .zip or .numbers attachments so I have attached the Numbers version as a .txt file. You should be able to download it and change the suffix to .numbers to successfully open the file in iWork.

Vertical Metrics Calculator.xls21 KB
Vertical Metrics Calculator.txt100.95 KB
Bert Vanderveen's picture

[Superfluous question deleted.]

blank's picture

Good idea!

Jens Kutilek's picture

If you want to take an extra step, make a Python macro out of this so it can be used inside FontLab Studio and set the metrics without manual editing :)

k.l.'s picture

It exists since 2008, buried in a folder because the interface is a bit confusing and one or two options should be removed. Perhaps next week ...

twardoch's picture

I've written a Python macro for FontLab Studio 5 that calculates the linespacing values using the same method as the one that will be built into Fontographer 5.

It follows John Hudson's recommendations and refines them a bit. It assumes the default leading of 120% and distributes the LineGap so that as little clipping occurs as possible.

I'm planning to add a simple user interface to it, and make it work across an entire family, but the current version only works on one single font:

I'll appreciate any feedback.


blank's picture

Thanks, Adam. It works fine on my end.

eliason's picture

Adam, does this require putting values into the script somewhere before running it?
I just tried running it out of the box and got:
Traceback (most recent call last):
File "", line 136, in ?
File "", line 67, in Calc
ZeroDivisionError: float division

cuttlefish's picture

@Adam: Myself being ignorant of Python scripting, could it be possible to adapt a script to this same function in FontForge?

twardoch's picture


could you send me the font to adam at fontlab dot com?


it should be possible. But I haven't done enough FontForge scripting myself to do that.


Frode Bo Helland's picture

Craig, Adam: Did you figure this out? Same issue here.

eliason's picture

I honestly can't remember what happened with the issue I was seeing, but trying it now seems to work.

Frode Bo Helland's picture

Adam? I’m on the latest Fontlab for Mac.

twardoch's picture


this is very likely dependent on the particular font. Some value gets calculated as 0, and then there is a division -- and you cannot divide by 0, as we know. Please kindly send me the font to adam at fontlab dot com and I'll check out what the culprit is.


Frode Bo Helland's picture

I can’t send this particular font, but if I understand you correctly this is because one or more vertical metric values are set to zero? My WinAscent/Descent is zero, so that would explain it.

Syndicate content Syndicate content