SVG Tiny 1.2 - 20050413

17 Fonts

Contents

17.1 Introduction

Reliable delivery of fonts is a requirement for SVG. Designers need to create SVG content with arbitrary fonts and know that the same graphical result will appear when the content is viewed by all end users, even when end users do not have the necessary fonts installed on their computers. This parallels the print world, where the designer uses a given font when authoring a drawing for print, and the graphical content appears exactly the same in the printed version as it appeared on the designer's authoring system.

Historically, one approach has been to convert all text to paths representing the glyphs used. This preserves the visual look, but means that the text is lost; it cannot be dynamically updated and is not accessible. Another approach is to hope that a font with a given name is available to all renderers. this assumption does not work well on the desktop and works very badly in a heterogenous mobile environment. SVG solves this problem by allowing the text to be converted to paths, but storing those paths as an SVG font. The text is retained and remains dynamicly modifiable and accessible.

17.1.1 Describing fonts available to SVG

SVG utilizes an XML version of the WebFonts facility defined in the "Cascading Style Sheets (CSS) level 2" specification [CSS2] to reference fonts. Described fonts may be in a variety of different formats.By describing key details of the font such as its family name, weight, whether it is italic and so on, text can continue to use the font properties without having to explicitly indicate the font that is to be used for each span of text.

17.1.2 Defining fonts in SVG

One disadvantage to the WebFont facility to date is that specifications such as [CSS2] do not require support of particular font formats. The result is that different implementations support different Web font formats, thereby making it difficult for Web site creators to post a single Web site using WebFonts that work across all user agents.

To provide a common font format for SVG that is guaranteed to be supported by all conforming SVG viewers, SVG also defines a font format, in SVG, which uses the same geometric mechanism for glyphs as is used by the SVG path element. This facility is called SVG fonts. SVG implementations must support the SVG font format, and may also support other formats.WebFonts may be contained in the SVG document which uses them, or stored in a separate document (for example, to allow sharing of the same font by multiple SVG documents).

Taken together, these two mechanisms ensure reliable delivery of font data to end users, preserving graphical richness and enabling accessible access to the textual data. . In a common scenario, SVG authoring applications generate compressed, subsetted WebFonts for all text elements used by a given SVG document fragment. SVG fonts can improve the semantic richness of graphics that represent text. For example, many company logos consist of the company name drawn artistically. In some cases, accessibility may be enhanced by expressing the logo as a series of glyphs in an SVG font and then rendering the logo as a 'text' element which references this font.

17.2 Overview of SVG fonts

An SVG font is a font defined using SVG's 'font' element.

The purpose of SVG fonts is to allow for delivery of glyph outlines in display-only environments. SVG fonts that accompany Web pages must be supported only in browsing and viewing situations. Graphics editing applications or file translation tools must not attempt to convert SVG fonts into system fonts. The intent is that SVG files be interchangeable between two content creators, but not the SVG fonts that might accompany these SVG files. Instead, each content creator will need to license the given font before being able to successfully edit the SVG file. The font-face-name element indicates the name of licensed font to use for editing.

SVG fonts contain unhinted font outlines. Because of this, on many implementations there will be limitations regarding the quality and legibility of text in small font sizes. For increased quality and legibility in small font sizes, content creators may want to use an alternate font technology, such as fonts that ship with operating systems or an alternate WebFont format.

Because SVG fonts are expressed using SVG elements and attributes, in some cases the SVG font will take up more space than if the font were expressed in a different format which was especially designed for compact expression of font data. For the fastest delivery of Web pages, content creators may want to use an alternate font technology as a first choice, with a fallback to an SVG fornt for interoperability.

A key value of SVG fonts is guaranteed availability in SVG user agents. In some situations, it might be appropriate for an SVG font to be the first choice for rendering some text. In other situations, the SVG font might be an alternate, back-up font in case the first choice font (perhaps a hinted system font) is not available to a given user.

