You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to set capital spacing with font-feature-settings: 'cpsp' turns it on, but has the side effect of resetting all other OpenType features if they were in effect, including 'case'.
As recommended by an answer on Stackoverflow, I'm starting a discussion for these lesser-used but powerful OpenType features.
There are two common OpenType font features settings that don't have a typical way to enable independently/cascading, rather than maintain them and re-define the list of font-feature-settings for various capitalization scenarios, in our case, 'case' and 'cpsp'
Case-Sensitive Forms of fonts, 'case' definition from microsoft.com:
Shifts various punctuation marks up to a position that works better with all-capital sequences or sets of lining figures; also changes oldstyle figures to lining figures. By default, glyphs in a text face are designed to work with lowercase characters. Some characters should be shifted vertically to fit the higher visual center of all-capital or lining text. Also, lining figures are the same height (or close to it) as capitals, and fit much better with all-capital text. Example: The user selects a block of text and applies this feature. The dashes, bracketing characters, guillemet quotes and the like shift up to match the capitals, and oldstyle figures change to lining figures.
Note that this calls out punctuation and oldstyle figures, but 'case' could affect certain letterforms such as a diacritic hook.
Globally adjusts inter-glyph spacing for all-capital text. Most typefaces contain capitals and lowercase characters, and the capitals are positioned to work with the lowercase. When capitals are used for words, they need more space between them for legibility and esthetics. This feature would not apply to monospaced designs. Of course the user may want to override this behavior in order to do more pronounced letterspacing for esthetic reasons. Example: The user sets a title in all caps, and the Capital Spacing feature opens the spacing.
Here's with both applied. There's only a subtle change to spacing that truly shows up by noting the last character shifts to the right slightly.
Recommendation options - apologies, I'm not sure how the decision-making process has been done in the past, nor am I familiar enough with #5799 "[css-fonts-4] font-variant-alternates implementation" to know if this would solve this.
text-transform: uppercase could institute both of these. If 'case' characters exist, and if 'cpsp' is defined, use them, if not, it would fallback to the default. The problem is that you could have a lowercase letter that could benefit from 'cpsp' being amongst capital letters, so unsetting text-transform for one letter would change the spacing. No biggie.
font-variant-caps: all-caps could activate both 'case' and 'cpsp,' but would still require text-transform: uppercase to make sense-- so the system forces that, or leaves it to the developer to activate. It would likely override oldstyle figures in this way.
font-kerning: capital for 'cpsp', and font-variant-alternates: upperxxx for 'case'. I assume uppercase or all-caps is reserved. Both be set independently, and unset with normal
The solution should allow lowercase characters to be used when needed. For example, in an all-caps style, the iPhone would need to appear as iPHONE. For that, a class could be used on the letter "i" that leaves 'cpsp' for kerning but turns off uppercase and leaves 'case' turned on.
Thanks for the discussion!
The text was updated successfully, but these errors were encountered:
I agree that only being able to use this via the low-level, non-cascading font-feature-settings is suboptimal.
mfishma
changed the title
[css-fonts] font property for OpenType 'case' & 'cpsp': Case-Sensitive Forms and Capital Spacing
[css-fonts] font property for OpenType 'case' & 'cpsp': Case-Sensitive Forms and Capital Spacing should be cascading
Feb 16, 2022
Uh oh!
There was an error while loading. Please reload this page.
Trying to set capital spacing with
font-feature-settings: 'cpsp'
turns it on, but has the side effect of resetting all other OpenType features if they were in effect, including'case'
.As recommended by an answer on Stackoverflow, I'm starting a discussion for these lesser-used but powerful OpenType features.
There are two common OpenType font features settings that don't have a typical way to enable independently/cascading, rather than maintain them and re-define the list of font-feature-settings for various capitalization scenarios, in our case, 'case' and 'cpsp'
Case-Sensitive Forms of fonts, 'case' definition from microsoft.com:
Note that this calls out punctuation and oldstyle figures, but 'case' could affect certain letterforms such as a diacritic hook.
Capital Spacing 'cpsp' from microsoft.com:
Here's with both applied. There's only a subtle change to spacing that truly shows up by noting the last character shifts to the right slightly.

Recommendation options - apologies, I'm not sure how the decision-making process has been done in the past, nor am I familiar enough with #5799 "[css-fonts-4] font-variant-alternates implementation" to know if this would solve this.
text-transform: uppercase
could institute both of these. If 'case' characters exist, and if 'cpsp' is defined, use them, if not, it would fallback to the default. The problem is that you could have a lowercase letter that could benefit from 'cpsp' being amongst capital letters, so unsetting text-transform for one letter would change the spacing. No biggie.font-variant-caps: all-caps
could activate both 'case' and 'cpsp,' but would still requiretext-transform: uppercase
to make sense-- so the system forces that, or leaves it to the developer to activate. It would likely override oldstyle figures in this way.font-kerning: capital
for 'cpsp', andfont-variant-alternates: upperxxx
for 'case'. I assume uppercase or all-caps is reserved. Both be set independently, and unset withnormal
The solution should allow lowercase characters to be used when needed. For example, in an all-caps style, the iPhone would need to appear as iPHONE. For that, a class could be used on the letter "i" that leaves 'cpsp' for kerning but turns off uppercase and leaves 'case' turned on.
Thanks for the discussion!
The text was updated successfully, but these errors were encountered: