Truetype hinting: CVT/Stem not responding

Frode Bo Helland's picture

So, my CVT (actually stem value in Fontlab) says 3 px, but neither Greyscale nor Cleartype will return 3 px. What, why?

Edit: More search friendly title for the next Truetype wrangler to come along.

John Hudson's picture

Is this an x-direction distance or a y-direction distance? Are you anchoring to the grid? Screenshots would help.

Frode Bo Helland's picture

This is x-direction. Y-direction is a smooth ride.

Frode Bo Helland's picture

This is even more dramatic. Here the "round right" stem is defined as 4 px, but the output is only 2.

John Hudson's picture

That's sort of a weird way of hinting that situation (although I realise this doesn't answer your question of why the distance is not 4 pixels). A more typical strategy would hint from the outside of the bowl to the sidebearing.

Are you aligning the destination to the grid? How?

Frode Bo Helland's picture

Are you aligning the destination to the grid? How?
Yes. The stems build upon each other, so their starting and ending points are all aligned to the grid.

John Hudson's picture

Do you get the full four pixel distance in b/w bitmap mode?

Frode Bo Helland's picture

The grey circles and the grid in the screenshot is the binary rendering. I know this is not a typical hinting method, but that’s not the point here (as you already said). I’d like to know why they don’t behave as instructed.

John Hudson's picture

The grey circles and the grid in the screenshot is the binary rendering.

Doh! Of course.

I'm really not sure why it is behaving this way. My guess would be some kind of tolerance relative to the natural outline that prevents hints from radical distortion, but I don't know if this is something peculiar to FontLab or to the kinds of hints that it writes.

jasonc's picture

I'm guessing you've got the equivalent of a CVT cutIn issue here, but I don't know how to fix that in FontLab. In VTT it's just a setting you need to increase in the CVT.

Jason

Ross Mills's picture

Fontlab has internal tolerances set to prevent large* jumps in either CVTs or deltas. So for this instance, your jumps are still limited to 8/8s for deltas (ie. you can only delta move a point 1 pixel or 1/8 fractions thereof), but you can increase the tolerance for CVTs by opening TT Hinting Options > General > (increase) Stem snap precision to 32/16 of the pixel. This will allow doubling of the stem value. Note you're asking to get both 3 and 4 pixels above. The above solution could get you up to 4 pixels, but I think as long as your stem has a reasonably accurate value entered you should still be able to get 3 pixels @ 20ppm without fudging the Snap Stem much**, ie. check your measurement from the inside of the stem to the sidebearing point and make sure the 'round right' CVT entry corresponds closely to that value.

*or small, for that matter, as you can make much smaller adjustments the 1/8 pixel in TrueType, if you were so inclined, just not in Fontlab.

**otherwise, keeping the Snap Stem at 17/16 may be the best bet, but you may still find yourself fiddling with the value occasionally to achieve certain results

Frode Bo Helland's picture

Thanks. This is just the answer I was looking for.

Rob O. Font's picture

Any way you chose to stack it, the best waay to get a bold weight Is to start with a a bold outline. ;)

Ross Mills's picture

He was trying to increase the sidebearing distance, not the weight of the outline. Admittedly, doing this from the inside is somewhat odd, but the stem of the 'o' here is unrounded (again a bit odd, but not without precedence).

Rob O. Font's picture

Funny title for a tracking-by-hinting thread... A bit odd? how many user agents employ the hdmx table in composition?

Frode Bo Helland's picture

David: I’m not going to add more tracking with hinting. This would be an undesirable effect. As I’m sure you understand, what I want to acheive is control over the spacing to be able to correct any rounding errors introduced by the rasterizer. My question is really simply put: “I told the rasterizer to do a certain thing but it didn’t listen. Why?”

how many user agents employ the hdmx table in composition?
I have been looking for an explanation for what this does. From what I (think I) understand, the numbers listed in the hdmx table are the ones where delta hints are effective. Correct? But why is it necessary in the first place?

Rob O. Font's picture

Frank: “I told the rasterizer to do a certain thing but it didn’t listen."

It "hears" three things on the Mac and 8 things on Windows...

Frank: "Why?”

Competition!

Frank: "But why is it necessary in the first place?"

There are two sources of metrics for a font rasterized at any ppm, the integer values in the hdmx table and the unrounded widths of the outlines.

Together with the subpixel positioning, you get a lot of different results.

Syndicate content Syndicate content