Font Properties

These font properties are useful for fine-tuning text. Use these properties in the style attribute, both to streamline code and to keep the presentational aspects of text together.

Property

Value

Description

font-family

A font name, such as arial or times; or a generic value, such as serif or sans

Specifies a font to be used for text in a <text> or <tspan> element. SVG has many fonts available, and it is also possible to import fonts.

font-style

normal | italic |oblique

Specifies the rendering of the font face as italic, normal, or oblique. Defaults to normal.

font-variant

normal | small-caps

Specifies whether lowercase text will be rendered in normal, i.e., lowercase text, or in small-caps text. Defaults to normal.

font-weight

normal | bold | bolder | lighter

Specifies boldness or lightness of text. Defaults to normal.

font-stretch

normal | wider | narrower

Specifies condensing or expanding of glyphs. Defaults to normal.

font-size

<absolute size> | <relative size> | <length> | <percentage>

Specifies size of font. The words in brackets indicate number values. If no unit identifier is provided for number values, SVG will assume the current user unit, (pixels, unless otherwise specified in the SVG document).

font-size-adjust

<number> | none

Specifies an aspect value that preserves the sizing of a font if it is necessary to substitute another font for the original font.