Hallo Hans, hi all,

> It should not be a big problem to convert this into a startMPdrawing etc
> commands. The main job will be to interpret the style (quite messy, why not
> use key=val pairs) and transform (looks like the only xml thing about svg
> is the occasional use of <>).
;-)
I agree that SVG is rather basic and the work is in the style part :-(
This makes the .dtd short and the parsing difficult. :-(
 
> If we can agree on a reasonable subset (with a clear definition of what
> means what) i can try to implement it.
Ok. What do we need? (first brainstorming as attachment)
This SVG spec seems even worse than the MathML standard, but I think it
will be adopted rather soon by graphics programs (which in turn will
produce huge, illegible files with redundent data which hopefully at
least validates against the DTD and can be loaded in the next version of
the very same program...)

Tobias
-- 
This above all: To thine own self be true / And it must follow as
the night the day / Thou canst not then be false to any man.
Scalable Vector Graphics (SVG) -- Supported subset by ConTeXt

DRAFT [TB, Thu Dec 27 19:56:52 CET 2001]

ConTeXt can handle XML directly and using MetaPost it is also possible
to render SVG directly. The SVG is rather messy and relys havily on
non-wellstructured styles.

NOTE: Since ConTeXt's SVG is only a subset of the SVG standard
ConTeXt is _not_ a conforming SVG interpreter/"viewer" as
defined in the SVG standard.



0. Supported data types (excerpt)


0.0 %langSpaceAttr; Default attribute
http://www.w3.org/TR/SVG/struct.html#LangSpaceAttrs

Need to support xml:lang="de" etc.
Nice would be   xml:space="{default | preserve}"


0.1 length unit
http://www.w3.org/TR/SVG/coords.html#UnitIdentifiers
- Allowed units em, ex, px, pt, pc, cm, mm, in and '%'
- No unit equals 'px' (the "user unit")
- The extend of the user units are given by the ViewBox
  http://www.w3.org/TR/SVG/coords.html#ViewBoxAttribute



1. Supported elements (tags)
This list _excludes_ the style elements.


1.1 SVG <svg>
http://www.w3.org/TR/SVG/struct.html#SVGElement

The embraceing element. The <svg> may be nested.

Attributes:
- width, height (type: 0.1 length unit)
- ViewBox (no unit numbers sep. by ' ' or ',', see 0.1 length unit)


1.3 Title <title> and description <desc>
http://www.w3.org/TR/SVG/struct.html#DescElement

This may only contain text and tags from other namespaces.
Per default it should ignored. Almost element can contain those two,
but for the outermost using it optionally as caption might be useful.

1.4 Grouping <g>
http://www.w3.org/TR/SVG/struct.html#GElement

Attributes:
- transform matrix
  http://www.w3.org/TR/SVG/coords.html#TransformAttribute
  It would be nice if all attributes were supported ...


1.5 Path <path>
http://www.w3.org/TR/SVG/paths.html#PathData
Attributes:
- d path data
  rather complex
- fill
- stroke
- stroke-width

fill and stroke:
  http://www.w3.org/TR/SVG/painting.html#SpecifyingPaint
  should support: none|currentColor|<colorname>

stroke-width: <length>|inherit


1.6 some basic shapes:
http://www.w3.org/TR/SVG/shapes.html

- rectangles <rect> (rectangle, including optional rounded corners) 
- circles    <circle>
- ellipses   <ellipse>
- lines      <line> 
- polylines  <polyline>
- polygons   <polygon>

Those should be rather simple

1.7 Text <text>, <tspan>


Reply via email to