The characteristics and attributes of SVG fonts correspond closely to the font characteristics and parameters described in the "Fonts" chapter of the "Cascading Style Sheets (CSS) level 2" specification [CSS2]. In this model, various font metrics, such as advance values and baseline locations, and the glyph outlines themselves, are expressed in units that are relative to an abstract square whose height is the intended distance between lines of type in the same type size. This square is called the em square and it is the design grid on which the glyph outlines are defined. The value of the units-per-em attribute on the 'font' element specifies how many units the em square is divided into. Common values for other font types are, for example, 250 (Intellifont), 1000 (Type 1) and 2048 (TrueType, TrueType GX and Open-Type). Unlike standard graphics in SVG, where the initial coordinate system has the y-axis pointing downward (see The initial coordinate system), the design grid for SVG fonts, along with the initial coordinate system for the glyphs, has the y-axis pointing upward for consistency with accepted industry practice for many popular font formats.

SVG fonts and their associated glyphs do not specify bounding box information. Because the glyph outlines are expressed as SVG path elements, the implementation has the option to render the glyphs either using standard graphics calls or by using special-purpose font rendering technology, in which case any necessary maximum bounding box and overhang calculations can be performed from analysis of the path elements contained within the glyph outlines.

An SVG font can be either embedded within the same document that uses the font or saved as part of an external resource.

Here is an example of how you might embed an SVG font inside of an SVG document.

Example: 20_01.svg
<?xml version="1.0" standalone="yes"?>
<svg width="400px" height="300px" version="1.2" baseProfile="tiny"
  xmlns = 'http://www.w3.org/2000/svg'>
  <defs>
    <font id="Font1" horiz-adv-x="1000">
      <font-face font-family="Super Sans" font-weight="bold" font-style="normal"
          units-per-em="1000" cap-height="600" x-height="400"
          ascent="700" descent="300" alphabetic="0" mathematical="350" ideographic="400" hanging="500">
        <font-face-src>
          <font-face-name name="Super Sans Bold"/>
        </font-face-src>
      </font-face>
      <missing-glyph><path d="M0,0h200v200h-200z"/></missing-glyph>
      <glyph unicode="!" horiz-adv-x="300" d="--Outline of exclam. pt. glyph--"/>
      <glyph unicode="@" d="--Outline of @ glyph--"/>
      <!-- more glyphs -->
    </font>
  </defs>
  <desc>An example using an embedded font.</desc>
  <text x="100" y="100" font-family="Super Sans, Helvetica, sans-serif"
                  font-weight="bold" font-style="normal">Text 
    using embedded font</text>
</svg>
    

17.3 The 'font' element

The 'font' element defines an SVG font.

Schema: font
  <define name='font'>
    <element name='font'>
      <ref name='font.AT'/>
      <ref name='font.CM'/>
    </element>
  </define>

  <define name='font.AT' combine='interleave'>
    <ref name='svg.Core.attr'/>
    <ref name='svg.External.attr'/>
    <ref name='svg.FontAdvOrigCommon.attr'/>
    <optional>
      <attribute name='horiz-origin-x' svg:animatable='false' svg:inheritable='false'>
        <ref name='Number.datatype'/>
      </attribute>
    </optional>
  </define>

  <define name='font.CM'>
    <zeroOrMore>
      <choice>
        <ref name='svg.Desc.group'/>
        <ref name='font-face'/>
        <ref name='missing-glyph'/>
        <ref name='glyph'/>
        <ref name='hkern'/>
      </choice>
    </zeroOrMore>
  </define>

  <define name='svg.FontAdvOrigCommon.attr' combine='interleave'>
    <optional>
      <attribute name='horiz-adv-x' svg:animatable='false' svg:inheritable='false'>
        <ref name='Number.datatype'/>
      </attribute>
    </optional>
  </define>
    

Attribute definitions:

horiz-origin-x = "<number>"
The X-coordinate in the font coordinate system of the origin of a glyph to be used when drawing horizontally oriented text. (Note that the origin applies to all glyphs in the font.)

If the attribute is not specified, the effect is as if a value of "0" were specified.

Animatable: no.
horiz-adv-x = "<number>"
The default horizontal advance after rendering a glyph in horizontal orientation. Glyph widths are required to be non-negative, even if the glyph is typically rendered right-to-left, as in Hebrew and Arabic scripts.

Animatable: no.


Each 'font' element must have a 'font-face' child element which describes various characteristics of the font.

17.4 The 'glyph' element

The 'glyph' element defines the graphics for a given glyph. The coordinate system for the glyph is defined by the various attributes in the 'font' element.

The graphics that make up the 'glyph' consist of a single path data specification within the d attribute.

Schema: glyph
  <define name='glyph'>
    <element name='glyph'>
      <ref name='glyph.AT'/>
      <ref name='glyph.CM'/>
    </element>
  </define>

  <define name='glyph.AT' combine='interleave'>
    <ref name='svg.Core.attr'/>
    <ref name='svg.FontAdvOrigCommon.attr'/>
    <ref name='svg.D.attr'/>
    <attribute name='unicode' svg:animatable='false' svg:inheritable='false'><text/></attribute>
    <optional><attribute name='glyph-name' svg:animatable='false' svg:inheritable='false'><text/></attribute>
    </optional>
    <optional><attribute name='arabic-form' svg:animatable='false' svg:inheritable='false'><text/></attribute>
    </optional>
    <optional>
      <attribute name='lang' svg:animatable='false' svg:inheritable='false'>
        <ref name='LanguageCodes.datatype'/>
      </attribute>
    </optional>
  </define>

  <define name='glyph.CM'>
    <zeroOrMore>
      <choice>
        <ref name='svg.Desc.group'/>
      </choice>
    </zeroOrMore>
  </define>
    

Attribute definitions:

unicode = "<string>"
One or more Unicode characters indicating the sequence of Unicode characters which corresponds to this glyph. If a character is provided, then this glyph corresponds to the given Unicode character. If multiple characters are provided, then this glyph corresponds to the given sequence of Unicode characters. One use of a sequence of characters is ligatures. For example, if unicode="ffl", then the given glyph will be used to render the sequence of characters "f", "f", and "l".



It is often useful to refer to characters using XML character references expressed in hexadecimal notation or decimal notation. For example, unicode="ffl" could be expressed as XML character references in hexadecimal notation as unicode="&#x66;&#x66;&#x6c;" or in decimal notation as unicode="&#102;&#102;&#108;".



The unicode attribute contributes to the process for deciding which glyph(s) are used to represent which character(s). See glyph selection rules. If the unicode attribute is not provided for a given 'glyph', the glyph cannot be accessed in SVG Tiny 1.2.

Animatable: no.
glyph-name = "<name> [, <name> ]* "
An optional name for the glyph. It is recommended that glyph names be unique within a font. The glyph names can be used in situations where Unicode character numbers do not provide sufficient information to access the correct glyph, such as when there are multiple glyphs per Unicode character. The glyph names can be referenced in kerning definitions.

Animatable: no.
d = "path data"
The definition of the outline of a glyph, using the same syntax as for the d attribute on a 'path' element. See Path data.

See below for a discussion of this attribute.

Animatable: no.
arabic-form = "initial | medial | terminal | isolated"
For Arabic glyphs, indicates which of the four possible forms this glyph represents.

Animatable: no.
lang = "%LanguageCodes;"
The attribute value is a comma-separated list of language names as defined in [RFC3066]. The glyph can be used if the xml:lang attribute exactly matches one of the languages given in the value of this parameter, or if the xml:lang attribute exactly equals a prefix of one of the languages given in the value of this parameter such that the first tag character following the prefix is "-". If the attribute is not specified, then the glyph can be used in all languages.

Animatable: no.
horiz-adv-x = "<number>"
The horizontal advance after rendering the glyph in horizontal orientation. If the attribute is not specified, the effect is as if the attribute were set to the value of the font's horiz-adv-x attribute.

Glyph widths are required to be non-negative, even if the glyph is typically rendered right-to-left, as in Hebrew and Arabic scripts.

Animatable: no.

The graphics for the 'glyph' are specified using the d attribute. The path data within this attribute is processed as follows:

In general, the d attribute renders in the same manner as system fonts. For example, a dashed pattern will usually look the same if applied to a system font or to an SVG font which defines its glyphs using the d attribute. Many implementations will be able to render glyphs quickly and will be able to use a font cache for further performance gains.

17.5 The 'missing-glyph' element

The 'missing-glyph' element defines a graphic to use if there is an attempt to draw a glyph from a given font and the given glyph has not been defined. The attributes on the 'missing-glyph' element have the same meaning as the corresponding attributes on the 'glyph' element.

Schema: missing-glyph
  <define name='missing-glyph'>
    <element name='missing-glyph'>
      <ref name='missing-glyph.AT'/>
      <ref name='missing-glyph.CM'/>
    </element>
  </define>

  <define name='missing-glyph.AT' combine='interleave'>
    <ref name='svg.Core.attr'/>
    <ref name='svg.FontAdvOrigCommon.attr'/>
    <ref name='svg.D.attr'/>
  </define>

  <define name='missing-glyph.CM'>
    <zeroOrMore>
      <choice>
        <ref name='svg.Desc.group'/>
      </choice>
    </zeroOrMore>
  </define>
    

17.6 Glyph selection rules

When determining the glyph(s) to draw a given character sequence, the 'font' element is searched from its first 'glyph' element to its last in logical order to see if the upcoming sequence of Unicode characters to be rendered matches the sequence of Unicode characters specified in the unicode attribute for the given 'glyph' element. The first successful match is used. Thus, the "ffl" ligature needs to be defined in the font before the "f" glyph; otherwise, the "ffl" will never be selected.

17.7 The 'hkern' element

The 'hkern' element defines kerning pairs for horizontally-oriented pairs of glyphs.

Kern pairs identify pairs of glyphs within a single font whose inter-glyph spacing is adjusted when the pair of glyphs are rendered next to each other. In addition to the requirement that the pair of glyphs are from the same font, SVG font kerning happens only when the two glyphs correspond to characters which have the same values for properties 'font-family', 'font-size', 'font-style' and 'font-weight'.

An example of a kerning pair are the letters "Va", where the typographic result might look better if the letters "V" and the "a" were rendered slightly closer together.

Right-to-left and bidirectional text in SVG is laid out in a two-step process, which is described in Relationship with bidirectionality. If SVG fonts are used, before kerning is applied, characters are re-ordered into left-to-right (or top-to-bottom, for vertical text) visual rendering order. Kerning from SVG fonts is then applied on pairs of glyphs which are rendered contiguously. The first glyph in the kerning pair is the left (or top) glyph in visual rendering order. The second glyph in the kerning pair is the right (or bottom) glyph in the pair.

For convenience to font designers and to minimize file sizes, a single 'hkern' can define a single kerning adjustment value between one set of glyphs (e.g., a range of Unicode characters) and another set of glyphs (e.g., another range of Unicode characters).

The 'hkern' element defines kerning pairs and adjustment values in the horizontal advance value when drawing pairs of glyphs which the two glyphs are contiguous and are both rendered horizontally (i.e., side-by-side). The spacing between characters is reduced by the kerning adjustment. (Negative kerning adjustments increase the spacing between characters.)

Schema: hkern
  <define name='hkern'>
    <element name='hkern'>
      <ref name='hkern.AT'/>
      <ref name='hkern.CM'/>
    </element>
  </define>

  <define name='hkern.AT' combine='interleave'>
    <ref name='svg.Core.attr'/>
    <optional>
      <attribute name='u1' svg:animatable='false' svg:inheritable='false'><text/></attribute>
    </optional>
    <optional>
      <attribute name='g1' svg:animatable='false' svg:inheritable='false'><text/></attribute>
    </optional>
    <optional>
      <attribute name='u2' svg:animatable='false' svg:inheritable='false'><text/></attribute>
    </optional>
    <optional>
      <attribute name='g2' svg:animatable='false' svg:inheritable='false'><text/></attribute>
    </optional>
    <attribute name='k' svg:animatable='false' svg:inheritable='false'>
      <ref name='Number.datatype'/>
    </attribute>
  </define>

  <define name='hkern.CM'>
    <zeroOrMore>
      <choice>
        <ref name='svg.Desc.group'/>
      </choice>
    </zeroOrMore>
  </define>

    

Attribute definitions:

u1 = "[<character> | <urange> ] [, [<character> | <urange>] ]* "
A sequence (comma-separated) of Unicode characters (refer to the description of the unicode attribute to the 'glyph' element for a description of how to express individual Unicode characters) and/or ranges of Unicode characters (see description of ranges of Unicode characters in [CSS2]) which identify a set of possible first glyphs in the kerning pair. If a given Unicode character within the set has multiple corresponding 'glyph' elements (i.e., there are multiple 'glyph' elements with the same unicode attribute value, but different glyph-name values), then all such glyphs are included in the set. Comma is the separator character; thus, to kern a comma, specify the comma as part of a range of Unicode characters or as a glyph name using the g1 attribute. The total set of possible first glyphs in the kerning pair is the union of glyphs specified by the u1 and g1 attributes.

