The kerning
attribute indicates whether the browser should adjust inter-glyph spacing based on kerning tables that are included in the relevant font (i.e., enable auto-kerning) or instead disable auto-kerning and instead set inter-character spacing to a specific length (typically, zero).
The value of auto
indicates that the user agent should adjust inter-glyph spacing based on kerning tables that are included in the font that will be used.
If a <length> is provided, then auto-kerning is disabled. Instead, inter-character spacing is set to the given <length>. The most common scenario, other than auto, is to set kerning
to a value of 0 so that auto-kerning is disabled.
If a <length> is provided without a unit identifier (e.g., an unqualified number such as 128), the browser processes the <length> as a width value in the current user coordinate system.
If a <length> is provided with a unit identifier (e.g., .25em or 1%), then the browser converts the <length> into a corresponding value in the current user coordinate system.
When a <length> is provided, its value is added to the inter-character spacing value specified by the letter-spacing
attribute.
As a presentation attribute, it also can be used as a property directly inside a CSS stylesheet, see css kerning
for further information.
Categories | Presentation attribute |
---|---|
Value | auto | <length> | inherit |
Animatable | Yes |
Normative document | SVG 1.1 (2nd Edition) |
A length is a distance measurement, given as a number along with a unit. Lengths are specified in one of two ways. When used in a stylesheet, a <length> is defined as follows:
length ::= number (~"em" | ~"ex" | ~"px" | ~"in" | ~"cm" | ~"mm" | ~"pt" | ~"pc")?
See the CSS2 specification for the meanings of the unit identifiers.
For properties defined in CSS2, a length unit identifier must be provided. For length values in SVG-specific properties and their corresponding presentation attributes, the length unit identifier is optional. If not provided, the length value represents a distance in the current user coordinate system. In presentation attributes for all properties, whether defined in SVG1.1 or in CSS2, the length identifier, if specified, must be in lower case.
When lengths are used in an SVG attribute, a <length> is instead defined as follows:
length ::= number ("em" | "ex" | "px" | "in" | "cm" | "mm" | "pt" | "pc" | "%")?
The unit identifiers in such <length> values must be in lower case.
Note that the non-property <length> definition also allows a percentage unit identifier. The meaning of a percentage length value depends on the attribute for which the percentage length value has been specified. Two common cases are:
In the SVG DOM, <length> values are represented using SVGLength
or SVGAnimatedLength
objects.
The following elements can use the kerning
attribute
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | ? | ? | ? | ? | ? | ? |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | ? | ? | ? | ? | ? | ? | ? |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/kerning