Experiments with Kerning Pairs

Get help with FontCreator here. Please do not post feature requests or bug reports here.
Post Reply
David Webber
Posts: 44
Joined: Mon Aug 19, 2013 10:33 pm

Experiments with Kerning Pairs

Post by David Webber »

This is a follow up to the recent kerning pairs thread, but I have some new evidence, and new bafflement.

I have developed a font over quite a long period. It has 100 kerning pairs as reported in the caption of Font Creator's kerning pairs window, and the list looks about that long. [I've experimented over the history of the font and forget how most of them got there, but I'll concentrate here on 3 pairs which I added last week.] In the preview toolbar:
preview-toolbar.png
preview-toolbar.png (4.47 KiB) Viewed 4770 times
Some results:

1. Of these only the AV one is rendered in the Font Creator test window.

2. If I switch on font-kerning in Word 2007, then, of these, it too only renders AV.

3. So I experimented with my own program using Windows GDI functions. (Non-programmers please see technical note appended.) Drawn large enough on the screen the AV kerning is rendered, but the others aren't.

Further experiment:

I've just discovered a new (to me) Windows function 'GetKerningPairs()' with which, having loaded a font, you can ask which symbols constitute kerning pairs, and by how much their spacing is altered.

With my font, loaded (for the screen) at a size where capitals are 24 pixels high, there aren't any. But loaded (for printing) such that capitals are 296 pixels high, it reports 909 kerning pairs! Many of them, it appears, involve symbols which are not even in the font! However, they do include AV, and *don't* include the other two shown above!

Conclusion:

So despite the weirdness of the GetKerningPairs() function, it appears that two of the three cases illustrated above, the kerning is not being exported. But it is shown in the Font-Creator preview toolbar.

Questions:

Is there some special coding behind the preview toolbar window?

Is it possible that Font Creator does not export some kerning pairs?


Dave

---------------------------
Appendix on programming Windows:

"GDI" (the Graphics Drawing Interface) is the traditional Windows library for drawing things, including text, where it is nowadays updated to use strings of Unicode characters, encoded in UTF-16. To use it, you first create a 'device context' (DC) for the screen or printer, then load a font into the DC (at the desired size), and then use library functions with names like TextOut(), ExtTextOut(), and DrawText() to output the text. After loading the font, you can also use the GetKerningPairs() function on the DC to find out which pairs should kern.

Although "GDI" is the most traditional and fundamental library of Windows functions which include text output, there are at least three others ('GDI plus', 'DirectWirite', and 'Uniscribe') which Microsoft have come up at various stages with since. I haven't experimented with them; it would probably only muddy the waters further!
-------------------------
Erwin Denissen
Moderator
Moderator
Posts: 11108
Joined: Fri Oct 04, 2002 12:41 am
Location: Bilthoven, The Netherlands
Contact:

Re: Experiments with Kerning Pairs

Post by Erwin Denissen »

David Webber wrote:With my font, loaded (for the screen) at a size where capitals are 24 pixels high, there aren't any. But loaded (for printing) such that capitals are 296 pixels high, it reports 909 kerning pairs! Many of them, it appears, involve symbols which are not even in the font! However, they do include AV, and *don't* include the other two shown above!
Arial has 909 kerning pairs, so I suspect Windows returned the kerning pairs for Arial instead of the ones as available in your font.

FontCreator will not export all kerning pairs, but this depends on settings, and code points. Can you please send the font file to me, so I can provide correct answers to all your kerning related questions?
Erwin Denissen
High-Logic
Proven Font Technology
David Webber
Posts: 44
Joined: Mon Aug 19, 2013 10:33 pm

Re: Experiments with Kerning Pairs

Post by David Webber »

Erwin Denissen wrote:
David Webber wrote:With my font, loaded (for the screen) at a size where capitals are 24 pixels high, there aren't any. But loaded (for printing) such that capitals are 296 pixels high, it reports 909 kerning pairs! Many of them, it appears, involve symbols which are not even in the font! However, they do include AV, and *don't* include the other two shown above!
Arial has 909 kerning pairs, so I suspect Windows returned the kerning pairs for Arial instead of the ones as available in your font.

FontCreator will not export all kerning pairs, but this depends on settings, and code points. Can you please send the font file to me, so I can provide correct answers to all your kerning related questions?
Hmm - 909 sounds like a bit of a coincidence! A one in a thousand chance?

But thanks, I've sent a link to the font in a message composed on the forum messaging service.

Dave
Erwin Denissen
Moderator
Moderator
Posts: 11108
Joined: Fri Oct 04, 2002 12:41 am
Location: Bilthoven, The Netherlands
Contact:

Re: Experiments with Kerning Pairs

Post by Erwin Denissen »

Thank you for sending us the font file. It contains numerous glyphs I've never seen before.
David Webber wrote:Hmm - 909 sounds like a bit of a coincidence! A one in a thousand chance?
Since your font has 100 kerning pairs, and the API gives you 909, those must come from another font; most likely Arial. What O.S. do you have?

I've tested the font, and can confirm it contains 100 kerning pairs. The Test dialog (which uses the kerning information from the OpenType layout feature tables) fails to process the first kerning pair (Delta seven), so I suspect Windows (Uniscribe) refuses to display it. Word 2007 uses the old kern table, and fails to show the second kerning pair (Latin capital A with Music natural sign $266E).

Fortunately the Test WOFF (which uses OpenType Layout Features) does show all kerning pairs, so I'm convinced the font is exported correctly.
Erwin Denissen
High-Logic
Proven Font Technology
Erwin Denissen
Moderator
Moderator
Posts: 11108
Joined: Fri Oct 04, 2002 12:41 am
Location: Bilthoven, The Netherlands
Contact:

Re: Experiments with Kerning Pairs

Post by Erwin Denissen »

Also worth mentioning is the fact Microsoft Office versions prior to 2007 used a non-Unicode version of the GetKerningPairs GDI function, which has known bug not returning correct pairs and returning some non-existing ones. Office 2007 uses the Unicode-based version which returns correct kerning pairs, unless it is in pre-Word2007 compatibility mode (e.g. opening old document created in Office 2003).

And due to backward compatibility reasons Office 2007 applications may treat punctuation and other neutral characters a little different. Notepad on the other hand should process OpenType layout kerning better.

I would like to know your results with other more recent versions of Office and other word processing software.
Erwin Denissen
High-Logic
Proven Font Technology
Post Reply