Animatable: no.
g1 = "<name> [, <name> ]* "
A sequence (comma-separated) of glyph names (i.e., values that match glyph-name attributes on 'glyph' elements) which identify a set of possible first glyphs in the kerning pair. All glyphs with the given glyph name are included in the set. The total set of possible first glyphs in the kerning pair is the union of glyphs specified by the u1 and g1 attributes.

Animatable: no.
u2 = "[<number> | <urange>] [, [<number> | <urange>] ]* "
Same as the u1 attribute, except that u2 specifies possible second glyphs in the kerning pair.

Animatable: no.
g2 = "<name> [, <name> ]* "
Same as the g1 attribute, except that g2 specifies possible second glyphs in the kerning pair.

Animatable: no.
k = "<number>"
The amount to decrease the spacing between the two glyphs in the kerning pair. The value is in the font coordinate system. This attribute is required.

Animatable: no.


At least one each of u1 or g1 and at least one of u2 or g2 must be provided.

17.8 Describing a font

17.8.1 Overview of font descriptions

A font description provides the bridge between an author's font specification and the font data, which is the data needed to format text and to render the abstract glyphs to which the characters map - the actual scalable outlines or bitmaps. Fonts are referenced by properties, such as the 'font-family' property.

Each specified font description is added to the font database and so that it can be used to select the relevant font data. The font description contains descriptors such as the location of the font data on the Web, and characterizations of that font data. The font descriptors are also needed to match the font properties to particular font data. The level of detail of a font description can vary from just the name of the font up to a list of glyph widths.

For more about font descriptions, refer to the font chapter in the CSS2 specification [CSS2 Fonts].

17.8.2 The 'font-face' element

The 'font-face' element is an XML structure which corresponds directly to the @font-face facility in CSS2. It can be used to describe the characteristics of any font, SVG font or otherwise.

When used to describe the characteristics of an SVG font contained within the same document, it is recommended that the 'font-face' element be a child of the 'font' element it is describing so that the 'font' element can be self-contained and fully-described. In this case, any 'font-face-src' elements within the 'font-face' element are ignored as it is assumed that the 'font-face' element is describing the characteristics of its parent 'font' element.

