blob: 7abfb087d6464d17ce2051a9a812dce061681edb [file] [log] [blame]
default namespace = "http://www.w3.org/2000/svg"
namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
##
## SVG 1.1 Text Module
## file: svg-text.rng
##
## This is SVG, a language for describing two-dimensional graphics in XML.
## Copyright 2001, 2002 W3C (MIT, INRIA, Keio), All Rights Reserved.
##
## Modifications Copyright 2007 Mozilla Foundation
##
## $Id$
##
##
## Text
##
## text, tspan, tref, textPath, altGlyph, altGlyphDef, altGlyphItem,
## glyphRef
##
## This module declares markup to provide support for alternate glyph.
##
[ xml:lang = "en" ]
grammar {
include "svg-basic-text.rnc"
a:documentation [ "\x{a}" ~ " Datatypes\x{a}" ~ " " ]
BaselineShiftValue.datatype = xsd:string
FontSizeAdjustValue.datatype = xsd:string
GlyphOrientationHorizontalValue.datatype = xsd:string
GlyphOrientationVerticalValue.datatype = xsd:string
KerningValue.datatype = xsd:string
SpacingValue.datatype = xsd:string
TextDecorationValue.datatype = xsd:string
a:documentation [ "\x{a}" ~ " SVG.Text.attrib\x{a}" ~ " " ]
SVG.Text.extra.attrib = empty
SVG.Text.attrib &=
attribute writing-mode {
string "lr-tb" | string "rl-tb" | string "tb-rl" | string "lr" | string "rl" | string "tb" | "inherit"
}?,
SVG.Text.extra.attrib
a:documentation [
"\x{a}" ~
" SVG.TextContent.attrib\x{a}" ~
" "
]
SVG.TextContent.extra.attrib = empty
SVG.TextContent.attrib &=
attribute alignment-baseline {
string "auto"
| string "baseline"
| string "before-edge"
| string "text-before-edge"
| string "middle"
| string "central"
| string "after-edge"
| string "text-after-edge"
| string "ideographic"
| string "alphabetic"
| string "hanging"
| string "mathematical"
| string "inherit"
}?,
attribute baseline-shift { BaselineShiftValue.datatype }?,
attribute direction { string "ltr" | string "rtl" | string "inherit" }?,
attribute dominant-baseline {
string "auto"
| string "use-script"
| string "no-change"
| string "reset-size"
| string "ideographic"
| string "alphabetic"
| string "hanging"
| string "mathematical"
| string "central"
| string "middle"
| string "text-after-edge"
| string "text-before-edge"
| string "inherit"
}?,
attribute glyph-orientation-horizontal {
GlyphOrientationHorizontalValue.datatype
}?,
attribute glyph-orientation-vertical {
GlyphOrientationVerticalValue.datatype
}?,
attribute kerning { KerningValue.datatype }?,
attribute letter-spacing { SpacingValue.datatype }?,
attribute text-anchor {
string "start" | string "middle" | string "end" | string "inherit"
}?,
attribute text-decoration { TextDecorationValue.datatype }?,
attribute unicode-bidi {
string "normal" | string "embed" | string "bidi-override" | string "inherit"
}?,
attribute word-spacing { SpacingValue.datatype }?,
SVG.TextContent.extra.attrib
SVG.Font.attrib &=
attribute font-size-adjust { FontSizeAdjustValue.datatype }?,
attribute font-stretch {
string "normal"
| string "wider"
| string "narrower"
| string "ultra-condensed"
| string "extra-condensed"
| string "condensed"
| string "semi-condensed"
| string "semi-expanded"
| string "expanded"
| string "extra-expanded"
| string "ultra-expanded"
| string "inherit"
}?,
attribute font-variant { string "normal" | string "small-caps" | string "inherit" }?
##
## extend SVG.Text.class
##
SVG.Text.class |= altGlyphDef
##
## extend SVG.TextContent.class
##
SVG.TextContent.class |= tspan | tref | textPath
a:documentation [ "\x{a}" ~ " text: Text Element\x{a}" ~ " " ]
SVG.text.class |= SVG.TextContent.class
attlist.text &=
SVG.Text.attrib,
SVG.TextContent.attrib,
attribute dx { Lengths.datatype }?,
attribute dy { Lengths.datatype }?,
attribute textLength { Length.datatype }?,
attribute lengthAdjust { string "spacing" | string "spacingAndGlyphs" }?
a:documentation [
"\x{a}" ~
" tspan: Text Span Element\x{a}" ~
" "
]
SVG.tspan.content =
(text
| tspan
| tref
| altGlyph
| animate
| set
| animateColor
| SVG.Description.class
| SVG.Hyperlink.class)*
tspan = element tspan { attlist.tspan, SVG.tspan.content }
attlist.tspan &=
SVG.Core.attrib,
SVG.Conditional.attrib,
SVG.Style.attrib,
SVG.TextContent.attrib,
SVG.Font.attrib,
SVG.Paint.attrib,
SVG.Color.attrib,
SVG.Opacity.attrib,
SVG.Graphics.attrib,
SVG.Clip.attrib,
SVG.Mask.attrib,
SVG.Filter.attrib,
SVG.GraphicalEvents.attrib,
SVG.Cursor.attrib,
SVG.External.attrib,
attribute x { Coordinates.datatype }?,
attribute y { Coordinates.datatype }?,
attribute dx { Lengths.datatype }?,
attribute dy { Lengths.datatype }?,
attribute rotate { Numbers.datatype }?,
attribute textLength { Length.datatype }?,
attribute lengthAdjust { string "spacing" | string "spacingAndGlyphs" }?
a:documentation [
"\x{a}" ~
" tref: Text Reference Element\x{a}" ~
" "
]
SVG.tref.content =
(animate | set | animateColor | SVG.Description.class)*
tref = element tref { attlist.tref, SVG.tref.content }
attlist.tref &=
SVG.Core.attrib,
SVG.Conditional.attrib,
SVG.Style.attrib,
SVG.TextContent.attrib,
SVG.Font.attrib,
SVG.Paint.attrib,
SVG.Color.attrib,
SVG.Opacity.attrib,
SVG.Graphics.attrib,
SVG.Clip.attrib,
SVG.Mask.attrib,
SVG.Filter.attrib,
SVG.GraphicalEvents.attrib,
SVG.Cursor.attrib,
SVG.XLinkRequired.attrib,
SVG.External.attrib,
attribute x { Coordinates.datatype }?,
attribute y { Coordinates.datatype }?,
attribute dx { Lengths.datatype }?,
attribute dy { Lengths.datatype }?,
attribute rotate { Numbers.datatype }?,
attribute textLength { Length.datatype }?,
attribute lengthAdjust { string "spacing" | string "spacingAndGlyphs" }?
a:documentation [
"\x{a}" ~
" textPath: Text Path Element\x{a}" ~
" "
]
SVG.textPath.content =
(text
| tspan
| tref
| altGlyph
| animate
| set
| animateColor
| SVG.Description.class
| SVG.Hyperlink.class)*
textPath =
element textPath { attlist.textPath, SVG.textPath.content }
attlist.textPath &=
SVG.Core.attrib,
SVG.Conditional.attrib,
SVG.Style.attrib,
SVG.TextContent.attrib,
SVG.Font.attrib,
SVG.Paint.attrib,
SVG.Color.attrib,
SVG.Opacity.attrib,
SVG.Graphics.attrib,
SVG.Clip.attrib,
SVG.Mask.attrib,
SVG.Filter.attrib,
SVG.GraphicalEvents.attrib,
SVG.Cursor.attrib,
SVG.XLinkRequired.attrib,
SVG.External.attrib,
attribute startOffset { Length.datatype }?,
attribute textLength { Length.datatype }?,
attribute lengthAdjust { string "spacing" | string "spacingAndGlyphs" }?,
attribute method { string "align" | string "stretch" }?,
attribute spacing { string "auto" | string "exact" }?
a:documentation [
"\x{a}" ~
" altGlyph: Alternate Glyph Element\x{a}" ~
" "
]
attlist.altGlyph &=
SVG.TextContent.attrib,
attribute x { Coordinates.datatype }?,
attribute y { Coordinates.datatype }?,
attribute dx { Lengths.datatype }?,
attribute dy { Lengths.datatype }?,
attribute rotate { Numbers.datatype }?
a:documentation [
"\x{a}" ~
" altGlyphDef: Alternate Glyph Definition Element\x{a}" ~
" "
]
SVG.altGlyphDef.content |= altGlyphItem+
a:documentation [
"\x{a}" ~
" altGlyphItem: Alternate Glyph Item Element\x{a}" ~
" "
]
SVG.altGlyphItem.content = glyphRef+
altGlyphItem =
element altGlyphItem {
attlist.altGlyphItem, SVG.altGlyphItem.content
}
attlist.altGlyphItem &= SVG.Core.attrib
a:documentation [
"\x{a}" ~
" glyphRef: Glyph Reference Element\x{a}" ~
" "
]
attlist.glyphRef &=
attribute x { Number.datatype }?,
attribute y { Number.datatype }?,
attribute dx { Number.datatype }?,
attribute dy { Number.datatype }?
}