Converting Font to SVG: all glyphs are rotated

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Converting Font to SVG: all glyphs are rotated

Dieter
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Converting Font to SVG: all glyphs are rotated

Martin Jacobson
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 <[hidden email]> 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: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>



--
From my MacBook Pro

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Converting Font to SVG: all glyphs are rotated

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?

Cheers,
Dieter

On Tue, Jun 14, 2011 at 6:14 PM, Martin Jacobson
<[hidden email]> 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 <[hidden email]> 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: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
>
>
> --
> From my MacBook Pro
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Converting Font to SVG: all glyphs are rotated

Martin Jacobson
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 <[hidden email]> 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
> <[hidden email]> 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 <[hidden email]> 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: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>>
>>
>>
>>
>> --
>> From my MacBook Pro
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>



--
From my MacBook Pro

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Converting Font to SVG: all glyphs are rotated

Henryk Hecht
In reply to this post by Dieter
Dieter wrote:

> Do you have a link where it is described that "SVG coordinates are
> upside down wrt cartesian" and the reasons why this was done?

It was probably done because this coordinate system (origin at top left,
x+ right, y+ down) is standard for computer graphics work.  Framebuffer
memory is laid out this way, and most image formats (though not
postscript) are, too.  The reason for this, in turn, is probably that this
was also the layout for text display, which is sensible in a left-to-right
top-to-bottom language.  So, ultimately, you can blame SVG's coordinate
system on the Periclean Greeks.

--
HH

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Converting Font to SVG: all glyphs are rotated

Cameron McCormack-4
In reply to this post by Dieter
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: [hidden email]
For additional commands, e-mail: [hidden email]