Schema: font-face
  <define name='font-face'>
    <element name='font-face'>
      <ref name='font-face.AT'/>
      <ref name='font-face.CM'/>
    </element>
  </define>

  <define name='font-face.AT' combine='interleave'>
    <ref name='svg.Core.attr'/>
    <ref name='svg.External.attr'/>
    <optional><attribute name='font-family' svg:animatable='false' svg:inheritable='false'><text/></attribute>
    </optional>
    <optional><attribute name='font-style' svg:animatable='false' svg:inheritable='false'><text/></attribute>
    </optional>
    <optional><attribute name='font-weight' svg:animatable='false' svg:inheritable='false'><text/></attribute>
    </optional>
    <optional><attribute name='font-size' svg:animatable='false' svg:inheritable='false'><text/></attribute>
    </optional>
    <optional><attribute name='font-variant' svg:animatable='false' svg:inheritable='false'><text/></attribute>
    </optional>
    <optional><attribute name='font-stretch' svg:animatable='false' svg:inheritable='false'><text/></attribute>
    </optional>
    <optional><attribute name='unicode-range' svg:animatable='false' svg:inheritable='false'><text/></attribute>
    </optional>
    <optional><attribute name='panose-1' svg:animatable='false' svg:inheritable='false'><text/></attribute>
    </optional>
    <optional><attribute name='widths' svg:animatable='false' svg:inheritable='false'><text/></attribute>
    </optional>
    <optional><attribute name='bbox' svg:animatable='false' svg:inheritable='false'><text/></attribute>
    </optional>
    <optional>
      <attribute name='units-per-em' svg:animatable='false' svg:inheritable='false'>
        <ref name='Number.datatype'/>
      </attribute>
    </optional>
    <optional>
      <attribute name='stemv' svg:animatable='false' svg:inheritable='false'>
        <ref name='Number.datatype'/>
      </attribute>
    </optional>
    <optional>
      <attribute name='stemh' svg:animatable='false' svg:inheritable='false'>
        <ref name='Number.datatype'/>
      </attribute>
    </optional>
    <optional>
      <attribute name='slope' svg:animatable='false' svg:inheritable='false'>
        <ref name='Number.datatype'/>
      </attribute>
    </optional>
    <optional>
      <attribute name='cap-height' svg:animatable='false' svg:inheritable='false'>
        <ref name='Number.datatype'/>
      </attribute>
    </optional>
    <optional>
      <attribute name='x-height' svg:animatable='false' svg:inheritable='false'>
        <ref name='Number.datatype'/>
      </attribute>
    </optional>
    <optional>
      <attribute name='accent-height' svg:animatable='false' svg:inheritable='false'>
        <ref name='Number.datatype'/>
      </attribute>
    </optional>
    <optional>
      <attribute name='ascent' svg:animatable='false' svg:inheritable='false'>
        <ref name='Number.datatype'/>
      </attribute>
    </optional>
    <optional>
      <attribute name='descent' svg:animatable='false' svg:inheritable='false'>
        <ref name='Number.datatype'/>
      </attribute>
    </optional>
    <optional>
      <attribute name='ideographic' svg:animatable='false' svg:inheritable='false'>
        <ref name='Number.datatype'/>
      </attribute>
    </optional>
    <optional>
      <attribute name='alphabetic' svg:animatable='false' svg:inheritable='false'>
        <ref name='Number.datatype'/>
      </attribute>
    </optional>
    <optional>
      <attribute name='mathematical' svg:animatable='false' svg:inheritable='false'>
        <ref name='Number.datatype'/>
      </attribute>
    </optional>
    <optional>
      <attribute name='hanging' svg:animatable='false' svg:inheritable='false'>
        <ref name='Number.datatype'/>
      </attribute>
    </optional>
    <optional>
      <attribute name='underline-position' svg:animatable='false' svg:inheritable='false'>
        <ref name='Number.datatype'/>
      </attribute>
    </optional>
    <optional>
      <attribute name='underline-thickness' svg:animatable='false' svg:inheritable='false'>
        <ref name='Number.datatype'/>
      </attribute>
    </optional>
    <optional>
      <attribute name='strikethrough-position' svg:animatable='false' svg:inheritable='false'>
        <ref name='Number.datatype'/>
      </attribute>
    </optional>
    <optional>
      <attribute name='strikethrough-thickness' svg:animatable='false' svg:inheritable='false'>
        <ref name='Number.datatype'/>
      </attribute>
    </optional>
    <optional>
      <attribute name='overline-position' svg:animatable='false' svg:inheritable='false'>
        <ref name='Number.datatype'/>
      </attribute>
    </optional>
    <optional>
      <attribute name='overline-thickness' svg:animatable='false' svg:inheritable='false'>
        <ref name='Number.datatype'/>
      </attribute>
    </optional>
  </define>

  <define name='font-face.CM'>
    <zeroOrMore>
      <choice>
        <ref name='svg.Desc.group'/>
        <ref name='font-face-src'/>
      </choice>
    </zeroOrMore>
  </define>
    

Attribute definitions:

font-family = "<string>"
Same syntax and semantics as the 'font-family' descriptor within an @font-face rule.

Animatable: no.
font-style = "all | [ normal | italic | oblique] [, [normal | italic | oblique]]*"
Same syntax and semantics as the 'font-style' descriptor within an @font-face rule. The style of a font. Takes on the same values as the 'font-style' property, except that a comma-separated list is permitted.

If the attribute is not specified, the effect is as if a value of "all" were specified.

Animatable: no.
font-weight = "all | [normal | bold |100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900] [, [normal | bold |100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900]]*"
Same syntax and semantics as the 'font-weight' descriptor within an @font-face rule.

The weight of a face relative to others in the same font family. Takes on the same values as the 'font-weight' property with three exceptions:
  • relative keywords (bolder, lighter) are not permitted
  • a comma-separated list of values is permitted, for fonts that contain multiple weights
  • an additional keyword, 'all', is permitted, which means that the font will match for all possible weights; either because it contains multiple weights, or because that face only has a single weight.
If the attribute is not specified, the effect is as if a value of "all" were specified.

Animatable: no.
font-size = "<string>"
Same syntax and semantics as the 'font-size' descriptor within an @font-face rule.

