You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Dieter <di...@googlemail.com> on 2011/06/14 17:56:07 UTC
Converting Font to SVG: all glyphs are rotated
Hi,
I just converted several fonts to SVG. When I extract the d="" element
from several glyphs and insert them in a SVG document I notice that
all glyphs are rotated clockwise by 180 degrees. Here is an example
for the glyph "7":
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg xmlns="http://www.w3.org/2000/svg">
<path d="M219 -2Q194 0 162 0Q130 0 92 -4Q122 44 157 105T229 237T304
387T376 550Q359 551 342 551Q325 551 306 551Q242 551 175 548T36 537Q38
582 29 628Q155 623 269 623Q384 623 490 629Q496 569 492
541Q466 509 440 466T388 374T338 273T292 172T252 77T219 -2Z"
fill="green" stroke="blue" stroke-width="3" />
</svg>
Is this normal? Why are the glyphs rotated?
Cheers,
Dieter
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: Converting Font to SVG: all glyphs are rotated
Posted by Martin Jacobson <ja...@gmail.com>.
I don't have such a link in my head, but if you look at
http://www.w3.org/TR/SVG/index.html#minitoc I'm sure you'll see the
coordinate system described. As for why?... ;-)
best
Martin
On 14 June 2011 17:21, Dieter <di...@googlemail.com> wrote:
> yep...I meant flipped vertically or rotated 180 and flipped horizontally ;)
>
> Do you have a link where it is described that "SVG coordinates are
> upside down wrt cartesian" and the reasons why this was done?
>
> Cheers,
> Dieter
>
> On Tue, Jun 14, 2011 at 6:14 PM, Martin Jacobson
> <ja...@gmail.com> wrote:
>> I haven't had time to verify your example, but I suspect you'll find
>> that the fonts aren't rotated 180º, but flipped vertically; don't
>> forget that SVG coordinates are upside down wrt cartesian. This annoys
>> me on a regular basis!
>>
>> Martin
>>
>> On 14 June 2011 16:56, Dieter <di...@googlemail.com> wrote:
>>> Hi,
>>>
>>> I just converted several fonts to SVG. When I extract the d="" element
>>> from several glyphs and insert them in a SVG document I notice that
>>> all glyphs are rotated clockwise by 180 degrees. Here is an example
>>> for the glyph "7":
>>>
>>> <?xml version="1.0" standalone="no"?>
>>> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
>>> "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
>>> <svg xmlns="http://www.w3.org/2000/svg">
>>> <path d="M219 -2Q194 0 162 0Q130 0 92 -4Q122 44 157 105T229 237T304
>>> 387T376 550Q359 551 342 551Q325 551 306 551Q242 551 175 548T36 537Q38
>>> 582 29 628Q155 623 269 623Q384 623 490 629Q496 569 492
>>> 541Q466 509 440 466T388 374T338 273T292 172T252 77T219 -2Z"
>>> fill="green" stroke="blue" stroke-width="3" />
>>> </svg>
>>>
>>>
>>> Is this normal? Why are the glyphs rotated?
>>>
>>> Cheers,
>>> Dieter
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
>>> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>>>
>>>
>>
>>
>>
>> --
>> From my MacBook Pro
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
>> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>
>
--
>From my MacBook Pro
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: Converting Font to SVG: all glyphs are rotated
Posted by Cameron McCormack <ca...@mcc.id.au>.
Dieter:
> yep...I meant flipped vertically or rotated 180 and flipped horizontally ;)
>
> Do you have a link where it is described that "SVG coordinates are
> upside down wrt cartesian" and the reasons why this was done?
Also note that inside <glyph>s, the coordinate system has (0,0) at the
bottom left of the glyph cell, whereas in normal SVG content, (0,0) is
at the top left. So if you are copying path data out of <glyph d="">
you will need to apply a scale(1,-1) transform to it to flip it.
--
Cameron McCormack ≝ http://mcc.id.au/
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: Converting Font to SVG: all glyphs are rotated
Posted by Dieter <di...@googlemail.com>.
yep...I meant flipped vertically or rotated 180 and flipped horizontally ;)
Do you have a link where it is described that "SVG coordinates are
upside down wrt cartesian" and the reasons why this was done?
Cheers,
Dieter
On Tue, Jun 14, 2011 at 6:14 PM, Martin Jacobson
<ja...@gmail.com> wrote:
> I haven't had time to verify your example, but I suspect you'll find
> that the fonts aren't rotated 180º, but flipped vertically; don't
> forget that SVG coordinates are upside down wrt cartesian. This annoys
> me on a regular basis!
>
> Martin
>
> On 14 June 2011 16:56, Dieter <di...@googlemail.com> wrote:
>> Hi,
>>
>> I just converted several fonts to SVG. When I extract the d="" element
>> from several glyphs and insert them in a SVG document I notice that
>> all glyphs are rotated clockwise by 180 degrees. Here is an example
>> for the glyph "7":
>>
>> <?xml version="1.0" standalone="no"?>
>> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
>> "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
>> <svg xmlns="http://www.w3.org/2000/svg">
>> <path d="M219 -2Q194 0 162 0Q130 0 92 -4Q122 44 157 105T229 237T304
>> 387T376 550Q359 551 342 551Q325 551 306 551Q242 551 175 548T36 537Q38
>> 582 29 628Q155 623 269 623Q384 623 490 629Q496 569 492
>> 541Q466 509 440 466T388 374T338 273T292 172T252 77T219 -2Z"
>> fill="green" stroke="blue" stroke-width="3" />
>> </svg>
>>
>>
>> Is this normal? Why are the glyphs rotated?
>>
>> Cheers,
>> Dieter
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
>> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>>
>>
>
>
>
> --
> From my MacBook Pro
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: Converting Font to SVG: all glyphs are rotated
Posted by Martin Jacobson <ja...@gmail.com>.
I haven't had time to verify your example, but I suspect you'll find
that the fonts aren't rotated 180º, but flipped vertically; don't
forget that SVG coordinates are upside down wrt cartesian. This annoys
me on a regular basis!
Martin
On 14 June 2011 16:56, Dieter <di...@googlemail.com> wrote:
> Hi,
>
> I just converted several fonts to SVG. When I extract the d="" element
> from several glyphs and insert them in a SVG document I notice that
> all glyphs are rotated clockwise by 180 degrees. Here is an example
> for the glyph "7":
>
> <?xml version="1.0" standalone="no"?>
> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
> "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
> <svg xmlns="http://www.w3.org/2000/svg">
> <path d="M219 -2Q194 0 162 0Q130 0 92 -4Q122 44 157 105T229 237T304
> 387T376 550Q359 551 342 551Q325 551 306 551Q242 551 175 548T36 537Q38
> 582 29 628Q155 623 269 623Q384 623 490 629Q496 569 492
> 541Q466 509 440 466T388 374T338 273T292 172T252 77T219 -2Z"
> fill="green" stroke="blue" stroke-width="3" />
> </svg>
>
>
> Is this normal? Why are the glyphs rotated?
>
> Cheers,
> Dieter
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>
>
--
>From my MacBook Pro
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org