Correcting a glyph's hinting

caffeinemood's picture

I have recently purchased Quadraat Sans for use on a website and noticed it has some buggy hinting in Cyrillic glyphs at 17 px size. And I am just not going to use a different size.
That is, horizontal stems of letters "э", "з", "є", "н" are pixel lower than they should be — a really crucial detail in a Cyrillic font. And it ruins this font.

So I want to correct TrueType hinting of those letters. I know it's kinda illegal to do that, but that's not stealing a font or making a copycat and selling it. Just want to fix the bugs.

I have never dealt with hinting. So I had googled a lot, found some tutorials, but most of them are soo difficult to understand. TrueType hinting seems to be a mysterious process even for some of the authors of those tutorials.

As you can see from the image, I managed to correct the "н" with delta-hinting. It was a pain for me to figure it out how (and why) to hint that "н" without distorting the glyph at other ppems, though the letter has such an easy shape.

Now that I know, that to do delta hints I have to set other hints, I struggle to do it with "э", "з", "є"

I would appreciate any help, any single word of advice a whole lot.
All I want is to bring that stem one pixel up at 17 ppem without distorting glyphs' shapes at other ppems.

Jens Kutilek's picture

While it's certainly educating to fix stuff like this yourself, your best option may be to write to info@fontfont.de with your problem so the foundry can fix it in the original data and other users can benefit from it too :)

caffeinemood's picture

Thanks Jens, that's a nice idea, I will contact them right now.
However, I highly doubt they'll fix it immediately, so I still want to fix it myself

hrant's picture

What "them"? Jens is the fixer. :-)

hhp

caffeinemood's picture

Oh
Now I know :-)

Jens Kutilek's picture

Actually my colleague Chr. has done the hinting on Quadraat, but we'll see who gets to fix it ;)

Jens Kutilek's picture

Regarding fixing it youself: I think delta instructions are the least intrusive way to fix this if you don't have access to the source files.

If you use other instructions, the Control Value Table in the font has to be rewritten. I'm not sure how well FontLab handles that case, if something goes wrong then all kinds of bad things may happen.

oldnick's picture

Sooner or later, you have to accept the fact that there are some limitations you cannot overcome.

Although your targeted example says “17ppem,” the glyph itself is probably 14ppem high, or perhaps 12ppem. If the actual glyph height is an even number, you will never be able to center the midline: it will always appear either above or below true center. At larger sizes, the shift will be less apparent, but it won't go away entirely.

Given that the 17ppem problem is insuperable, the solution to your problem is really quite simple: don't use the font at that size.

hrant's picture

it will always appear either above or below true center.

Well yeah, but above is almost always better.

hhp

caffeinemood's picture

It is 8 ppem there. And yes I know that it's not possible to center a midline.
It's completely natural for Cyrillic letters if these horizontal stems are higher, than the letters' center. I recon there are some fonts, which have these stems quite high. And never lower than midline, even in Cyrillic handwriting.

So as I said, they should be exactly a pixel higher.

Jens, just curious, what software do you use for hinting?

Rob O. Font's picture

"...the solution to your problem is really quite simple: don't use the font at that size."

Wouldn't that be nice!? Redesign your pages, or switch types for font sizes that work. . . if one is not crude media savvy, sometimes listening is best.

Also,
"...the glyph itself is probably 14ppem high..."

...ppm refers exclusively to pixels per em. Once you start talking pixels per cap ht, e.g. it's no longer ppm, but simple pixels.

"If you use other instructions, the Control Value Table in the font has to be rewritten"

Deltas will work if placed correctly. The cvt might be used, but because there is often slight variety in the optical centering of middle strokes, one can alternatively interpolate the top of the mid stroke between the glyph's y min and y max, set rounding to sround 73 and mdap it, avoiding the cvt, while never having the mid stroke too low...

oldnick's picture

Dennis,

Yes, it would be nice if folks accepted the fact that one size does not always fit all. Not every problem is a nail.

Rob O. Font's picture

And by the way:

"If the actual glyph height is an even number, you will never be able to center the midline: it will always appear either above or below true center."

...is untrue. If the glyph pictured above were 16 pixels tall, the stems would each be 2 pixels, which subtracted from 16 leaves 10 — a number that evenly divides by two, enabling a centered mid-line. At 17, an odd-numbered pixel height, the mid-line would not center.

I believe mid-line centering is about white pixels, not height pixels.

Jens Kutilek's picture

Jens, just curious, what software do you use for hinting?

We are using FontLab Studio. The problem, or rather just the way it works, is that FontLab cannot open a TTF and reconstruct the hinting "source code". For the most effective way to edit the TT hinting you need the source FontLab file. In your example screenshots, the alignment zones and stem width values are something that FontLab made up by guessing when it opened the TTF.

Syndicate content Syndicate content