TT Hinting: How do stem delta's work?

Hi there,

I’m working on the truetype hinting for a serif text font. Like many serif designs, the horizontal stems come in two varieties: thick and thin (in the b example below, top and bottom). At smaller sizes I would like that difference to be invisible, and I thought I could use the delta instructions in the TTFStems parameter for that. However, the input I provide there doesn’t seem to have any effect. In the image below, I would expect the thick horizontal stem in b to become 1 pixel, but it’s sticking to 2. Am I missing something? Is there a better way to fix this? I’m quite new to TT hinting, so any help is appreciated.


The deltas are only for Cleartype rendering. Because there the horizontal stems are rounded to full pixels and that is important to be able to decide when those pixel jumps occur.

Thanks for your answer Georg! Do you know of another way to fix this, apart from using local deltas?

Is there something to fix. From the screenshot (and is it a bit blurry), it looks OK to me. Don’t look to much at the big pixel preview.

At sizes 19, 20, and 21, the thick horizontal stems will be twice as thick as the thin ones. That is not only reflected in the pixel preview, but also in the red outline. The difference between 1 and 2 pixels is far too big for the design, it makes it look clunky and irregular.

Of course I could opt for ‘no rounding’ stems but they are too fuzzy for my taste. In essence, I’d like the two horizontal stems (thin and thick) to converge to a single stem at small sizes (e.g. < 30) but split up at bigger sizes. Is there a way to make the stems size-specific?

You can use an extra stem that is a bit thinner than the think stem and assign it to the top part.

If I’m understanding you correctly, that solves my problem at small sizes, but it also removes the thickness difference at larger sizes (where this removal is not desirable). In order to make both stems 1 pixel at size 19-21, the thin and ‘a bit thinner than thick’ stems need to be almost the same thickness, which then makes it pretty pointless to have two different hStems at all.

What I’m looking for is a way to have a stem ‘thin’ up to size X, and become ‘thick’ (i.e. associated with a different hStem) above size X. Perhaps this is simply not possible?

@GeorgSeifert If you use the default gasp table, you will have asymmetric smoothing aka ClearType GDI-like display up to 20px. So the effects of stem deltas should be visible up to that pixel size, even if the actual rasterizer uses DWrite.

Bildschirm­foto 2022-11-21 um 12.47.52

(You need to put the Glyphs preview to ClearType to see it)