Inkscape.org
Beyond the Basics Possible bug importing polygon in SVG file
  1. #1
    geoffreyphipps geoffreyphipps @geoffreyphipps

    Hi,

    I am using a program to generate SVG images. Nothing fancy – just text, rectangles, lines. I have been importing the generated files into Adobe Illustrator without problems for months now, but if I import the generated SVG into inkscape the polygon elements are offset from where I believe they should be. I attach the SVG, and an image from Inkscape and one from Illustrator.

    The first problem polygon is on line 12.

    Inkscape 1.0.1, MacOS 11.0.1 (Big Sur)

    Is my SVG invalid? It is so simple I can't see where it is wrong.

    Thanks in advance

    Cheers

    Geoff

    Polygon Issue
    Inkscape
    Illustrator
  2. #2
    Tyler Durden Tyler Durden @TylerDurden

    A couple of things I'd look into:

    1) the font name is "Suit Icons" regular is the font-style. So, I'd delete "regular" from the references to the font name.

    2) This is found in the Inkscape references, but can be helpful for svg in general:

    Absolute units (other than 'px' inside CSS) should not be used inside an SVG file with one exception:

    The root width and height may have units, which with a proper viewBox determines an appropriate scale for a drawing. (This sets the "real" world value of the SVG user unit.) This reflect the opinion of the majority of the SVG working group.

    In CSS a unit identifier must be present. As 'px' is defined in SVG to be the same as a user unit the following are equal: font-size="20" and style="font-size:20px".

    It should be noted that the relative units emex, and % can be useful in some cases.

    https://wiki.inkscape.org/wiki/index.php/Units_In_Inkscape

    So I'd remove "pt" from everywhere, except maybe width and height elements in the root.

     

  3. #3
    geoffreyphipps geoffreyphipps @geoffreyphipps

    Thank you, it was indeed a problem with my generated SVG. oops.

    After I posted I also tried removing "pt" from all the coordinates and it fixed the polygon problem.

    I will look at the font tissue next. The suit font is custom so I was expecting to have work to do there.

    Cheers

    Geoff

Inkscape Inkscape.org Inkscape Forum Beyond the Basics Possible bug importing polygon in SVG file