The 'font-face' element corresponds directly to the @font-face facility in CSS 2 ([CSS2], section 15.3.1). 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.
<!ENTITY % SVG.font-face.extra.content "" > <!ENTITY % SVG.font-face.element "INCLUDE" > <![%SVG.font-face.element;[ <!ENTITY % SVG.font-face.content "(( %SVG.Description.class; )*, %SVG.font-face-src.qname;?, %SVG.definition-src.qname;? %SVG.font-face.extra.content; )" > <!ELEMENT %SVG.font-face.qname; %SVG.font-face.content; > <!-- end of SVG.font-face.element -->]]> <!ENTITY % SVG.font-face.attlist "INCLUDE" > <![%SVG.font-face.attlist;[ <!ATTLIST %SVG.font-face.qname; %SVG.Core.attrib; font-family %FontFamilyValue.datatype; #IMPLIED font-style ( normal | italic | oblique ) #IMPLIED font-variant ( normal | small-caps ) #IMPLIED font-weight ( normal | bold | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 ) #IMPLIED font-stretch ( normal | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded ) #IMPLIED font-size %FontSizeValue.datatype; #IMPLIED unicode-range CDATA #IMPLIED units-per-em %Number.datatype; #IMPLIED panose-1 CDATA #IMPLIED stemv %Number.datatype; #IMPLIED stemh %Number.datatype; #IMPLIED slope %Number.datatype; #IMPLIED cap-height %Number.datatype; #IMPLIED x-height %Number.datatype; #IMPLIED accent-height %Number.datatype; #IMPLIED ascent %Number.datatype; #IMPLIED descent %Number.datatype; #IMPLIED widths CDATA #IMPLIED bbox CDATA #IMPLIED ideographic %Number.datatype; #IMPLIED alphabetic %Number.datatype; #IMPLIED mathematical %Number.datatype; #IMPLIED hanging %Number.datatype; #IMPLIED v-ideographic %Number.datatype; #IMPLIED v-alphabetic %Number.datatype; #IMPLIED v-mathematical %Number.datatype; #IMPLIED v-hanging %Number.datatype; #IMPLIED underline-position %Number.datatype; #IMPLIED underline-thickness %Number.datatype; #IMPLIED strikethrough-position %Number.datatype; #IMPLIED strikethrough-thickness %Number.datatype; #IMPLIED overline-position %Number.datatype; #IMPLIED overline-thickness %Number.datatype; #IMPLIED >
Attribute definitions:
The following elements and attributes 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.)
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 [URI]). 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).
<!ENTITY % SVG.font-face-src.extra.content "" > <!ENTITY % SVG.CSS 2 specification ([CSS2], sections 15.3.1 and 15.3.5.)
The 'font-face-src
.element "INCLUDE" > <![%SVG.' element, together with the 'font-face-
src.element;[ <!ENTITY % SVG.uri' and 'font-face-
src.content "( %SVG.font-face-uri.qname; | %SVG.font-face-name.qname; %SVG.font-face-src.extra.content; )+" > <!ELEMENT %SVG.font-face-src.qname; %SVG.font-face-src.\ content; > <!-- end of SVG.font-face-src.element -->]]> <!ENTITY % SVG.font-face-src.attlist "INCLUDE" > <![%SVG.font-face-src.attlist;[ <!ATTLIST %SVG.font-face-src.qname; %SVG.Core.attrib; > <!-- end of SVG.font-face-src.attlist -->]]> <!-- font-face-uri: Font Face URI Element .............. --> <!ENTITY % SVG.font-face-uri.extra.content "" > <!ENTITY % SVG.font-face-uri.element "INCLUDE" > <![%SVG.font-face-uri.element;[ <!ENTITY % SVG.font-face-uri.content "( %SVG.font-face-format.qname; %SVG.font-fac\ e-uri.extra.content; )*" > <!ELEMENT %SVG.font-face-uri.qname; %SVG.font-face-uri.\ content; > <!-- end of SVG.font-face-uri.element -->]]> <!ENTITY % SVG.font-face-uri.attlist "INCLUDE" > <![%SVG.font-face-uri.attlist;[ <!ATTLIST %SVG.font-face-uri.qname; %SVG.Core.attrib; %SVG.XLinkRequired.attrib; > <!-- end of SVG.font-face-uri.attlist -->]]> <!-- font-face-format: Font Face Format Element ........ --> <!ENTITY % SVG.font-face-format.element "INCLUDE" > <![%SVG.font-face-format.element;[ <!ENTITY % SVG.font-face-format.content "EMPTY" > <!ELEMENT %SVG.font-face-format.qname; %SVG.font-fac\ e-format.content; > <!-- end of SVG.font-face-format.element -->]]> <!ENTITY % SVG.font-face-format.attlist "INCLUDE" > <![%SVG.font-face-format.attlist;[ <!ATTLIST %SVG.font-face-format.qname; %SVG.Core.attrib; string CDATA #IMPLIED > <!-- end of SVG.font-face-format.attlist -->]]> <!-- font-face-name: Font Face Name Element ............ --> <!ENTITY % SVG.font-face-name.element "INCLUDE" > <![%SVG.font-face-name.element;[ <!ENTITY % SVG.font-face-name.content "EMPTY" > <!ELEMENT %SVG.font-face-name.qname; %SVG.font-face-na\ me.content; > <!-- end of SVG.font-face-name.element -->]]> <!ENTITY % SVG.font-face-name.attlist "INCLUDE" > <![%SVG.font-face-name.attlist;[ <!ATTLIST %SVG.font-face-name.qname; %SVG.Core.attrib; name CDATA #IMPLIED > <!-- end of SVG.font-face-name.attlist -->]]> gt;The 'definition-src' element corresponds to the 'definition-src' descriptor in CSS2. (Refer to description of the [ 'definition-src' descriptor] in CSS2 specification.)
<!ENTITY % SVG.definition-src.element "INCLUDE" > <![%SVG.definition-src.element;[ <!ENTITY % SVG.definition-src.content "EMPTY" > <!ELEMENT %SVG.definition-src.qname; %SVG.definition-\ src.content; > <!-- end of SVG.definition-src.element -->]]> <!ENTITY % SVG.definition-src.attlist "INCLUDE" > <![%SVG.definition-src.attlist;[ <!ATTLIST %SVG.definition-src.qname; %SVG.Core.attrib; %SVG.XLinkRequired.attrib; >
| Elements | Attributes | Content Model |
|---|---|---|
| font | Core.attrib, External.attrib, Style.attrib, Presentation.attrib, horiz-origin-x, horiz-origin-y, horiz-adv-x, vert-adv-y, vert-origin-x, vert-origin-y | (Description.class, font-face, missing-glyph, (glyph | hkern | vkern)*) |
| font-face | Core.attrib, font-family, font-style, font-variant, font-weight, font-stretch, font-size, unicode-range, units-per-em, panose-1, stemv, stemh, slope, cap-height, x-height, accent-height, ascent, descent, widths, bbox, ideographic, alphabetic, mathematical, hanging, v-ideographic, v-alphabetic, v-mathematical, v-hanging, underline-position, underline-thickness, strikethrough-position, strikethrough-thickness, overline-position, overline-thickness | (Description.class, font-face-src?, definition-src?) |
| glyph | Core.attrib, Style.attrib, Presentation.attrib, unicode, glyph-name, d, orientation, arabic-form, lang, horiz-adv-x, vert-adv-y, vert-origin-x, vert-origin-y | (Description.class | Structure.class | Shape.class | Text.class | Image.class | View.class | Conditional.class | Hyperlink.class | Style.class | Marker.class | Clip.class | Mask.class | Gradient.class | Pattern.class | ColorProfile.class | Filter.class | Cursor.class | Font.class | Animation.class)* |
| missing-glyph | Core.attrib, Style.attrib, Presentation.attrib, d, orientation, arabic-form, lang, horiz-adv-x, vert-adv-y, vert-origin-x, vert-origin-y | (Description.class | Structure.class | Shape.class | Text.class | Image.class | View.class | Conditional.class | Hyperlink.class | Style.class | Marker.class | Clip.class | Mask.class | Gradient.class | Pattern.class | ColorProfile.class | Filter.class | Cursor.class | Font.class | Animation.class)* |
| hkern | Core.attrib, g1, g2, u1, u2, k | EMPTY |
| vkern | Core.attrib, g1, g2, u1, u2, k | EMPTY |
| font-face-src | Core.attrib | (font-face-uri|font-face-name)+ |
| font-face-uri | Core.attrib, XLinkRequired.attrib | font-face-format* |
| font-face-format | Core.attrib, string | EMPTY |
| font-face-name | Core.attrib, name | EMPTY |
| defintion-src | Core.attrib, XLinkRequired.attrib | EMPTY |
The Font Module defines the Font.class content set.
| Content Set Name | Elements in Content Set |
|---|---|
| Font.class | font |
| Elements | Attributes | Content Model |
|---|---|---|
| font | Core.attrib, External.attrib, Style.attrib, Presentation.attrib, horiz-origin-x, horiz-adv-x | (Description.class, font-face, missing-glyph, (glyph | hkern)*) |
| font-face | Core.attrib, font-family, font-style, font-variant, font-weight, font-stretch, font-size, unicode-range, units-per-em, panose-1, stemv, stemh, slope, cap-height, x-height, accent-height, ascent, descent, widths, bbox, ideographic, alphabetic, mathematical, hanging, underline-position, underline-thickness, strikethrough-position, strikethrough-thickness, overline-position, overline-thickness | (Description.class, font-face-src?) |
| glyph | Core.attrib, Style.attrib, unicode, glyph-name, d, arabic-form, lang, horiz-adv-x | (Description.class) |
| missing-glyph | Core.attrib, Style.attrib, d, arabic-form, lang, horiz-adv-x | (Description.class) |
| hkern | Core.attrib, g1, g2, u1, u2, k | EMPTY |
| font-face-src | Core.attrib | (font-face-name)+ |
| font-face-name | Core.attrib, name | EMPTY |
The Basic Font Module defines the Font.class content set.
| Content Set Name | Elements in Content Set |
|---|---|
| Font.class | font |
The following interfaces are defined below: SVGFontElement, SVGGlyphElement, SVGMissingGlyphElement, SVGHKernElement, SVGVKernElement, SVGFontFaceElement, SVGFontFaceSrcElement, SVGFontFaceUriElement, SVGFontFaceFormatElement, SVGFontFaceNameElement, SVGDefinitionSrcElement.
format' elements described in the following sections, correspond to the 'src' descriptor within an @font-face rule. (Refer to the descriptions of the @font-face rule and 'src' descriptor in the CSS 2 specification ([CSS2], sections 15.3.1 and 15.3.5).
A 'font-face-src' element contains 'font-face-uri' and 'font-face-name' elements, which are used for reference external and local fonts, respectively.
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 [RFC2396]. 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).
Attribute definitions:
The 'font-face-format' element is used within a 'font-face-uri' element to specify the supported formats of the font referenced by that 'font-face-uri' element. It corresponds to a format(…) clause of the 'src' descriptor in an @font-face rule.
Attribute definitions:
The 'font-face-name' element is used within a 'font-face-src' element to reference a local font by name. It corresponds to a local(…) clause in an @font-face rule 'src' descriptor.
Attribute definitions:
The SVGFontElement interface corresponds to the 'font' element.
Object-oriented access to the attributes of the 'font' element via the SVG DOM is not available.
IDL Definitioninterface SVGFontElement : SVGElement,SVGElement,
SVGExternalResourcesRequired,SVGExternalResourcesRequired,
SVGStylable { };
The SVGGlyphElement interface corresponds to the 'glyph' element.
Object-oriented access to the attributes of the 'glyph' element via the SVG DOM is not available.
IDL Definitioninterface SVGGlyphElement : SVGElement,SVGElement,
SVGStylable { };
The SVGMissingGlyphElement interface corresponds to the 'missing-glyph' element.
Object-oriented access to the attributes of the 'missing-glyph' element via the SVG DOM is not available.
IDL Definitioninterface SVGMissingGlyphElement : SVGElement,SVGElement,
SVGStylable { };
The SVGHKernElement interface corresponds to the 'hkern' element.
Object-oriented access to the attributes of the 'hkern' element via the SVG DOM is not available.
IDL Definitioninterface SVGHKernElement : SVGElement { };
The SVGVKernElement interface corresponds to the 'vkern' element.
Object-oriented access to the attributes of the 'vkern' element via the SVG DOM is not available.
IDL Definitioninterface SVGVKernElement : SVGElement { };
The SVGFontFaceElement interface corresponds to the 'font-face' element.
Object-oriented access to the attributes of the 'font-face' element via the SVG DOM is not available.
IDL Definitioninterface SVGFontFaceElement : SVGElement { };
The SVGFontFaceSrcElement interface corresponds to the 'font-face-src' element.
IDL DefinitionObject-oriented access to the attributes of the 'font-face-src' element via the SVG DOM is not available.
interface SVGFontFaceSrcElement : SVGElement { };
The SVGFontFaceUriElement interface corresponds to the 'font-face-uri' element.
Object-oriented access to the attributes of the 'font-face-uri' element via the SVG DOM is not available.
IDL Definitioninterface SVGFontFaceUriElement : SVGElement { };
The SVGFontFaceFormatElement interface corresponds to the 'font-face-format' element.
Object-oriented access to the attributes of the 'font-face-format' element via the SVG DOM is not available.
IDL Definitioninterface SVGFontFaceFormatElement : SVGElement { };
The SVGFontFaceNameElement interface corresponds to the 'font-face-name' element.
Object-oriented access to the attributes of the 'font-face-name' element via the SVG DOM is not available.
IDL Definitioninterface SVGFontFaceNameElement : SVGElement { };
The SVGDefinitionSrcElement interface corresponds to the 'definition-src' element.
Object-oriented access to the attributes of the 'definition-src' element via the SVG DOM is not available.
IDL Definition
interface SVGDefinitionSrcElement : SVGElement {};