You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by Alice Mello <me...@media.mit.edu> on 2004/12/23 17:47:47 UTC

Qustion about SVG

Hello all,

I wish you all a great holiday and Happy New Year!!!

My quick question is:

Given the part of a path data below, I would to know how to interpret 
the fourth point after the "c". I imagine that after the triple cx1,y1 
x2,y2 x,y, all the other points are regular Line to (l) points until the 
next c appear. Is that correct?

I am implementing a translator. I need to read a SVG image and convert 
it to my own internal data structure.


Thank you,
Alice


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org


Re: Qustion about SVG

Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi Alice,

Alice Mello wrote:

> Are you talking about the class or the interface : 
> org.apache.batik.css.parser Class Parser  or org.apache.batik.parser 
> Interface Parser ?

    org.apache.batik.parser (I normally drop org.apache just to make
it easier on the hands).

> I will look for example by the batik project. Just by loooking the API, 
> I have no clue how to use the methods.

     Well the two classes of interest are batik.parser.PathParser
and batik.parser.PathHandler (there is also a 'DefaultPathHandler').
You give your String/Reader to the Parser and it will call methods
on the handler as it parses the path.

> Thomas DeWeese wrote:
> 
>> Hi Alice,
>>
>> Alice Mello wrote:
>>
>>> Given the part of a path data below, I would to know how to interpret 
>>> the fourth point after the "c". I imagine that after the triple 
>>> cx1,y1 x2,y2 x,y, all the other points are regular Line to (l) points 
>>> until the next c appear. Is that correct?
>>
>>
>>
>>    I would strongly suggest that you read the relevant sections of
>> the SVG specification (in this case 8.3.1)* if you are implementing a
>> translator.  You might also consider using the "micro parsers" from
>> Batik to parse this data for you (batik.parser package).
>>
>>> I am implementing a translator. I need to read a SVG image and 
>>> convert it to my own internal data structure.
>>
>>
>>
>>
>> [*] The command letter can be eliminated on subsequent commands if the
>>     same command is used multiple times in a row (e.g., you can drop
>>     the second "L" in "M 100 200 L 200 100 L -100 -200" and use "M 100
>>     200 L 200 100 -100 -200" instead).
>>
>>     This means that the next command is also a 'c' not an 'l'.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
>> For additional commands, e-mail: batik-dev-help@xml.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-dev-help@xml.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org


Re: Qustion about SVG

Posted by Alice Mello <me...@media.mit.edu>.
Thomas,

Are you talking about the class or the interface : 
org.apache.batik.css.parser Class Parser  or org.apache.batik.parser 
Interface Parser ?

I will look for example by the batik project. Just by loooking the API, 
I have no clue how to use the methods.

Thanks,
Alice


Thomas DeWeese wrote:
> Hi Alice,
> 
> Alice Mello wrote:
> 
>> Given the part of a path data below, I would to know how to interpret 
>> the fourth point after the "c". I imagine that after the triple cx1,y1 
>> x2,y2 x,y, all the other points are regular Line to (l) points until 
>> the next c appear. Is that correct?
> 
> 
>    I would strongly suggest that you read the relevant sections of
> the SVG specification (in this case 8.3.1)* if you are implementing a
> translator.  You might also consider using the "micro parsers" from
> Batik to parse this data for you (batik.parser package).
> 
>> I am implementing a translator. I need to read a SVG image and convert 
>> it to my own internal data structure.
> 
> 
> 
> [*] The command letter can be eliminated on subsequent commands if the
>     same command is used multiple times in a row (e.g., you can drop
>     the second "L" in "M 100 200 L 200 100 L -100 -200" and use "M 100
>     200 L 200 100 -100 -200" instead).
> 
>     This means that the next command is also a 'c' not an 'l'.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-dev-help@xml.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org


Re: Qustion about SVG

Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi Alice,

Alice Mello wrote:

> Given the part of a path data below, I would to know how to interpret 
> the fourth point after the "c". I imagine that after the triple cx1,y1 
> x2,y2 x,y, all the other points are regular Line to (l) points until the 
> next c appear. Is that correct?

    I would strongly suggest that you read the relevant sections of
the SVG specification (in this case 8.3.1)* if you are implementing a
translator.  You might also consider using the "micro parsers" from
Batik to parse this data for you (batik.parser package).

> I am implementing a translator. I need to read a SVG image and convert 
> it to my own internal data structure.


[*] The command letter can be eliminated on subsequent commands if the
     same command is used multiple times in a row (e.g., you can drop
     the second "L" in "M 100 200 L 200 100 L -100 -200" and use "M 100
     200 L 200 100 -100 -200" instead).

     This means that the next command is also a 'c' not an 'l'.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org