quick access stroke width menu - change defaults

Post questions on how to use or achieve an effect in Inkscape.
iArtist
Posts: 5
Joined: Mon Aug 20, 2012 11:14 pm

quick access stroke width menu - change defaults

Postby iArtist » Tue Aug 28, 2012 11:46 pm

Hello,
after lengthy search without result, I'm raising the question as a newbie here:
can I change the default line width list in the "stroke context menu" (don't know how the exact naming of this menu item is..., see picture below). Its the context menu, which pops up after a right click to the stroke width of a selected object in the lower left corner of the inkscape window (as part of the status bar).

I looked to the preferences.xml file, but was unable to locate it there!
Thanks in advance for any useful tip.
Attachments
stroke_context_menu.png
stroke_context_menu.png (7.99 KiB) Viewed 2202 times

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: quick access stroke width menu - change defaults

Postby brynn » Wed Aug 29, 2012 12:57 am

Image
Welcome to InkscapeForum!

It's my understanding that the 1 px default width applies throughout Inkscape, and not just to the context menu. I'm not sure if that can be changed, short of changing the code. If it can, then possibly through preferences.xml file, although that's a guess. But there may be another way that will suit your workflow.

The usual tools for drawing stroked paths, which are Pen/Bezier and Pencil/Freehand tools, can have a stroke width set for those individual tools. So that whenever you use those tools, they'll draw a path with your preferred stroke width. So if these stroke widths that you want to change originate from one of those tools, perhaps this will be a solution for you.

However, I realize there are other ways to achieve a stroke besides those 2 tools. You can also set a unique stroke width for all the shape tools, and for Calligraphy tool as well. Also Text and Paint Bucket tools, and maybe a couple of others that I don't remember at the moment. All of these can be changed in Inkscape Preferences.

But none of that covers converting an object to path. (edit - unless the original object already had a stroke set) That would indeed require changing the default. I'll be interested to follow this topic, to learn if the default stroke width can be changed :D

iArtist
Posts: 5
Joined: Mon Aug 20, 2012 11:14 pm

Re: quick access stroke width menu - change defaults

Postby iArtist » Thu Aug 30, 2012 1:14 am

brynn - thanks for the fast answer and the warm welcome! My idea behind was, to change the list to have easy access to a most common (individually) used set of stroke width for technical drawings, where you have usually a 1:sqrt(2) ratio between the different stroke widths, like for a usual technical drawing on A3 or A4 paper size, you had in the past a set with 0.18 - 0.25 - 0.35 - 0.50 - 0.70 - 1.00 mm. So I looked forward to bring such numbers to this quick access list.

Some idea for these line width groups can be found here:
http://en.wikipedia.org/wiki/Technical_drawing_tools

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: quick access stroke width menu - change defaults

Postby brynn » Thu Aug 30, 2012 11:08 am

Oooohh, I apologize for misunderstanding. You want to change the list of stroke widths, not the default stroke width. That would indeed require a change in the code, as far as I know. If there's a fairly easy (or easy to explain) way to do this, maybe someone will explain.

You know, I'd love to someday see specialized versions of Inkscape -- like Inkscape for CAD, or Inkscape for drafting, or Inkscape for artists, or Inkscape for math professions, or Inkscape for publishers, or etc. Any of that is entirely possible, under the license. Although it would certainly take a very industrious and ambitious person(s). But for now, I'd be happy with a simple theme changer (for Windows -- I know it's already possible in other os).

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

Re: quick access stroke width menu - change defaults

Postby ~suv » Fri Aug 31, 2012 3:50 am

iArtist wrote:can I change the default line width list in the "stroke context menu" (don't know how the exact naming of this menu item is..., see picture below). Its the context menu, which pops up after a right click to the stroke width of a selected object in the lower left corner of the inkscape window (as part of the status bar).

I looked to the preferences.xml file, but was unable to locate it there!

The list of predefined stroke widths in the context menu is not configurable - AFAICT the values are "hard-coded" (built-in at compile time). You would need to change them in the source code, and recompile Inkscape, or refactor the source code so that the built-in list serves as initial and/or fallback list, and could be overridden by loading a different (named) preset from an external resource file (or alternatively for example be selected in a new preferences pane which offers task-related presets).

Code: Select all

static gdouble const _sw_presets[]     = { 32 ,  16 ,  10 ,  8 ,  6 ,  4 ,  3 ,  2 ,  1.5 ,  1 ,  0.75 ,  0.5 ,  0.25 ,  0.1 };
static gchar const *const _sw_presets_str[] = {"32", "16", "10", "8", "6", "4", "3", "2", "1.5", "1", "0.75", "0.5", "0.25", "0.1"};
Source: current trunk src/ui/widget/selected-style.cpp (line 52/53)

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

Re: quick access stroke width menu - change defaults

Postby ~suv » Fri Aug 31, 2012 3:58 am

iArtist wrote:My idea behind was, to change the list to have easy access to a most common (individually) used set of stroke width for technical drawings, where you have usually a 1:sqrt(2) ratio between the different stroke widths, like for a usual technical drawing on A3 or A4 paper size, you had in the past a set with 0.18 - 0.25 - 0.35 - 0.50 - 0.70 - 1.00 mm. So I looked forward to bring such numbers to this quick access list.

Implementing (predefined and configurable) layer styles (as known from CAD applications) - based on style/property inheritance in SVG [ 1, 2 ] - might be an alternative to preset stroke widths, and ultimately a more powerful feature (as it could be used for other style attributes as well).

iArtist
Posts: 5
Joined: Mon Aug 20, 2012 11:14 pm

Re: quick access stroke width menu - change defaults

Postby iArtist » Fri Aug 31, 2012 7:31 pm

Thanks for this clear statement, that this list is hardcoded! It’s maybe an option, to bring this once in the future into the preference.xlm file ...

~suv wrote:Implementing (predefined and configurable) layer styles (as known from CAD applications) - based on style/property inheritance in SVG [ 1, 2 ] - might be an alternative to preset stroke widths, and ultimately a more powerful feature (as it could be used for other style attributes as well).

This sounds like a dream to me - layer dependent styles, that’s similar to AutoCAD, and for sure an excellent solution, which I would prefer too. This may also include a kind of grouping, which preserves the layer info of the elements to be grouped…


Return to “Help with using Inkscape”