ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* SVG with ConTeXt
@ 2001-12-22 19:29 Tobias Burnus
  2001-12-24 11:20 ` Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: Tobias Burnus @ 2001-12-22 19:29 UTC (permalink / raw)


Hi,

I'd like to typeset some small XMLs which contains some simple SVGs.

Such as
<?xml version="1.0"?>
<svg xmlns="http://www.w3.org/2000/svg">
  <g style="stroke:black; stroke-width:0.1cm;">
     <circle cx="6cm" cy="2cm" r="100" style="fill:red;" 
             transform="translate(0,50)" />
     <circle cx="6cm" cy="2cm" r="100" style="fill:blue;"  
             transform="translate(70,150)" />
     <circle cx="6cm" cy="2cm" r="100" style="fill:green;" 
             transform="translate(-70,150)"/> 
  </g>
</svg> 

I could use XSLT but this makes it difficult to combine with direct
processing of the rest of the file in ConTeXt.

  * * *

MERRY CHRISTMAS AND A HAPPY NEW YEAR TO ALL
  FROHE WEIHNACHTEN UND EINEN GUTEN RUTSCH
     PRETTIGE KERSTDAGEN EN GELUKKLIG NIEUWJAAR
       BUON NATALE E FELICE ANNO NUOVO

>From / von / van / da

Tobias

  * * 
*

X-Mas cards:

http://www.eddyweb.net/kerstweb/leukekerstkaarten/leukekerstkaarten.htm
And Christmas wishes:
  http://members.aol.com/hjbomanns/XMas/fr_main.htm
Australia
   Gupok vee rowa!
Belgium
   Zalig Kerstfeest!
Brazil
   Feliz Natal e prospero Ano Novo!
Bulgaria
   Mirena Koleda i Shstastliva Nova Godina!
Bohemian/Czech
   Vesley Vonace!
Denmark
   Glaedelig Jul og Godt Nytar!
Estland
   Roomsaid Joule ja Head Uut Aastat!
Finland
   Hyvaa Joulua ja Onnellista Uutta Vuotta!
Iceland
   Gleðileg jól og gott farsælt komandi ár!
Lappland
   Buriid Juovillaid ja Lihkolas Odda Jagi!
Lithuanian
   Linksmu Kaledu! (Happy Holidays!)
France
   Joyeux Noel et Bonne Nouvelle Annee!
English
   Merry Christmas and a Happy New Year!
Espania
   Feliz Navidad y Prospero Ano Nuevo!
Germany
   Frohe Weihnachten und ein guten Rutsch ins Neues Jahr!
Greek
   Kala Christouyenna!
Hawaii
   Mele Kalikimaka!
Hungaria
   Kellemes Karacsonyi Unnepeket es Boldog Ujevet!
Indonesia
   Selamat Hari Natal dan Tahun Baru!
Irish
   Sonas Nollaig Dhuit / Beannachti Na Nollaig!
Italia
   Buon Natale e Felice Anno Nuovo!
Japan
   Merii Kurisumas sosite sin-nen akemasite omedetou gozaimasu!
Latin
   Bonum Festum Nativitatis Domini et Felicem Annum Novum!
Lettland
   Prizecigus Ziemassvetkus un Laimigu Jauno Gadu!
Malaysia
   Selamat Hari Natal dan Selamat Tahun Baru!
Netherland
   Prettige Kerstdagen en Gelukkig Nieuwjaar!
Norway
   God Jul og Godt Nyttar!
Poland
   Wesolych Swiat Bozego Narodzenia i szczesliwego Nowego Roku!
Portugal
   Boas Festas e Feliz Ano Novo!
Romania
   Sarbatori Fericite!
Russia
   Srozhjestvom, Snovam Godam!
Serbia
   Srecan Bozic i Nova godina!
Slovak
   Vesele vianoce a stastny novy rok!
South Africa
   Geseende Kersfees!
Sweden
   God Jul och Gott Nytt Ar!
Thailand
   Sawassdee Pee Mai (Happy New Year) and 
   Sook san wan Christmas leh sa wat dee pee mai!
Philippines
   Maligayang Pasko at Manigong Bagong Taon!

-- 
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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: SVG with ConTeXt
  2001-12-22 19:29 SVG with ConTeXt Tobias Burnus
@ 2001-12-24 11:20 ` Hans Hagen
  2001-12-27 21:20   ` Tobias Burnus
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Hagen @ 2001-12-24 11:20 UTC (permalink / raw)
  Cc: NTG-ConTeXt

At 08:29 PM 12/22/2001 +0100, Tobias Burnus wrote:
>Hi,
>
>I'd like to typeset some small XMLs which contains some simple SVGs.
>
>Such as
><?xml version="1.0"?>
><svg xmlns="http://www.w3.org/2000/svg">
>   <g style="stroke:black; stroke-width:0.1cm;">
>      <circle cx="6cm" cy="2cm" r="100" style="fill:red;"
>              transform="translate(0,50)" />
>      <circle cx="6cm" cy="2cm" r="100" style="fill:blue;"
>              transform="translate(70,150)" />
>      <circle cx="6cm" cy="2cm" r="100" style="fill:green;"
>              transform="translate(-70,150)"/>
>   </g>
></svg>

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 <>).

If we can agree on a reasonable subset (with a clear definition of what 
means what) i can try to implement it.

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: SVG with ConTeXt
  2001-12-24 11:20 ` Hans Hagen
@ 2001-12-27 21:20   ` Tobias Burnus
  0 siblings, 0 replies; 3+ messages in thread
From: Tobias Burnus @ 2001-12-27 21:20 UTC (permalink / raw)
  Cc: NTG-ConTeXt

[-- Attachment #1: Type: text/plain, Size: 1034 bytes --]

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.

[-- Attachment #2: SVG-ConTeXt.draft --]
[-- Type: text/plain, Size: 2307 bytes --]

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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-12-27 21:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-22 19:29 SVG with ConTeXt Tobias Burnus
2001-12-24 11:20 ` Hans Hagen
2001-12-27 21:20   ` Tobias Burnus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).