Why does Inkscape retain font info when text is converted to path?

General discussions about Inkscape.
User avatar
z3z
Posts: 36
Joined: Wed Jul 22, 2015 5:03 pm
Location: Scotland

Why does Inkscape retain font info when text is converted to path?

Postby z3z » Wed Mar 01, 2017 5:53 am

This isn't a problem issue, more that I'm trying to understand the reasoning.

Let's say I type a couple of words of text, perhaps for a logo, then convert to path. Regardless of whether I save in Inkscape's default SVG format, or 'Save a copy' in Plain SVG, if I open the file in a text editor, it includes style information for the original font. Example below of a word I converted from text to path:

Code: Select all

 <path
       inkscape:connector-curvature="0"
       id="path4571"
       style="
             font-style:normal;
             font-variant:normal;
             font-weight:normal;
             font-stretch:normal;
             font-size:8.46666622px;
             line-height:6.3499999px;
             font-family:'DejaVu Sans';
             -inkscape-font-specification:'DejaVu Sans';
             letter-spacing:0.5291667px;
             word-spacing:0px;
             fill:#000000;
             fill-opacity:1;
             stroke:none;
             stroke-width:0.26458332"
       d="m [snipped out lots of numbers] z" />


Just curious why this info is relevant, when I feel it only increases the file size. I assumed that once the text was converted to a path, and was therefore no longer text, it would be no different from a random shape you might create with the bezier tool. Even if Inkscape retains some settings for its own use, why does exporting to Plain SVG still include the original font information. It seems quite redundant when you're not dealing with text any more.

Can anyone shed some light on the reasoning behind this?

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Why does Inkscape retain font info when text is converted to path?

Postby Lazur » Wed Mar 01, 2017 6:28 am

Probably because if you got paths only of a lettering (in an svg presumably drawn by somene else) it is a challenge to identify the font used if you wanted to contnue the text in the same style. Although it would be nice if this hidden feature could be switched on/off.

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Why does Inkscape retain font info when text is converted to path?

Postby Moini » Wed Mar 01, 2017 11:19 am

Developers also thought of having a feature that would (some day) allow you to reconstruct text that had been turned into a path. The text contents (from 0.92 on) is also kept, in the aria-label attribute.
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Why does Inkscape retain font info when text is converted to path?

Postby ~suv » Wed Mar 01, 2017 8:51 pm

Lazur wrote:Although it would be nice if this hidden feature could be switched on/off.

There are built-in options to remove certain attributes and style properties if improper, inappropriate or non-useful - look at the details of the options in 'Preferences > Input/Output > SVG Output'. The (unwanted) font style properties discussed here can be auto-removed from paths (not from groups - they are appropriate on groups because of style inheritance rules) by checking
  • Inappropriate Style Properties Actions
    [ ] Print warnings
    [x] Remove style properties
  • Check Attributes and Style Properties on
    [ ] Reading
    [ ] Editing
    [x] Writing
This setting will remove the font style properties from paths when saving the file. Text converted to path needs to be ungrouped first for the setting to be effective (on ungroup, each path inherits the style properties defined originally on the group itself which contains the paths for each glyph).

User avatar
z3z
Posts: 36
Joined: Wed Jul 22, 2015 5:03 pm
Location: Scotland

Re: Why does Inkscape retain font info when text is converted to path?

Postby z3z » Thu Mar 02, 2017 6:49 am

Thank you for the replies, everyone.

~suv, I'll have a look in Document Properties for those settings. Thank you!

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Why does Inkscape retain font info when text is converted to path?

Postby ~suv » Thu Mar 02, 2017 6:54 am

z3z wrote:~suv, I'll have a look in Document Properties for those settings.

Preferences, not Document Properties.

User avatar
z3z
Posts: 36
Joined: Wed Jul 22, 2015 5:03 pm
Location: Scotland

Re: Why does Inkscape retain font info when text is converted to path?

Postby z3z » Thu Mar 02, 2017 10:40 am

Sorry, my mistake! :)

Loopy_Jen
Posts: 1
Joined: Sun Jul 16, 2017 7:46 am

Re: Why does Inkscape retain font info when text is converted to path?

Postby Loopy_Jen » Sun Jul 16, 2017 7:51 am

Thank you for asking this question!! I created a file for someone last month. They came to me today asking to change one word (from "mom" to "aunt") and add another name. I had forgotten what fonts I used... so I just opened my SVG in Google Chrome and clicked on "view page source." WOO HOO :D :D :D


Return to “General Discussions”