Cpsp feature

charles ellertson's picture

I'm trying to figure out how the values in the cpsp feature work. Tried a google search, no luck.

Typically, the values are somthing like:

pos @class0 {less}5 0 10 0{greater};

[Sorry, if I use the greater/less characters, the expression values won't display properly]

How do you read this (aside form the class)?

Can you have two "arguments" -- say, one class for samll caps, one for full caps? The values in the argument shown work about right for small caps, but I'd usually want a little more for full caps.

TIA, Charles

Thomas Phinney's picture

If you're using the Adobe FDK for OpenType, or FontLab, I generally suggest checking the Adobe FDK documentation. The document "OT Feature File Syntax.html" has this sort of info. This particular item is under 6a (GPOS lookup type 1).

The first number is the adjustment to the glyph's position in x, and the third is the adjustment to the glyph's advance width in x. So in the example, the glyph is moved to the right by 5 units, and the advance width is increased by 10. The net effect is thus to increase both sidebearings by 5 units.

I don't know that anybody's done it, but I see no technical reason at the font-building level why you couldn't have multiple "arguments" to have one for small caps as well. But....

Adobe applications supporting 'cpsp' do so automatically when "all caps" formatting is applied, and don't offer any other way to apply it AFAIK. So I doubt that 'cpsp' on the small caps would ever get accessed.



charles ellertson's picture

Thanks, Thomas, I believe I understand. I guess I do need the FDK -- to date, I only have FontLab.



Thomas Phinney's picture

Actually, I just went and tried it, and it is possible to get "All Small Caps" and text formatted as all caps at the same time in InDesign CS2. However, it does seem that the text engine thinks they are mutually contradictory, so success may depend on the order of application or something.

As for the FDK, it has some additional documentation and useful testing/troubleshooting tools, even for people using FontLab. Since it doesn't cost anything, the price is hard to beat.



Thomas Phinney's picture

Also, I should note that on further checking, 'cpsp' definitely can have different values for different classes.



paul d hunt's picture

this probably isn't "kosher" but you could probably build your spacing into your smcp feature. for example sometimes i've used used numerators for superior numbers thus:

feature sups {
lookup sups1{
pos @SUPS "lessthan"0 150 0 0"greaterthan";
lookup sups2{
sub @NUMS by @SUPS;
} sups;

i don't see why you couldn't (maybe you SHOULDN'T) do something similar with the smcp feature. But... why not just space your small caps appropriately in the first place? do you want them to set tighter by default???

Michael Hernan's picture

Here is my basic code for generous space between Caps. ( Paul, I am going to start using classes soon =) )

Spacing is activated by the "All Caps" selection in the Character Palette as mentioned above.

I notice the All Caps overrides Small Caps (by turning the sc lowercase to real Uppercase)

My small caps have generous spacing anyhow.

I see this as a feature beyond having a set of Titling Glyphs Where titling will be a mixture of upper and lower case and is tighter than bodytext.

I here leave the Small caps code in so you know what Im talking about.

feature cpsp {

# sub by ;
pos [A-Z] <0 0 200 0>;
pos [A.sc-Z.sc] <0 0 200 0>;
pos [A.titl-Z.titl] <0 0 200 0>;

pos zero <0 0 200 0>;

# 'cpsp' Capital Spacing

} cpsp;

Arno Enslin's picture

I was always a bit confused by the meaning of the values. So I have written my own comments:

feature cpsp {# Glyph Position Tag
#<[xPlacement: Add to LSB and (!) Subtract from RSB] [yPlacement: Add to TSB and (!) Subtract from BSB] [xAdvance: Add to RSB changed in xPlacement] [yAdvance: Add to BSB changed in yPlacement]>
pos @upper_case <7 0 14 0>;
pos @lower_case_sc <7 0 14 0>;
#same as: pos [@upper_case @lower_case_sc] <7 0 14 0>;
#Means additional letterspacing of 14 units
#between upper cases
#between upper cases and lower cases sc
#between lower cases sc and lower cases sc
#And it means additional letterspacing of 7 units
#between upper cases and all other characters except from lower cases sc
#between lower cases sc and all other characters except from upper cases
} cpsp;
#---Capital Spacing

@ Michael Hernan

I don’t think, that the cpsp feature is intended to be a typographical mark like bold or italic. I think, it is just the other way around. Without additional spacing text that is set in capital letters drags more attention. The cpsp feature just shall make the text that is set in capitals or small capitals more legible. If the user wants to drag attention with the help of more letterspacing like 200 units, he should do that manually. And it is harder to correct the kerning between letters, if a feature that you cannot turn of enlarges the capital letter spacing by 200 units.


Please correct me, if I am wrong!

Nick Shinn's picture

I don't put this feature in my fonts, as I think that when it says zero tracking in the character palette, that's what you should get.

However, there are a couple of extras that I often put in the c2sc ("all caps") feature. One is "all-cap" figures, with height, weight and proportions to match an all-cap setting.

And the other is an alternate, wider space glyph (which I name space.c2sc), because I find that the normal space width suitable for U&lc and (especially) all small cap setting isn't wide enough for all caps.

Bendy's picture

>wider space glyph

Interesting, did you invent that idea or have you seen it done in other fonts?

Nick, do you then design the caps to space with other caps or do you somehow space them to work with both caps and lowercase?

Michael Hernan's picture

A capital set against a lowercase letter is a whole different story than a capital set against another capital letter.

A capital 'as is' in a font has side bearings which make it look good beside lowercase for 'sentence case' setting.
The 'All Caps' OT feature can correct this when setting just Capitals.

I think the 200 units that my former self put in the code [above] is perhaps over generous and therefore a stylistic use of the feature. It looks like I was treating this as an automatic way to set small [top of page] headlines. (I am being Policed on this attitude elsewhere but will justify my actions on a case by case basis). [Wit]
Thanks for highlighting this.

I will look at this again and correct it.

So I agree with both @Arno and @Nick but maintain the Cpsp feature as totally valid in setting Capitals only at their optimum spacing.

Michael Hernan's picture

OK since doing this a couple of years back I have started to use 'Titling Alternatives'


but am just doing capitals, so I am in total control of how my capitals are set.
However, there may be a time when I will include lowercase in my Titling Alternatives so its back to square one and the Cpsp feature will be useful again!

Nick Shinn's picture

...did you invent that idea or have you seen it done in other fonts?

I haven't come across it in anyone else's digital fonts.

...do you then design the caps to space with other caps or do you somehow space them to work with both caps and lowercase?

I think the "normal" sidebearings work fine with both caps and lower case. And then there is kerning.

For instance, cap I has a thicker stem and wider sidebearings than lower case l.

Arno Enslin's picture

For an unknown reason Indesign CS3 ignores the the cpsp feature today, but according to OTMaster the feature is okay. I have cleared the font caches, made a restart, renamed the font. Very odd.

@ Nick Shinn

The advantage of the cpsp feature is, that you can select the whole text and change the letter spacing. The feature would be still applied. If the values would be shown in the letter spacing field, you would turn off the feature, when you select the whole text and change the letter spacing.

Arno Enslin's picture

Can anybody confirm, that the cpsp feature works in Indesign CS3? I am not sure anymore, if I have tested that before. But it does not seem to work in any CS3 app. I even have tried to change the feature order and generated the font with the AFDKO.

Michael Hernan's picture

MacOSX 10.5.8

All Caps/cpsp works for me.

Make sure you compile the feature (which I guess you have done if OTMaster says so).
I cant think what else appart from putting the font into the Adobe CS3 "Fonts" folder. This superseeds font managers AFAIK.
Then test using Myriad Pro just to see if the CS3 is the problem.

Arno Enslin's picture

It works in QuarkXPress 8 (Windows), but not in Indesign CS3 (Windows). Indesign CS3 does not make use of the cpsp feature in Myriad.

charles ellertson's picture

Actually, it does work in InDesign CS3 Windows (Vista) -- I just checked. You apply it via Character > All Caps.

Somebody dug up a 5-year-old thread for this?

Arno Enslin's picture

@ Charles

Ah, there it is. I was in the wrong menu (Type/Change Case). And in the OpenType menu the option is not available. Thank you very much! But it does not work with small caps, independent from where it is applied, does it? That’s probably reasonable, because the letter spacing of the small caps can be better controlled by the plain metrics. I am probably not going to integrate the small caps in that feature.

Somebody dug up a 5-year-old thread for this?

Belongs to the topic. As far as I find a matching topic, I am posting my questions, answers or comments there. I found it with Google (cpsp site:typophile.com).

charles ellertson's picture

But it does not work with small caps, independent from where it is applied, does it?

No, but only because in InDesign the feature is applied through "All Caps." For a long time, I did include small caps in the cpsp feature (albeit with slightly smaller values), but that's moot until a layout engine appears that lets you switch on cpsp directly.

Syndicate content Syndicate content