Inkscape.org
Beyond the Basics SVG obtained from EPS is now very different in Inkscape 1.3
  1. #1
    AndrejMrvar AndrejMrvar @AndrejMrvar

    If you load some EPS file and save it as SVG the resulting file in inkscape 1.3 is now very different from files produced by previous inkscape versions (e.g. inkscape version1.2).

    For example: text is now located inside the <path> tag, it contains new property called "aria-label", in previous versions text was inside <text> tag, what I think is more appropriate.

    It is very unconvenient that in every new inkscape version when transforming EPS to SVG the resulting file looks very different, especially for those using command line conversion and changing contents of the resulting SVG file automaticaly (e.g. changing some text with another one).

    I think it would be very useful to keep in some way (with an option?) backward compatibility of the resulting files.

     

  2. #2
    Tyler Durden Tyler Durden @TylerDurden

    Some iinfo here:

    https://inkscape.org/doc/release_notes/1.3/Inkscape_1.3.html#PDF_import

  3. #3
    AndrejMrvar AndrejMrvar @AndrejMrvar

    Thanks for pointing to info. That is very useful information.

    Then I better give up. There were huge changes when transforming EPS to SVG from inkscape 0.9? to 1.0, I rewrote my code to be able to follow the changes, and I have no energy to do it again. Who knows: maybe there will be changes in 1.4 again? Rewriting for each new version is a Sisyphean task - I better stay with inkscape 1.1.

     

  4. #4
    AndrejMrvar AndrejMrvar @AndrejMrvar

    Attached are two SVG files which were both produced from the same  EPS file, once with inkscape 1.2 (inkscape2.svg) and once with inkscape 1.3 (inkscape3.svg).
    What I do not like in inkscape 1.3 is that some text labels are simply concatenated with #10:
    aria-label="Kennedy&#10;Scalia&#10;Thomas&#10;Roberts&#10;Alito"
    instead of being separate text labels with exact position specified:
    <tspan y="0"
                 x="0">Kennedy</tspan><tspan
                 y="30"
                 x="0">Scalia</tspan><tspan
                 y="60"
                 x="0">Thomas</tspan><tspan
                 y="90"
                 x="0">Roberts</tspan><tspan
                 y="120"
                 x="0">Alito</tspan></text>


    Details:

    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Inkscape 1.2:

          <g
             id="g380"
             transform="scale(10)">
            <text
               xml:space="preserve"
               transform="matrix(0,1,1,0,54,320)"
               style="font-variant:normal;font-weight:normal;font-size:18px;font-family:Helvetica;-inkscape-font-specification:Helvetica;writing-mode:lr-tb;fill:#231f20;fill-opacity:1;fill-rule:nonzero;stroke:none"
               id="text384"><tspan
                 y="0"
                 x="0">Breyer</tspan></text>
          </g>

     <g
             id="g400"
             transform="scale(10)">
            <text
               xml:space="preserve"
               transform="matrix(0,1,1,0,174,320)"
               style="font-variant:normal;font-weight:normal;font-size:18px;font-family:Helvetica;-inkscape-font-specification:Helvetica;writing-mode:lr-tb;fill:#656263;fill-opacity:1;fill-rule:nonzero;stroke:none"
               id="text412"><tspan
                 y="0"
                 x="0">Kennedy</tspan><tspan
                 y="30"
                 x="0">Scalia</tspan><tspan
                 y="60"
                 x="0">Thomas</tspan><tspan
                 y="90"
                 x="0">Roberts</tspan><tspan
                 y="120"
                 x="0">Alito</tspan></text>
          </g>

    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Inkscape 1.3:

        <path
           id="path22"
           d="m 1.3251953,0 v -12.890625 h 4.828125 c 0.984375,0 ........ -0.257812,1.8515625 V 0 Z m 0,0"
           style="fill:#231f20;fill-opacity:1;fill-rule:nonzero;stroke:none"
           aria-label="Breyer"
           transform="matrix(1.3333333,0,0,1.3333333,406.66667,184)" />


     <path
           id="path25"
           d="m 1.3251953,0 v -12.890625 h 1.6992188 v 6.3984375 ........,0.89062 -0.515625,0.59473 -0.773438,1.48829 -0.773438,2.6836 z m 0,0"
           style="fill:#656263;fill-opacity:1;fill-rule:nonzero;stroke:none"
           aria-label="Kennedy&#10;Scalia&#10;Thomas&#10;Roberts&#10;Alito"
           transform="matrix(1.3333333,0,0,1.3333333,406.66667,344)" />

           
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    The new file is very inconvenient: if you want to change these labels with new ones with some program. Export with inkscape 1.3 is for me useless. Also if you see the sizes of two files 

    (inkscape2.svg and inkscape3.svg) the new file is more than 4 times larger in size.

    Inkscape2
    Inkscape3
  5. #5
    AndrejMrvar AndrejMrvar @AndrejMrvar

    Thanks Tyler Durden  again for very useful info. The question I have now is the following one:

    How can I tell inkscape using COMMAND LINE that I would like to use import EPS/PDF option "Keep missing fonts' names" (see attachment).

    The default option called "Draw missing fonts" converts text to paths and text cannot be identified in the obtained SVG anymore, so it is not useful to me.

    Thanks for any reply in advance.

    Andrej

     

  6. #6
    Tyler Durden Tyler Durden @TylerDurden

    This is still open: https://gitlab.com/inkscape/inbox/-/issues/2172

    Adding your comments may lead to additional input from developers.

     

  7. #7
    AndrejMrvar AndrejMrvar @AndrejMrvar

    Thanks. I did leave a comment there. I hope I did it properly.

  8. #8
    AndrejMrvar AndrejMrvar @AndrejMrvar

    One more simple question, I have a short EPS file like this:

    %!PS-Adobe-3.0 EPSF-3.0
    %%BoundingBox: 0 0 100 50
    /Arial 18 selectfont
    25 25 moveto (Andrej) show
    showpage

     

    Is there any way (using command line) that inkscape 1.3 would read this file and converts it to SVG where text will stay text?

    For example:

    inkscape --export-plain-svg --export-filename=a.svg a.eps

    does not work, it converts text to path.

    Is there anything I should write in EPS file instead of:

    /Arial 18 selectfont

    Would inkscape 1.3 recognize any font and leave the text as text, or it simply converts any text to path not regarding which font is used?

    One of advantages of SVG is that text is still stored as text, so that you can for example search inside picture for a text. It is really a pity to transform text to path!

  9. #9
    AndrejMrvar AndrejMrvar @AndrejMrvar

    Maybe somebody can provide answers to the following two very basic questions;:

    1. When transforming EPS to SVG via command line it seems to me that one of the following options is used:

    • a) "Draw missing fonts" 
    • b) "Draw all text"

             Which one is used (a) or b)) ?

    2. If a) is true: Which fonts inkscape considers as "missing fonts"? Asking differently: what font should in EPS file be used so that inkscape will not consider it as "missing". Whatever font I use in EPS (e.g. /Arial 18 selectfont) inkscape does not recognize this and transforms all texts to paths. What is a pity :(

     

  10. #10
    Tyler Durden Tyler Durden @TylerDurden

    I'd try asking the devs that frequent the user chat: https://chat.inkscape.org/channel/inkscape_user

  11. #11
    AndrejMrvar AndrejMrvar @AndrejMrvar

    Again, very helpful suggestion. Thanks. I asked this question on user chat and got the right answer. If anybody is interested in this:

    In Inkscape 1.3 command line you can add the switch "--pdf-font-strategy=keep" and get SVG where text is retained as text.

    Problem solved for me!

  12. #12
    AndrejMrvar AndrejMrvar @AndrejMrvar

    or even better:

    "--pdf-font-strategy=substitute"

  13. #13
    AndrejMrvar AndrejMrvar @AndrejMrvar

    After installing Inkscape 1.3.2 I return to the same problem again.

    In inkscape 1.3 when using (in command line execution) the switch:

    "--pdf-font-strategy=substitute"

    font-family:Arial

    is used.

    But in 1.3.2

    font-family:Harrington

    Is there a way to tell inkscape which font to use as a substitution?

     

     

Inkscape Inkscape.org Inkscape Forum Beyond the Basics SVG obtained from EPS is now very different in Inkscape 1.3