svg.go 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646
  1. package svg
  2. import "time"
  3. import "encoding/xml"
  4. type ID string
  5. type Chardata string
  6. type D string
  7. type Version string
  8. type Docbase string
  9. type Xmlns string
  10. type Cc string
  11. type Dc string
  12. type Inkscape string
  13. type Rdf string
  14. type Docname string
  15. type Sodipodi string
  16. type GString string
  17. type Space string
  18. type Box string
  19. type Xlink string
  20. type L string
  21. type Filename string
  22. type Xdpi string
  23. type Ydpi string
  24. type Background string
  25. type Bounds string
  26. type Origin string
  27. type Overflow string
  28. type A string
  29. type Graph string
  30. type I string
  31. type Rule string
  32. type Rendering string
  33. type Ratio string
  34. type Fill string
  35. type Linecap string
  36. type Linejoin string
  37. type Ns string
  38. type Ns0 string
  39. type Xap string
  40. type Img string
  41. type Pdf string
  42. type Pdfx string
  43. type Pdfy string
  44. type Author string
  45. type Text string
  46. type About string
  47. type Title string
  48. type Description string
  49. type Date time.Time
  50. type Resource string
  51. type Language string
  52. type Collect string
  53. type Transform string
  54. type Units string
  55. type Href string
  56. type Method string
  57. type Format string
  58. type Offset string
  59. type Stockid string
  60. type Nodetypes string
  61. type Type string
  62. type Orient string
  63. type Fx = float32
  64. type Fy = float32
  65. type Rx = float32
  66. type Ry = float32
  67. type R = float32
  68. type R1 = float32
  69. type R2 = float32
  70. type W = float32
  71. type H = float32
  72. type Cx = float32
  73. type Cy = float32
  74. type Stroke string
  75. type Variant string
  76. type Weight string
  77. type Name string
  78. type Family string
  79. type Unicode string
  80. type Layer string
  81. type Pageshadow string
  82. type Zoom string
  83. type Bbox string
  84. type Showgrid string
  85. type Showguides string
  86. type Guidetolerance string
  87. type Points string
  88. type Gridspacingx float32
  89. type Gridspacingy float32
  90. type Gridtolerance string
  91. type Gridcolor = Color
  92. type Gridopacity = Opacity
  93. type Gridoriginx = float32
  94. type Gridoriginy = float32
  95. type Gridhicolor = Color
  96. type Gridempcolor = Color
  97. type Gridempopacity = Opacity
  98. type Gridempspacing string
  99. type Guidecolor = Color
  100. type Guidehicolor = Color
  101. type Guidehiopacity = Opacity
  102. type Guideopacity = Opacity
  103. type Snaptogrid string
  104. type Showborder string
  105. type Snaptoguides string
  106. type Borderlayer string
  107. type Bordercolor = Color
  108. type Borderopacity = Opacity
  109. type Pagecolor = Color
  110. type Pageopacity = Opacity
  111. type Groupmode string
  112. type Label string
  113. type Insensitive string
  114. type Percent string
  115. type Knockout string
  116. type Trio string
  117. type Display string
  118. type Visible string
  119. type Visibility string
  120. type Cmyk string
  121. type PathString string
  122. type Flatsided string
  123. type Rounded string
  124. type Arg1 string
  125. type Arg2 string
  126. type Sides string
  127. type Randomized string
  128. type Size string // XXX
  129. type Anchor string
  130. type Linespacing = Spacing
  131. type Role string
  132. type S string
  133. type Extensions string
  134. type Align string
  135. type Valign string
  136. type Spacing string
  137. type Desc string
  138. type Class string
  139. type Original string
  140. type Radius = float32
  141. type Miterlimit string
  142. type End string
  143. type Open string
  144. type Start string
  145. type Argument string
  146. type Extension string
  147. type Revolution string
  148. type T0 = float32
  149. type Isolated string
  150. type Absref string
  151. type Of string
  152. type Expansion string
  153. type Extraneous string
  154. type Matrix string
  155. type Span string
  156. type Orientation string // XXX
  157. type Position string // XXX
  158. type Color string // XXX
  159. type Opacity string // XXX
  160. type G struct {
  161. Text Text `xml:",chardata"`
  162. ID ID `xml:"id,attr"`
  163. Use []Use `xml:"use"`
  164. Chardata Chardata `xml:",chardata"`
  165. Transform Transform `xml:"transform,attr"`
  166. Groupmode Groupmode `xml:"groupmode,attr"`
  167. Label Label `xml:"label,attr"`
  168. Insensitive Insensitive `xml:"insensitive,attr"`
  169. Style Style `xml:"style,attr"`
  170. DimmedPercent Percent `xml:"dimmedPercent,attr"`
  171. Knockout Knockout `xml:"knockout,attr"`
  172. Layer Layer `xml:"layer,attr"`
  173. RgbTrio Trio `xml:"rgbTrio,attr"`
  174. Display Display `xml:"display,attr"`
  175. Visible Visible `xml:"visible,attr"`
  176. Visibility Visibility `xml:"visibility,attr"`
  177. Fill Fill `xml:"fill,attr"`
  178. Stroke Stroke `xml:"stroke,attr"`
  179. StrokeWidth float32 `xml:"stroke-width,attr"`
  180. ExportFilename Filename `xml:"export-filename,attr"`
  181. ExportXdpi Xdpi `xml:"export-xdpi,attr"`
  182. ExportYdpi Ydpi `xml:"export-ydpi,attr"`
  183. StrokeLinecap Linecap `xml:"stroke-linecap,attr"`
  184. Rect []Rect `xml:"rect"`
  185. G []G `xml:"g"`
  186. Defs []Defs `xml:"defs"`
  187. ClipPath `xml:"clipPath"`
  188. Polygon []Polygon `xml:"polygon"`
  189. // removed A
  190. }
  191. type Stop struct {
  192. Text Text `xml:",chardata"`
  193. ID D `xml:"id,attr"`
  194. Offset Offset `xml:"offset,attr"`
  195. Style Style `xml:"style,attr"`
  196. }
  197. type LinearGradient struct {
  198. Text Text `xml:",chardata"`
  199. ID ID `xml:"id,attr"`
  200. Collect Collect `xml:"collect,attr"`
  201. GradientTransform Transform `xml:"gradientTransform,attr"`
  202. GradientUnits Units `xml:"gradientUnits,attr"`
  203. X1 float32 `xml:"x1,attr"`
  204. X2 float32 `xml:"x2,attr"`
  205. Href Href `xml:"href,attr"`
  206. Y1 float32 `xml:"y1,attr"`
  207. Y2 float32 `xml:"y2,attr"`
  208. SpreadMethod Method `xml:"spreadMethod,attr"`
  209. Stop []Stop `xml:"stop"`
  210. }
  211. type StyleSheet struct {
  212. Text Text `xml:",chardata"` // .str0 {stroke:#1F1A17;str...
  213. ID ID `xml:"id,attr"`
  214. Type Type `xml:"type,attr"`
  215. }
  216. type Rect struct {
  217. Text Text `xml:",chardata"`
  218. Fill Fill `xml:"fill,attr"`
  219. Height float32 `xml:"height,attr"`
  220. ID D `xml:"id,attr"`
  221. Stroke Stroke `xml:"stroke,attr"`
  222. Width float32 `xml:"width,attr"`
  223. X float32 `xml:"x,attr"`
  224. Y float32 `xml:"y,attr"`
  225. }
  226. type Mask struct {
  227. Text Text `xml:",chardata"`
  228. ID ID `xml:"id,attr"`
  229. LinearGradient LinearGradient `xml:"linearGradient"`
  230. Rect Rect `xml:"rect"`
  231. }
  232. type Path struct {
  233. Text Text `xml:",chardata"`
  234. D D `xml:"d,attr"`
  235. ID ID `xml:"id,attr"`
  236. Nodetypes Nodetypes `xml:"nodetypes,attr"`
  237. Style Style `xml:"style,attr"`
  238. Fill Fill `xml:"fill,attr"`
  239. Transform Transform `xml:"transform,attr"`
  240. Class Class `xml:"class,attr"`
  241. Cx Cx `xml:"cx,attr"`
  242. Cy Cy `xml:"cy,attr"`
  243. Rx Rx `xml:"rx,attr"`
  244. Ry Ry `xml:"ry,attr"`
  245. Type Type `xml:"type,attr"`
  246. Knockout Knockout `xml:"knockout,attr"`
  247. TileCx Cx `xml:"tile-cx,attr"`
  248. TileCy Cy `xml:"tile-cy,attr"`
  249. TileH H `xml:"tile-h,attr"`
  250. TileW W `xml:"tile-w,attr"`
  251. ClipRule Rule `xml:"clip-rule,attr"`
  252. FillRule Rule `xml:"fill-rule,attr"`
  253. Stroke Stroke `xml:"stroke,attr"`
  254. StrokeWidth float32 `xml:"stroke-width,attr"`
  255. EnableBackground Background `xml:"enable-background,attr"`
  256. Isolated Isolated `xml:"isolated,attr"`
  257. Opacity Opacity `xml:"opacity,attr"`
  258. ExportXdpi Xdpi `xml:"export-xdpi,attr"`
  259. ExportYdpi Ydpi `xml:"export-ydpi,attr"`
  260. End End `xml:"end,attr"`
  261. Open Open `xml:"open,attr"`
  262. Start Start `xml:"start,attr"`
  263. StrokeMiterlimit Miterlimit `xml:"stroke-miterlimit,attr"`
  264. Flatsided Flatsided `xml:"flatsided,attr"`
  265. Label Label `xml:"label,attr"`
  266. Randomized Randomized `xml:"randomized,attr"`
  267. Rounded Rounded `xml:"rounded,attr"`
  268. Arg1 Arg1 `xml:"arg1,attr"`
  269. Arg2 Arg2 `xml:"arg2,attr"`
  270. R1 R1 `xml:"r1,attr"`
  271. R2 R2 `xml:"r2,attr"`
  272. Sides Sides `xml:"sides,attr"`
  273. FillCmyk Cmyk `xml:"fill-cmyk,attr"`
  274. }
  275. type Marker struct {
  276. Text Text `xml:",chardata"`
  277. ID ID `xml:"id,attr"`
  278. MarkerHeight float32 `xml:"markerHeight,attr"`
  279. MarkerUnits Units `xml:"markerUnits,attr"`
  280. MarkerWidth float32 `xml:"markerWidth,attr"`
  281. Orient Orient `xml:"orient,attr"`
  282. RefX float32 `xml:"refX,attr"`
  283. RefY float32 `xml:"refY,attr"`
  284. ViewBox Box `xml:"viewBox,attr"`
  285. Stockid Stockid `xml:"stockid,attr"`
  286. Style Style `xml:"style,attr"`
  287. Path Path `xml:"path"`
  288. }
  289. type RadialGradient struct {
  290. Text Text `xml:",chardata"`
  291. ID ID `xml:"id,attr"`
  292. Href Href `xml:"href,attr"`
  293. Cx Cx `xml:"cx,attr"`
  294. Cy Cy `xml:"cy,attr"`
  295. Fx Fx `xml:"fx,attr"`
  296. Fy Fy `xml:"fy,attr"`
  297. R R `xml:"r,attr"`
  298. GradientTransform Transform `xml:"gradientTransform,attr"`
  299. GradientUnits Units `xml:"gradientUnits,attr"`
  300. Collect Collect `xml:"collect,attr"`
  301. SpreadMethod Method `xml:"spreadMethod,attr"`
  302. Stop []Stop `xml:"stop"`
  303. }
  304. type Use struct {
  305. Text Text `xml:",chardata"`
  306. ID ID `xml:"id,attr"`
  307. Href Href `xml:"href,attr"`
  308. X float32 `xml:"x,attr"`
  309. Y float32 `xml:"y,attr"`
  310. Height float32 `xml:"height,attr"`
  311. Width float32 `xml:"width,attr"`
  312. Transform Transform `xml:"transform,attr"`
  313. }
  314. type ClipPath struct {
  315. Text Text `xml:",chardata"`
  316. ID ID `xml:"id,attr"`
  317. Path Path `xml:"path"`
  318. }
  319. type Named struct {
  320. Text Text `xml:",chardata"`
  321. ID ID `xml:"id,attr"`
  322. }
  323. type FontFace struct {
  324. Text Text `xml:",chardata"`
  325. FontFamily Family `xml:"font-family,attr"`
  326. ID ID `xml:"id,attr"`
  327. }
  328. type MissingGlyph struct {
  329. Text Text `xml:",chardata"`
  330. ID ID `xml:"id,attr"`
  331. Path Path `xml:"path"`
  332. }
  333. type Glyph struct {
  334. Text Text `xml:",chardata"`
  335. HorizAdvX float32 `xml:"horiz-adv-x,attr"`
  336. ID ID `xml:"id,attr"`
  337. Unicode Unicode `xml:"unicode,attr"`
  338. Path Path `xml:"path"`
  339. }
  340. type Font struct {
  341. Text Text `xml:",chardata"`
  342. FontVariant Variant `xml:"fontVariant,attr"`
  343. FontWeight Weight `xml:"fontWeight,attr"`
  344. FullFontName Name `xml:"fullFontName,attr"`
  345. ID ID `xml:"id,attr"`
  346. FontFace FontFace `xml:"font-face"`
  347. MissingGlyph MissingGlyph `xml:"missing-glyph"`
  348. Glyph []Glyph `xml:"glyph"`
  349. }
  350. type ForeignObject struct {
  351. Text Text `xml:",chardata"`
  352. Height float32 `xml:"height,attr"`
  353. Overflow Overflow `xml:"overflow,attr"`
  354. RequiredExtensions Extensions `xml:"requiredExtensions,attr"`
  355. Width float32 `xml:"width,attr"`
  356. X float32 `xml:"x,attr"`
  357. Y float32 `xml:"y,attr"`
  358. FlowDef struct {
  359. Text Text `xml:",chardata"`
  360. Xmlns Xmlns `xml:"xmlns,attr"`
  361. Region struct {
  362. Text Text `xml:",chardata"`
  363. Path struct {
  364. Text Text `xml:",chardata"`
  365. D D `xml:"d,attr"`
  366. } `xml:"path"`
  367. } `xml:"region"`
  368. Flow struct {
  369. Text Text `xml:",chardata"`
  370. FontFamily Family `xml:"font-family,attr"`
  371. FontSize Size `xml:"font-size,attr"`
  372. Xmlns Xmlns `xml:"xmlns,attr"`
  373. P struct {
  374. Text Text `xml:",chardata"`
  375. Span Span `xml:"span"` // 9, 12, 6, 3, 9, 12, 6, 3
  376. } `xml:"p"`
  377. } `xml:"flow"`
  378. } `xml:"flowDef"`
  379. TargetRef struct {
  380. Text Text `xml:",chardata"`
  381. Href Href `xml:"href,attr"`
  382. } `xml:"targetRef"`
  383. PgfRef struct {
  384. Text Text `xml:",chardata"`
  385. Href Href `xml:"href,attr"`
  386. ID D `xml:"id,attr"`
  387. } `xml:"pgfRef"`
  388. }
  389. type Defs struct {
  390. Text Text `xml:",chardata"`
  391. ID ID `xml:"id,attr"`
  392. LinearGradient []LinearGradient `xml:"linearGradient"`
  393. Style StyleSheet `xml:"style"`
  394. Mask []Mask `xml:"mask"`
  395. Marker []Marker `xml:"marker"`
  396. RadialGradient []RadialGradient `xml:"radialGradient"`
  397. Rect []Rect `xml:"rect"`
  398. G []G `xml:"g"`
  399. ClipPath []ClipPath `xml:"clipPath"`
  400. Defs []Defs `xml:"defs"`
  401. Path []Path `xml:"path"`
  402. Namedview []NamedView `xml:"namedview"`
  403. Font []Font `xml:"font"`
  404. }
  405. type NamedView struct {
  406. Text Text `xml:",chardata"`
  407. Bordercolor Bordercolor `xml:"bordercolor,attr"`
  408. Borderopacity Borderopacity `xml:"borderopacity,attr"`
  409. ID D `xml:"id,attr"`
  410. CurrentLayer Layer `xml:"current-layer,attr"`
  411. Cx Cx `xml:"cx,attr"`
  412. Cy Cy `xml:"cy,attr"`
  413. Pageopacity Pageopacity `xml:"pageopacity,attr"`
  414. Pageshadow Pageshadow `xml:"pageshadow,attr"`
  415. WindowHeight float32 `xml:"window-height,attr"`
  416. WindowWidth float32 `xml:"window-width,attr"`
  417. WindowX float32 `xml:"window-x,attr"`
  418. WindowY float32 `xml:"window-y,attr"`
  419. Zoom Zoom `xml:"zoom,attr"`
  420. Pagecolor Pagecolor `xml:"pagecolor,attr"`
  421. DocumentUnits Units `xml:"document-units,attr"`
  422. GridBbox Bbox `xml:"grid-bbox,attr"`
  423. GuideBbox Bbox `xml:"guide-bbox,attr"`
  424. Showgrid Showgrid `xml:"showgrid,attr"`
  425. Showguides Showguides `xml:"showguides,attr"`
  426. Guidetolerance Guidetolerance `xml:"guidetolerance,attr"`
  427. GuidePoints Points `xml:"guide-points,attr"`
  428. Gridspacingx Gridspacingx `xml:"gridspacingx,attr"`
  429. Gridspacingy Gridspacingy `xml:"gridspacingy,attr"`
  430. Gridtolerance Gridtolerance `xml:"gridtolerance,attr"`
  431. GridPoints Points `xml:"grid-points,attr"`
  432. Gridcolor Gridcolor `xml:"gridcolor,attr"`
  433. Gridopacity Gridopacity `xml:"gridopacity,attr"`
  434. Gridoriginx Gridoriginx `xml:"gridoriginx,attr"`
  435. Gridoriginy Gridoriginy `xml:"gridoriginy,attr"`
  436. Guidecolor Guidecolor `xml:"guidecolor,attr"`
  437. Guidehicolor Guidehicolor `xml:"guidehicolor,attr"`
  438. Guidehiopacity Guidehiopacity `xml:"guidehiopacity,attr"`
  439. Guideopacity Guideopacity `xml:"guideopacity,attr"`
  440. Snaptogrid Snaptogrid `xml:"snaptogrid,attr"`
  441. Fill Fill `xml:"fill,attr"`
  442. Gridhicolor Gridhicolor `xml:"gridhicolor,attr"`
  443. Showborder Showborder `xml:"showborder,attr"`
  444. Snaptoguides Snaptoguides `xml:"snaptoguides,attr"`
  445. Borderlayer Borderlayer `xml:"borderlayer,attr"`
  446. Gridempcolor Gridempcolor `xml:"gridempcolor,attr"`
  447. Gridempopacity Gridempopacity `xml:"gridempopacity,attr"`
  448. Gridempspacing Gridempspacing `xml:"gridempspacing,attr"`
  449. Guide []struct {
  450. Text Text `xml:",chardata"`
  451. ID D `xml:"id,attr"`
  452. Orientation Orientation `xml:"orientation,attr"`
  453. Position Position `xml:"position,attr"`
  454. } `xml:"guide"`
  455. }
  456. type SVG struct {
  457. XMLName xml.Name `xml:"Svg"`
  458. Chardata Chardata `xml:",chardata"`
  459. Height float32 `xml:"height,attr"`
  460. ID D `xml:"id,attr"`
  461. Version Version `xml:"version,attr"`
  462. Docbase Docbase `xml:"docbase,attr"`
  463. Docname Docname `xml:"docname,attr"`
  464. Width float32 `xml:"width,attr"`
  465. Xmlns Xmlns `xml:"xmlns,attr"`
  466. Cc Cc `xml:"cc,attr"`
  467. Dc Dc `xml:"dc,attr"`
  468. Inkscape Inkscape `xml:"inkscape,attr"`
  469. Rdf Rdf `xml:"rdf,attr"`
  470. Sodipodi Sodipodi `xml:"sodipodi,attr"`
  471. SVG G `xml:"svg,attr"`
  472. Space Space `xml:"space,attr"`
  473. AttrStyle Style `xml:"style,attr"`
  474. ViewBox Box `xml:"viewBox,attr"`
  475. Xlink Xlink `xml:"xlink,attr"`
  476. XML L `xml:"xml,attr"`
  477. X float32 `xml:"x,attr"`
  478. Y float32 `xml:"y,attr"`
  479. ExportFilename Filename `xml:"export-filename,attr"`
  480. ExportXdpi Xdpi `xml:"export-xdpi,attr"`
  481. ExportYdpi Ydpi `xml:"export-ydpi,attr"`
  482. EnableBackground Background `xml:"enable-background,attr"`
  483. PageBounds Bounds `xml:"pageBounds,attr"`
  484. RulerOrigin Origin `xml:"rulerOrigin,attr"`
  485. ViewOrigin Origin `xml:"viewOrigin,attr"`
  486. Overflow Overflow `xml:"overflow,attr"`
  487. A A `xml:"a,attr"`
  488. Graph Graph `xml:"graph,attr"`
  489. I I `xml:"i,attr"`
  490. FillRule Rule `xml:"fill-rule,attr"`
  491. ImageRendering Rendering `xml:"image-rendering,attr"`
  492. ShapeRendering Rendering `xml:"shape-rendering,attr"`
  493. TextRendering Rendering `xml:"text-rendering,attr"`
  494. PreserveAspectRatio Ratio `xml:"preserveAspectRatio,attr"`
  495. Fill Fill `xml:"fill,attr"`
  496. StrokeLinecap Linecap `xml:"stroke-linecap,attr"`
  497. StrokeLinejoin Linejoin `xml:"stroke-linejoin,attr"`
  498. StrokeWidth float32 `xml:"stroke-width,attr"`
  499. Ns Ns `xml:"ns,attr"`
  500. Ns0 Ns0 `xml:"ns0,attr"`
  501. Xap Xap `xml:"xap,attr"`
  502. XapGImg Img `xml:"xapGImg,attr"`
  503. Pdf Pdf `xml:"pdf,attr"`
  504. Pdfx Pdfx `xml:"pdfx,attr"`
  505. Author Author `xml:"author,attr"`
  506. Metadata interface{} `xml:"metadata"`
  507. Defs Defs `xml:"defs"`
  508. // Inkscape-specific
  509. Namedview NamedView `xml:"namedview"`
  510. G G `xml:"g"`
  511. Path []Path `xml:"path"`
  512. Circle []Circle `xml:"circle"`
  513. Text []Text `xml:"text"`
  514. Style StyleSheet `xml:"style"`
  515. Switch Switch `xml:"switch"`
  516. RadialGradient []RadialGradient `xml:"radialGradient"`
  517. Use []Use `xml:"use"`
  518. Image []Image `xml:"image"`
  519. Polygon []Polygon `xml:"polygon"`
  520. Ellipse []Ellipse `xml:"ellipse"`
  521. RDF interface{} `xml:"RDF"`
  522. }
  523. type TextDrawing struct {
  524. Text Text `xml:",chardata"` // PACE, Moscow, Stockholm, ...
  525. ID D `xml:"id,attr"`
  526. Style Style `xml:"style,attr"`
  527. X float32 `xml:"x,attr"`
  528. Space Space `xml:"space,attr"`
  529. Y float32 `xml:"y,attr"`
  530. Linespacing Linespacing `xml:"linespacing,attr"`
  531. Transform Transform `xml:"transform,attr"`
  532. Fill Fill `xml:"fill,attr"`
  533. FontFamily Family `xml:"font-family,attr"`
  534. FontSize Size `xml:"font-size,attr"`
  535. FontWeight Weight `xml:"font-weight,attr"`
  536. TextAnchor Anchor `xml:"text-anchor,attr"`
  537. Class Class `xml:"class,attr"`
  538. Tspan []struct {
  539. Text Text `xml:",chardata"` // FOR SALE, 858-361-2811, $...
  540. ID D `xml:"id,attr"`
  541. Role Role `xml:"role,attr"`
  542. X float32 `xml:"x,attr"`
  543. Y float32 `xml:"y,attr"`
  544. Style Style `xml:"style,attr"`
  545. } `xml:"tspan"`
  546. }
  547. type Switch struct {
  548. Text Text `xml:",chardata"`
  549. ID D `xml:"id,attr"`
  550. ForeignObject ForeignObject `xml:"foreignObject"`
  551. G G `xml:"g"`
  552. }
  553. type Circle []struct {
  554. Text Text `xml:",chardata"`
  555. Cx Cx `xml:"cx,attr"`
  556. Cy Cy `xml:"cy,attr"`
  557. Fill Fill `xml:"fill,attr"`
  558. ID D `xml:"id,attr"`
  559. R R `xml:"r,attr"`
  560. Class Class `xml:"class,attr"`
  561. Rx Rx `xml:"rx,attr"`
  562. Ry Ry `xml:"ry,attr"`
  563. Style Style `xml:"style,attr"`
  564. }
  565. type Ellipse struct {
  566. Text Text `xml:",chardata"`
  567. ID ID `xml:"id,attr"`
  568. Cx Cx `xml:"cx,attr"`
  569. Cy Cy `xml:"cy,attr"`
  570. Rx Rx `xml:"rx,attr"`
  571. Ry Ry `xml:"ry,attr"`
  572. Style Style `xml:"style,attr"`
  573. Stroke Stroke `xml:"stroke,attr"`
  574. StrokeWidth float32 `xml:"stroke-width,attr"`
  575. Transform Transform `xml:"transform,attr"`
  576. }
  577. type Polygon struct {
  578. Text Text `xml:",chardata"`
  579. ID ID `xml:"id,attr"`
  580. Points Points `xml:"points,attr"`
  581. Arg1 Arg1 `xml:"arg1,attr"`
  582. Arg2 Arg2 `xml:"arg2,attr"`
  583. Cx Cx `xml:"cx,attr"`
  584. Cy Cy `xml:"cy,attr"`
  585. R1 R1 `xml:"r1,attr"`
  586. R2 R2 `xml:"r2,attr"`
  587. Sides Sides `xml:"sides,attr"`
  588. Type Type `xml:"type,attr"`
  589. Style Style `xml:"style,attr"`
  590. Transform Transform `xml:"transform,attr"`
  591. Fill Fill `xml:"fill,attr"`
  592. FillCmyk Cmyk `xml:"fill-cmyk,attr"`
  593. }
  594. type Image struct {
  595. Text Text `xml:",chardata"`
  596. ID ID `xml:"id,attr"`
  597. Points Points `xml:"points,attr"`
  598. Arg1 Arg1 `xml:"arg1,attr"`
  599. Arg2 Arg2 `xml:"arg2,attr"`
  600. Cx Cx `xml:"cx,attr"`
  601. Cy Cy `xml:"cy,attr"`
  602. R1 R1 `xml:"r1,attr"`
  603. R2 R2 `xml:"r2,attr"`
  604. Sides Sides `xml:"sides,attr"`
  605. Type Type `xml:"type,attr"`
  606. Style Style `xml:"style,attr"`
  607. Transform Transform `xml:"transform,attr"`
  608. Fill Fill `xml:"fill,attr"`
  609. FillCmyk Cmyk `xml:"fill-cmyk,attr"`
  610. }