Animatable: no.
unicode-range = "<urange> [, <urange>]*"
Same syntax and semantics as the 'unicode-range' descriptor within an @font-face rule. The range of ISO 10646 characters [UNICODE] possibly covered by the glyphs in the font. Except for any additional information provided in this specification, the normative definition of the attribute is in [CSS2].

If the attribute is not specified, the effect is as if a value of "U+0-10FFFF" were specified.

Animatable: no.
units-per-em = "<number>"
Same syntax and semantics as the 'units-per-em' descriptor within an @font-face rule. The number of coordinate units on the em square, the size of the design grid on which glyphs are laid out.

This value is almost always necessary as nearly every other attribute requires the definition of a design grid.

If the attribute is not specified, the effect is as if a value of "1000" were specified.

Animatable: no.
panose-1 = "[<integer>]{10}"
Same syntax and semantics as the 'panose-1' descriptor within an @font-face rule. The Panose-1 number, consisting of ten decimal integers, separated by whitespace. Except for any additional information provided in this specification, the normative definition of the attribute is in [CSS2].

If the attribute is not specified, the effect is as if a value of "0 0 0 0 0 0 0 0 0 0" were specified.

Animatable: no.
stemv = "<number>"
Same syntax and semantics as the 'stemv' descriptor within an @font-face rule.

Animatable: no.
stemh = "<number>"
Same syntax and semantics as the 'stemh' descriptor within an @font-face rule.

Animatable: no.
slope = "<number>"
Same syntax and semantics as the 'slope' descriptor within an @font-face rule. The vertical stroke angle of the font. Except for any additional information provided in this specification, the normative definition of the attribute is in [CSS2].

If the attribute is not specified, the effect is as if a value of "0" were specified.

Animatable: no.
cap-height = "<number>"
Same syntax and semantics as the 'cap-height' descriptor within an @font-face rule. The height of uppercase glyphs in the font within the font coordinate system.

Animatable: no.
x-height = "<number>"
Same syntax and semantics as the 'x-height' descriptor within an @font-face rule. The height of lowercase glyphs in the font within the font coordinate system.

Animatable: no.
accent-height = "<number>"
The distance from the origin to the top of accent characters, measured by a distance within the font coordinate system.

If the attribute is not specified, the effect is as if the attribute were set to the value of the ascent attribute. If this attribute is used, the units-per-em attribute must also be specified.

Animatable: no.
ascent = "<number>"
Same syntax and semantics as the 'ascent' descriptor within an @font-face rule. The maximum unaccented height of the font within the font coordinate system.

If the attribute is not specified, the effect is as if the attribute were set to the difference between the units-per-em value and the vert-origin-y value for the corresponding font.

Animatable: no.
descent = "<number>"
Same syntax and semantics as the 'descent' descriptor within an @font-face rule. The maximum unaccented depth of the font within the font coordinate system.

If the attribute is not specified, the effect is as if the attribute were set to the vert-origin-y value for the corresponding font.

Animatable: no.
widths = "<string>"
Same syntax and semantics as the 'widths' descriptor within an @font-face rule.

Animatable: no.
bbox = "<string>"
Same syntax and semantics as the 'bbox' descriptor within an @font-face rule.

Animatable: no.
ideographic = "<number>"
For horizontally oriented glyph layouts, indicates the alignment coordinate for glyphs to achieve ideographic baseline alignment. The value is an offset in the font coordinate system. If this attribute is provided, the units-per-em attribute must also be specified.

Animatable: no.
alphabetic = "<number>"
Same syntax and semantics as the 'baseline' descriptor within an @font-face rule. For horizontally oriented glyph layouts, indicates the alignment coordinate for glyphs to achieve alphabetic baseline alignment. The value is an offset in the font coordinate system. If this attribute is provided, the units-per-em attribute must also be specified.

Animatable: no.
mathematical = "<number>"
Same syntax and semantics as the 'mathline' descriptor within an @font-face rule. For horizontally oriented glyph layouts, indicates the alignment coordinate for glyphs to achieve mathematical baseline alignment. The value is an offset in the font coordinate system. If this attribute is provided, the units-per-em attribute must also be specified.

