6

I have SVG file with element <path d="..." />

I'm converted that file to SVG font:

<?xml version="1.0"?>
<svg xmlns="http://www.w3.org/2000/svg">
    <defs>
        <font id="somefont" horiz-adv-x="1000">
            <font-face font-family="somefont" units-per-em="1000"/>
            <glyph unicode="a" d="..."/>
        </font>
    </defs>
</svg>

Attribute d isn't changed, but font is mirrored by x axis.

Why that happens and how to fix it?

Vyacheslav Slinko
  • 155
  • 1
  • 2
  • 9

2 Answers2

6

"Unlike standard graphics in SVG, where the initial coordinate system has the y-axis pointing downward (see The initial coordinate system), the design grid for SVG fonts, along with the initial coordinate system for the glyphs, has the y-axis pointing upward for consistency with accepted industry practice for many popular font formats."

Source: http://www.w3.org/TR/SVG/fonts.html

Phrogz
  • 296,393
  • 112
  • 651
  • 745
Robert Longson
  • 118,664
  • 26
  • 252
  • 242
0

Can be converted to right glyphs with that script:

#!/usr/bin/env fontforge
Open("source.svg")
Generate("converted.svg")
Vyacheslav Slinko
  • 155
  • 1
  • 2
  • 9
  • Thanks for your suggestion and FontForge is a great tip, but is this realy true? It just opens it in FontForge and saves it again, but if the original font is upside down, the generated font is also. This script doesn't flip the font. It should also be noted that FontForge can, indeed, flip all (selected) glyphs in a font at once — just using the FontForge's GUI. – Ideogram Mar 01 '15 at 10:49
  • @Ideogram can you elaborate on how one can transform/rotate an entire font this way? I just stumbled across the same need. – JDR May 29 '17 at 00:58
  • Was not working for me. However there seems to be another procedure with FontForge that could help: https://stackoverflow.com/a/26469776/793476 – flori Nov 28 '18 at 18:55