SVG font imported in fontforge wrong centering
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| Inkscape |
Undecided
|
Unassigned |
Bug Description
Using the default template fontforge_glyph making a svg font glyph then export to .svg and import in fontforge, in Inkscape the glyph looks centered in the template but in fontforge it is imported centered wrrong. If the glyph it is exported from fontforge after centering it to the guildes in fontforge and import it like .svg in Inkscape I get the offcentering i get from inkscape to fontforge.
I dunno if it an Inkscape bug or fontforge bug. I`m not a programmer.
jazzynico (jazzynico) wrote : | #1 |
florin (grigoreflorin1985) wrote : | #2 |
florin (grigoreflorin1985) wrote : | #3 |
Note the difference in position from the base template from Inkscape and the difference from export from fontforge after I corrected the the position of the glyph.
summary: |
- SVG font imported in fontforge wrrong centering + SVG font imported in fontforge wrong centering |
MDP (m.d.p) wrote : | #4 |
I would redifine the DESCRIPTION:
- A curve is converted to a SVG font glyph with a wrong y coordinate for the start point.
The error REPLICATION:
1) create a 800x800 square in a 800x800 page and 'get curves from selection', the description of polygon "d" of the square is 'm 0,0 800,0 0,800 -800,0 z', of the glyph is 'm 0,1024 800,0 0,-800 -800,0 z'. Note the y of the first, reference point from 0 becomes 1024.
2) create a 400x400 square centered in a 800x800 page and 'get curves from selection', polygon: m 200,200 400,0 0,400 -400,0 z
glyph: m 200,824 400,0 0,-400 -400,0 z . The y of the first point, 200 -> 824
3) a path for a 600x200 rectangle described as 'm 100,367 600,0 0,200 -600,0 z' but with a 'transform: translate(0,133)' in its parent node, obtained by draggin the thing around, will be converted as 'm 100,657 600,0 0,-200 -600,0 z'. While 367+657 is correctly 1024, as expected (still wrong of course), the translation (133px) is not computed - thus the obtained glyph will not be positioned like the one which is seen.
On fontforge, the first gliph will actually be drawn from point (0,1024), the second from (200,824), the third from (100,657).
Where would I TRACK it:
Inside file
svg-font-dialog.cpp
inside the function
SvgFontsDialog:
the path is flipped vertically then it is offset, only for what x is concerned.
I presume also the y needs to be interpolated.
Following is the original code:
Geom:
//This matrix flips the glyph vertically
Geom::Matrix m(Geom:
pathv*=m;
//then we offset it
pathv+
Best Regards
MDP (m.d.p) wrote : | #5 |
Is it possible that the matrix transformation needs to become
1,0,0,-
, so the code something like
Geom::Matrix m(Geom:
?
(I currently do not know how to get the path height)
MDP (m.d.p) wrote : | #6 |
Oops
1,0,0,-
so
Geom::Matrix m(Geom:
tags: | added: importing |
Could you please provide a test file that demonstrate this issue so that we can investigate?
Thanks!