Animatable: no.
hanging = "<number>"
For horizontally oriented glyph layouts, indicates the alignment coordinate for glyphs to achieve hanging baseline alignment. The value is an offset in the font coordinate system. If this attribute is provided, the units-per-em attribute must also be specified.

Animatable: no.
underline-position = "<number>"
The ideal position of an underline within the font coordinate system. If this attribute is provided, the units-per-em attribute must also be specified.

Animatable: no.
underline-thickness = "<number>"
The ideal thickness of an underline, expressed as a length within the font coordinate system. If this attribute is provided, the units-per-em attribute must also be specified.

Animatable: no.
strikethrough-position = "<number>"
The ideal position of a strike-through within the font coordinate system. If this attribute is provided, the units-per-em attribute must also be specified.

Animatable: no.
strikethrough-thickness = "<number>"
The ideal thickness of a strike-through, expressed as a length within the font coordinate system. If this attribute is provided, the units-per-em attribute must also be specified.

Animatable: no.
overline-position = "<number>"
The ideal position of an overline within the font coordinate system. If this attribute is provided, the units-per-em attribute must also be specified.

Animatable: no.
overline-thickness = "<number>"
The ideal thickness of an overline, expressed as a length within the font coordinate system. If this attribute is provided, the units-per-em attribute must also be specified.

Animatable: no.

17.8.3 The 'font-face-src' element

The 'font-face-src' element, together with the 'font-face-uri' and 'font-face-name' elements described further down correspond to the 'src' descriptor within an @font-face rule. (Refer to the descriptions of the [ @font-face rule] and ['src' descriptor] in the CSS2 specification.)

A 'font-face-src' element contains either a 'font-face-uri' or a 'font-face-name' element. The 'font-face-src' element is used for referencing fonts defined elsewhere.

Schema: font-face-src
  <define name='font-face-src'>
    <element name='font-face-src'>
      <ref name='font-face-src.AT'/>
      <ref name='font-face-src.CM'/>
    </element>
  </define>

  <define name='font-face-src.AT' combine='interleave'>
    <ref name='svg.Core.attr'/>
  </define>

  <define name='font-face-src.CM'>
    <zeroOrMore>
      <choice>
        <ref name='svg.Desc.group'/>
        <ref name='font-face-uri'/>
        <ref name='font-face-name'/>
      </choice>
    </zeroOrMore>
  </define>
    

17.8.4 The 'font-face-uri' element

The 'font-face-uri' element is used within a 'font-face-src' element to reference a font defined inside or outside of the current SVG document.

When a 'font-face-uri' is referencing an SVG font, then that reference must be to an SVG 'font' element, therefore requiring the use of a fragment identifier (see [IRI]). The referenced 'font' element can be local (i.e., within the same document as the 'font-face-uri' element) or remote (i.e., within a different document).

Schema: font-face-uri
  <define name='font-face-uri'>
    <element name='font-face-uri'>
      <ref name='font-face-uri.AT'/>
      <ref name='font-face-uri.CM'/>
    </element>
  </define>

  <define name='font-face-uri.AT' combine='interleave'>
    <ref name='svg.Core.attr'/>
    <ref name='svg.XLinkRequired.attr'/>
  </define>

  <define name='font-face-uri.CM'>
    <zeroOrMore>
      <choice>
        <ref name='svg.Desc.group'/>
      </choice>
    </zeroOrMore>
  </define>

    

Attribute definitions:

xlink:href = " <iri>"
An IRI reference

Animatable: no.

17.8.5 The 'font-face-name' element

The 'font-face-name' element is used within a 'font-face-src' element to name the font.

Schema: font-face-name
  <define name='font-face-name'>
    <element name='font-face-name'>
      <ref name='font-face-name.AT'/>
      <ref name='font-face-name.CM'/>
    </element>
  </define>

  <define name='font-face-name.AT' combine='interleave'>
    <ref name='svg.Core.attr'/>
    <optional>
      <attribute name='name' svg:animatable='false' svg:inheritable='false'><text/></attribute>
    </optional>
  </define>

  <define name='font-face-name.CM'>
    <zeroOrMore>
      <choice>
        <ref name='svg.Desc.group'/>
      </choice>
    </zeroOrMore>
  </define>
    

Attribute definitions:

name = " <string>"
The name of the font to use.

Animatable: no.

17.9 Font Module

The Font Module contains the following elements:

Font