Inkscape.org
Beyond the Basics Text XML code does not reflect Inkscape setting
  1. #1
    Old_Grey Old_Grey @Old_Grey

    I select the text button

    In the top toolbar I select mm and 36

    I type in drawing area.

    But if you look at the XML code it shows 36px, which is tiny, and yet it shows 36mm fonts.

    font-size:36px;line-height:6.61458px;font-family:'Droid Sans Mono';-inkscape-font-specification:'Droid Sans Mono, Normal';font-variant-ligatures:none;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1

    Shouldn't it remove the px?

    The whole story is this the svg get imported into a electronics circuit design program, and because the code is px it takes it literally and shrinks the font. Is there a setting that gets rid of the px so I don't have to edit the XML code every time I use text.

    https://www.mediafire.com/convkey/7967/6v7qe7vzg9cg4mp6g.jpg

    It also adds single quote marks to 'Droid Sans Mono, Normal', so I have to delete 4 of them each time.

  2. #2
    Tyler Durden Tyler Durden @TylerDurden
    Old_Grey

    Shouldn't it remove the px?

    Text size in Inkscape XML syntax is expressed in user units (px).  The reason it says 36, is the default document scale is set for 1px = 1mm (which is incorrect IMO).

     

    Old_Grey

    It also adds single quote marks to 'Droid Sans Mono, Normal', so I have to delete 4 of them each time.

    Quotation is standard svg syntax.

  3. #3
    Old_Grey Old_Grey @Old_Grey

    Not that I can understand code 😊, but I don't really see where is says 1mm = 1px

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <svg
       width="97mm"
       height="66mm"
       viewBox="0 0 97 66"
       version="1.1"
       id="svg6"

       xmlns="http://www.w3.org/2000/svg"
       xmlns:svg="http://www.w3.org/2000/svg">
      <defs
         id="defs2" />

     

    So there is no way to strip out the px except manually.

    From what I'm told double quotes are used whenever a font name has a space - oddly this has single -, so it's looks like I'm stuck not using them.

    I think I'll have to find an old Illustrator svg and see how they did it, because in the old days when they used it it didn't have a problem with these things.

  4. #4
    Tyler Durden Tyler Durden @TylerDurden
    Old_Grey

    I don't really see where is says 1mm = 1px

       width="97mm"
       height="66mm"
       viewBox="0 0 97 66"

    https://wiki.inkscape.org/wiki/index.php/Units_In_Inkscape#Inkscape_.26_Units 

     

  5. #5
    Old_Grey Old_Grey @Old_Grey

    Ahh, so if the viewbox #'s are the same as width and height #'s it's 1:1.

    The link is a bit lol funny, because it says it must not show units, yet in text it must show units. 😊

    Thanks.

  6. #6
    Old_Grey Old_Grey @Old_Grey

    Sorry back again 😊

    Is there anything I can do about this :-

    I can remove the px in the text code in XML Editor, and I can duplicate that text object and the px is still removed from it's code, but as soon as I move that text the px comes back, and that means I have to deleted the px in every repositioned text object again.

  7. #7
    Tyler Durden Tyler Durden @TylerDurden

    You could try completing the work in Inkscape, then removing all instances of px at once using a text editor.

  8. #8
    Old_Grey Old_Grey @Old_Grey

    Can a text editor bulk remove them in one hit, because there is 300 of them.

    I'm making tutorials to simplify parts making for an electronic circuit design program, and introducing another program into what is already a difficult task - beginners just give up at this stage -, would not be good. 

  9. #9
    Tyler Durden Tyler Durden @TylerDurden
    *

    Yes.

    This is one of the many great benefits of open-source using a standard xml file format. 

    (You can type out your entire svg file, if you are so inclined.)

Inkscape Inkscape.org Inkscape Forum Beyond the Basics Text XML code does not reflect Inkscape setting