9.1 Stroke Width

The most important property of the stroke is its width. Like any other length value in Inkscape, width can be measured in a number of different units. There are currently two places in the UI where you can see and change the stroke width of the selected objects: in the selected style indicator in the status bar (at the right end of the stroke swatch) and in the Stroke style tab of the Fill and Stroke dialog:

Stroke width in the selected style indicator (left; right-click to open the menu) and the Fill and Stroke dialog (right)

Figure 9-1. Stroke width in the selected style indicator (left; right-click to open the menu) and the Fill and Stroke dialog (right)

Note

If the contents of the Stroke style tab are disabled (grayed out), this means your selected object has no stroke paint. To enable it, in the same dialog go to the Stroke paint tab and choose a solid color or any other paint for the stroke.

In the selected style indicator, one way to change the stroke width is by right-clicking directly on the numeric stroke width shown next to the swatch and choosing a value from the menu which pops up. In the same menu, you can choose the unit to be used for stroke width; by default it’s px (SVG pixel).

Similar to editing fill or stroke colors by color gestures (8.5 The Selected Style Indicator: Color Gestures), you can also drag off the stroke width value in the selected style indicator, into the canvas, to change the stroke width of selection. Dragging above and to the left of the 45-degree line from the swatch makes the stroke in selected objects wider (up to twice the original width); dragging below and to the right makes it narrower (down to half the original width). For example, if you start with a 1 px stroke, dragging up and to the left will give you 2 px, and dragging to the right and down will yield 0.5 px. This way, you can adjust stroke width quickly and precisely without opening any dialogs or menus.

In the Fill and Stroke dialog, there’s a regular editable field where you can type any value, as well as a unit selector.

Note

In Outline mode (3.11 Rendering Modes), the stroke width is ignored and all objects are shown with a stroke that is one screen pixel wide, regardless of zoom. However, this is only an Inkscapespecific editing convenience; in SVG, stroke width is always specified in absolute units, so you cannot make it independent of zoom. This may change in a future version of SVG. If it does change, Inkscape will eventually support this as well.

When selection contains multiple objects with different strokes, the selected style indicator averages the stroke widths of those objects that have any stroke. For example, if one of the two selected objects has 3 px stroke and the other has 1 px, the indicator will show 2 (and the tooltip will say that this is an averaged value). Now, if you set any width via the right-click menu, the same width will be assigned to all selected objects that had any stroke in the first place. (For example, if one of the objects has 3 px stroke and the other has no stroke, it will display 3 as its stroke width and Different in the swatch on the left, but any new width you set will be assigned only to the object that had 3 px stroke.)

The Fill and Stroke dialog behaves differently. When different stroke widths are detected in selection, the stroke width unit switches to percentage unit (%) and the displayed value is 100 percent. Now, if you change it, for example, to 200 percent and press , each stroke width in the selection will get two times wider than it was before. After that, all stroke widths that were different will remain different, and the displayed value will be reset to 100 percent.

Of course, in that dialog you can just as well switch the unit selector to any absolute unit and assign the same stroke width to any number of selected objects. On the other hand, even if you have a single object selected, you can still switch to the percent unit and specify a new width as a percentage of the old.