font-kerning
Summary
The font-kerning property allows contextual adjustment of inter-glyph spacing, i.e. the spaces between the characters in text. This property controls <bold>metric kerning</bold> - that utilizes adjustment data contained in the font. Optical Kerning is not supported as yet.
Overview table
- Initial value
auto
- Applies to
- all elements
- Inherited
- Yes
- Media
- visual
- Computed value
- as specified
- Animatable
- No
- CSS Object Model Property
font
- Percentages
- N/A
Syntax
font-kerning: auto
font-kerning: none
font-kerning: normal
Values
- auto
- Used to specify kerning is at the discretion of the user agent.
- normal
- Specifies kerning is applied. Fonts that do not include kerning data are unaffected by this setting.
- none
- Specifies kerning is not applied
Examples
- Kerning will only be visible when supported.
<p class="normal">WAVAWAVAWAVAWAVA</p>
<p class="none" >WAVAWAVAWAVAWAVA</p>
- Kerning will only be visible when supported.
html { font-size: 62.5%; }
p { font-family: "Arial", serif; font-size: 3.6rem }
p.normal {font-kerning: normal;}
p.none {font-kerning: none;}
Usage
In auto setting, user agents can determine whether to apply kerning or not based on a number of factors like text size, script, or other factors that influence text processing speed. Authors who what proper kerning should use 'normal' to explicitly enable kerning. Likewise, use none to explicitly disable kerning. There is a performance tradeoff when enabling kerning which might not have a large impact on text rendering speed for modern implementations.
Notes
Kerning data is a must for this property to take effect. When rendering OpenType fonts, the opentype specification states that kerning be enabled by default. When kerning is enabled, the OpenType kern
feature is enabled. vkern
is used for vertical text. User Agents must also support kerning via data contained in a kern
font table, as detailed in the OpenType specification. When used in conjunction with letter-spacing
, kerning adjustments are considered part of the default spacing and letter spacing adjustments are made <bold>after</bold> kerning has been applied.
Related specifications
- CSS Fonts Module Level 3
- W3C Candidate Recommendation
See also
Related articles
CSS Font
font-kerning