I thought someone had once mentioned that it was possible to increase letterspacing in all Caps above what the normal sidebearings make by using some opentype feature. Is this possible and how would I code it?
Thanks for all geekly advice!
ChrisL
Hey ChrisL,
I'm sure other people know much more than I do, but I was trying teaching myself how to do this the other day so I'll at least get you started. If all of your caps are in a class (we'll call the class "caps" in this example), then you can just use the OpenType cpsp feature do add units (xx) to the sidebearings as such:
feature cpsp {
pos @caps <xx 0 xx 0>;
} cpsp;
I bet I'm missing something important, so I encourage others to respond and fill in the gaps.
Good luck,
David
At best with two examples:
pos Adieresis <5 0 10 0>;
pos @caps <5 0 10 0>;
The 'pos' command is followed either by a glyph name or a class name.
Enclosed are, left to right: x placement adjustment, y placement adjustment, x advance adjustment, y advance adjustment.
So, the example says: The outlines of glyph 'Adieresis' are moved to the right at 5 units, and then the advance width is increased by ten.
This looks a bit complicated at first, but has to do with the fact that a font does not know about a rightside bearing; rather, the rightside bearing is advance width -- the glyph's total width including leftside and rightside bearings -- minus leftside bearing.
What the example does is: it increases both leftside and rightside bearing at 5 units each.
The second and forth number remain zero because you do not want to move the glyph up or down.
(Instead of adding extra glyphs and substitute them in the 'case' feature, you could as well add a lookup with commands like
pos parenleft <0 20 0 0>;
pos parenright <0 20 0 0>;
which will raise glyphs a bit if you select 'All Caps'.)
The Feature File Syntax (html) document which accompanies the AFDKO is a very good reference for this.
Captured from web.archive.org on 8 Nov 2013. view this capture