summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/stex/schema/rnc/LaTeXML/svg-text.rnc
blob: b9d52e144209f82c62a147448b986b880933fd2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
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.
## 
##     $Id: svg-text.rng,v 1.1 2003/07/15 07:11:10 dean Exp $
##   

## 
##     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 {
      "lr-tb" | "rl-tb" | "tb-rl" | "lr" | "rl" | "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 {
      "auto"
      | "baseline"
      | "before-edge"
      | "text-before-edge"
      | "middle"
      | "central"
      | "after-edge"
      | "text-after-edge"
      | "ideographic"
      | "alphabetic"
      | "hanging"
      | "mathematical"
      | "inherit"
    }?,
    attribute baseline-shift { BaselineShiftValue.datatype }?,
    attribute direction { "ltr" | "rtl" | "inherit" }?,
    attribute dominant-baseline {
      "auto"
      | "use-script"
      | "no-change"
      | "reset-size"
      | "ideographic"
      | "alphabetic"
      | "hanging"
      | "mathematical"
      | "central"
      | "middle"
      | "text-after-edge"
      | "text-before-edge"
      | "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 { "start" | "middle" | "end" | "inherit" }?,
    attribute text-decoration { TextDecorationValue.datatype }?,
    attribute unicode-bidi {
      "normal" | "embed" | "bidi-override" | "inherit"
    }?,
    attribute word-spacing { SpacingValue.datatype }?,
    SVG.TextContent.extra.attrib
  SVG.Font.attrib &=
    attribute font-size-adjust { FontSizeAdjustValue.datatype }?,
    attribute font-stretch {
      "normal"
      | "wider"
      | "narrower"
      | "ultra-condensed"
      | "extra-condensed"
      | "condensed"
      | "semi-condensed"
      | "semi-expanded"
      | "expanded"
      | "extra-expanded"
      | "ultra-expanded"
      | "inherit"
    }?,
    attribute font-variant { "normal" | "small-caps" | "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 { "spacing" | "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 { "spacing" | "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 { "spacing" | "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 { "spacing" | "spacingAndGlyphs" }?,
    attribute method { "align" | "stretch" }?,
    attribute spacing { "auto" | "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 }?
}