Author Topic: How to set default style for text tool?  (Read 576 times)

July 21, 2019, 07:32:42 PM
Read 576 times

ronburk

  • Jr. Member

  • Offline
  • ***

  • 18
 I create some text, set the style how I want it, double-click the text tool, click the "Take from selection" button.
Then I create a new text object -- its style is still the original default, unaffected by all my attempts to alter it.
I wonder if I used to know the trick for this...

Also true on 1.0alpha2 (4ce689b25c, 2019-06-24)
  • 0.92.4 (5da689c313, 2019-01-14)
  • Windows 7

July 21, 2019, 08:24:25 PM
Reply #1

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
You missed one step.

I create some text, set the style how I want it, double-click the text tool, tick "This tool's own style", click the "Take from selection" button.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

July 25, 2019, 11:11:50 AM
Reply #2

ronburk

  • Jr. Member

  • Offline
  • ***

  • 18
It was already ticked, and the "Take from selection" button is only enabled if it is ticked.

I have a dim sense this has to do with the "object" having one text style and the text within it having another text style. My theory would be there's some typical way to create a text object with a non-default font that I happen to never use or think of. Therefore, all my text objects are sans-serif, and when I think I'm changing the object style, I'm actually only changing the text within the object. And then "take from selection" is always taking the outermost style, which is always sans-serif.

But I'm groping.
  • 0.92.4 (5da689c313, 2019-01-14)
  • Windows 7

July 25, 2019, 11:19:44 AM
Reply #3

ronburk

  • Jr. Member

  • Offline
  • ***

  • 18
Tried creating text object by first setting font. The resulting svg:flowRoot definitely has the new font in its 'style' attribute. However, doing the "take from selection" think and creating a new text object still gives me the default sans-serif.  Can't figure out what I'm screwing up here.
  • 0.92.4 (5da689c313, 2019-01-14)
  • Windows 7

July 25, 2019, 01:24:53 PM
Reply #4

ronburk

  • Jr. Member

  • Offline
  • ***

  • 18
Ah, this has stymied me for ages, I see: http://www.inkscapeforum.com/viewtopic.php?f=5&t=31769&p=96168#p96276

In practice, I guess I gave up and just have to manually make the different styles of text I want as "scratch objects", then duplicate/edit those as needed. Would be nice to figure out why this isn't broken in the same way for every other Inkscape user, though.

Interesting. I created a text object, red, with non-default font. It appears that "take from selection" will correctly take the color from such an object, but not the font. Have to be very careful to make sure the desired color is set on the flowRoot though.

Time to try vanilla preferences.
  • 0.92.4 (5da689c313, 2019-01-14)
  • Windows 7

July 25, 2019, 02:37:37 PM
Reply #5

ronburk

  • Jr. Member

  • Offline
  • ***

  • 18
I open a fresh file, initialize a fresh preferences directory, and create a text object with a non-default font and color, and do "take from selection". Studying the preferences.xml file, I see information about this object only appears two places:

Code: [Select]
    <eventcontext
       id="text"
       usecurrent="0"
       gradientdrag="1"
       font_sample="AaBbCcIiPpQq12369$\342\202\254\302\242?.;/()"
       show_sample_in_list="1"
       use_svg2="0"
       style="vector-effect:none;fill:#ff00ff;stroke-width:0.99999999;stop-color:#000000;word-spacing:0px"
       selcue="1" />

and

Code: [Select]
  <group
     id="desktop"
     style="-inkscape-font-specification:'A.C.M.E. Secret Agent Normal';font-family:'A.C.M.E. Secret Agent';font-size:53.33333333px;fill:#ff00ff">

Restarting inkscape and creating a new text object, it defaults to the new color ("#ff00ff"), but not the new font. Now I exit, edit the preferences.xml, and shove the font specification into the 'style' attribute of the 'eventcontext' for "text". Restart inkscape, create new text object, now it has the non-default font.

I conclude that Inkscape never really did include font as part of the style it remembers for the text tool preferences. Whether this is by design or a bug, I do not know. Maybe the intent was only to ever work on attributes common to all tools. The end result seems quite confusing to me.
  • 0.92.4 (5da689c313, 2019-01-14)
  • Windows 7

July 26, 2019, 06:21:58 AM
Reply #6

Moini

  • IC Mentor

  • Offline
  • ******

  • 1,568
    • VektorRascheln
Mmmh. I think that would be good if it worked... It does for me, too. But it didn't at first, for some reason.

Here's how I got it to work:

Have it set at 'this tool's own style'.
Type text.
Make it use your new favorite font.
Switch to 'last used style'.
Type.
Switch back to 'this tool's own style'.
Take from selection.

Have it saved in preferences on closing of Inkscape. <- This does not work if Inkscape crashes. It only saves the prefs when you close the whole program.

I'm not sure if what I was experiencing was a bug, or a user error when trying to 'take from selection'.

July 28, 2019, 06:13:53 PM
Reply #7

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
I conclude that Inkscape never really did include font as part of the style it remembers for the text tool preferences. Whether this is by design or a bug, I do not know. Maybe the intent was only to ever work on attributes common to all tools. The end result seems quite confusing to me.

I would not have expected the font to be included in the style.  There's a separate setting for your default font, for some reason, only accessible in the Text and Font dialog.  (Although it never has worked properly for me.)

Everything works fine for me in 0.92.3. 

I tried in 1.0 alpha, but after trying to change the style, the Text tool stopped working.  I think it might be related to that stupid line spacing issue.  But I'm planning to get a more current 1.0 alpha later tonight.  So I'll test again, and report back. 

In my version of 1.0 alpha (using win32 theme), the interface is so broken, it's hard to tell much of anything about what's happening.  So maybe I'll have better luck with a more current version.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann