Kerning Triplets?

blank's picture

Can Opentype be used to create special kerning for odd series of letters? I’m spacing a font with too much space on the right-hand side of a and noticed that it looks just fine when followed by a series like ro or rn. Could I set up a font so that when a is followed by ro or rn the a spreads a little farther from r to balance things out?

Thomas Phinney's picture

Yes, it can. This is achieved through "contextual kerning" - I just posted a thread the other day asking how many people were actually doing this.

However:

1) You can only do this in GPOS kerning; 'kern' table kerning does not support it. (Apple's AAT extensions to the 'kern' table do, but they're not part of OpenType.)

2) Not all OT savvy tools support this. The AFDKO does, and I'm pretty sure VOLT does. I don't believe FontLab Studio does.

3) Not all apps that handle GPOS kerning will recognize contextual kerning. I know the current version of InDesign does, however.

Regards,

T

Miguel Sousa's picture

James, beware that doing contextual kerning can be quite tricky. For example, consider the combination L’A, which happens in French. If you want that sequence spaced well, but at the same time need the quote kerned correctly against L and A alone, the only way to do it is by using a kerning triplet.

Below are some GPOS snippets and screenshots of their result. As you can see things can get complex pretty fast. (In case it's not clear, the desired result is the first example below.)

One

pos L' -100 quoteright' -50 A;
pos L' -150 quoteright;
pos quoteright' -120 A;

================================================

Two

pos L quoteright -150;
pos quoteright A -120;

================================================

Three

pos L' -100 quoteright' -50 A;
pos L quoteright -150;
pos quoteright A -120;

================================================

Four

pos L' -150 quoteright;
pos quoteright' -120 A;
pos L' -100 quoteright' -50 A;

================================================

Five

pos L' -150 quoteright;

blank's picture

Thanks for the help guys. I think I’ll worry about kerning triplets after graduation…

Miguel Sousa's picture

Don't tell me I scared you away... :)

BTW, the desired result can also be achieved using the code below. Yes, that's right, Six is equivalent to One. The reason is because contextual lookups used in a kern feature will be in a different lookup than the pair positioning rules, and hence the two sets of rules will be additive whenever they match the same glyph pair in the text stream.
http://www.adobe.com/devnet/opentype/afdko/topic_feature_file_syntax.htm...

Six
pos L' 50 quoteright' 70 A;
pos L quoteright -150;
pos quoteright A -120;

If this is all Greek to you, forget about it.

charles ellertson's picture

Hi Miguel,

Contextual kerning is nice, but I don't much care for the example. I'll allow it is generally bad form to quarrel with the example, but I've always felt that too many people, including Adobe, kern the quote marks too tight. As evidence, I would say quote marks are not diacriticals, but characters in their own right & deserve their space. That also happens to be the historical usage.

But If you do use a -150 kern between cap L and quoteright, you're going to need triplets with more than capital A. For example:

Syndicate content Syndicate content