Outils pour utilisateurs

Outils du site


issue163:inkscape

Ceci est une ancienne révision du document !


We start this month with a small correction. Last time, I said that the recent minor revision of Inkscape, version 1.0.1, hadn’t fixed any of the issues that I’d mentioned in recent articles. In fact it has addressed one problem that I described in part 100 of this series. In version 1.0, it was no longer possible to reverse a sub-path by selecting a single node and using Path > Reverse. Instead, you had to break the path apart, reverse the path in question, then combine all the paths again. Inkscape 1.0.1 reinstates the previous behaviour. In practice, this is a rarely used feature that really comes into its own only when dealing with fill-rules and self-intersecting paths, as I detailed in part 95, but it’s nice to see it fixed nevertheless.

The remaining issues described in part 100 – problems with converting text to a path, and other issues with linked offsets – still remain in 1.0.1. As the workarounds to these can be a little tricky to follow, I’ve made a YouTube video that covers this topic in a more visual way. This is my first Inkscape tutorial video, so please leave a comment if you want to see more. http://www.youtube.com/watch?v=lx5nRCu7AKk

Now, back to the usual programming, with a look at some of the changes and additions to Inkscape’s drawing tools that were introduced in version 1.0:

Reordered Toolbox

Although no new tools have been added in 1.0, the existing tools have been reordered within the toolbox on the left of the screen, in order to group them more logically. Thin dividers are used between the groups, which has the effect of providing a little structure to what was previously just an undifferentiated list. In theory this should make it easier and faster to find the icon you’re looking for, and that has certainly been my experience. The tools are grouped as follows: Edit tools – for editing existing objects: Select tool, Node tool Shape tools – for creating and editing geometric shapes: Rectangle & Squares tool, Circles & Ellipses tool, Stars & Polygons tool, 3D Box tool, Spiral tool Primitive tools – for creating basic objects: Bézier Curve tool, Freehand (Pencil) tool, Calligraphy (Pen) tool, Text tool Color tools – for working with colors and gradients: Gradient tool, Mesh Gradient tool, Color Picker (Eye Dropper) tool, Fill tool (Bucket Fill) Other tools – miscellaneous tools not included in the other sections: Tweak tool, Spray tool, Eraser tool, Connectors tool Canvas tools – for manipulating the canvas view: Zoom tool, Measurement tool

These are my descriptions, which vary from the terms used in the official release notes, but which I think are more descriptive and consistent. It’s easy to argue about the placement of some items, but generally I think the groupings mostly make sense, and do move the less commonly used icons towards the bottom of the bar. If you don’t like the order, however, Inkscape 1.0 introduces a mechanism for changing it… albeit one that isn’t exactly user friendly.

Reordering Tools

The order of the tools is now defined by an XML file that is read when Inkscape starts up. You can override this file by creating an edited copy in your user config directory. First you’ll need to find the paths for the shared folder (where the original file lives) and your user config directory. You can find the latter, and hints to the location of the former, by opening the Inkscape preferences dialog (Edit > Preferences) and selecting the System panel.

Open a file manager, then navigate to the path shown in the “Inkscape data” field. That may well be a directory that’s shared with multiple programs, as is the case with the /usr/share value in my screenshot. Use the search facility in your file manager to find a file named “toolbar-tool.ui”, starting from this root directory. In practice that will probably search through far more files than you need to, so you can make the search more efficient by being slightly more targeted in your choice of starting directory. That’s why I’ve also highlighted the “Inkscape extensions” field in my screenshot: that’s not the directory you want, as it’s a little too specific, but it should give you a good hint as to where the common Inkscape files are stored. In my example, /usr/share/inkscape is a better starting point.

On my machine I found the “toolbar-tool.ui” file in /usr/share/inkscape/ui.

Once you’ve found the file, open a second file manager with the path from the “User config” field as its location. This should be pretty easy, as the Inkscape developers have provided a handy “Open” button right next to the field.

Create a “ui” folder in your user config location, if one doesn’t already exist. Copy the “toolbar-tool.ui” file into it, making sure that you definitely copy rather than move the file.

Quit Inkscape if it’s still running, and open the newly copied file using a text editor. It’s a fairly flat XML file which should be pretty self-explanatory. To move tools between groups simply re-order the lines in the file; to hide a tool completely, wrap it in “<!–” and “–>” delimiters, similar to those used for comments in the file. Save your changes and launch Inkscape 1.0 to confirm that your new tool arrangement is working. If you have any problems and get completely stuck, you can quit Inkscape and delete the new file in order to return to the default arrangement.

This new capability may be particularly useful when using Inkscape on a machine with a smaller screen. If there’s insufficient height to draw all the tools in the toolbox, Inkscape moves any excess tools into a pop-up menu at the bottom of the box. By moving the tools around in this configuration file, you can ensure that less useful ones end up in the pop-up while those you use commonly are always just one click away.

Here’s a quick bonus tip: there’s also a “toolbar-commands.ui” file in the same directory which can be used to re-order and hide entries in the main Inkscape toolbar.

Bézier Tool

The Bézier tool’s control bar (above) has a button with the confusing tooltip of “Create a sequence of paraxial line segments”.

In layman’s terms, this was the “draw only horizontal and vertical lines” mode. With this mode enabled, Inkscape would allow you to draw only an alternating sequence of horizontal and vertical lines. You could switch modes mid-path – if you wanted to switch to the “straight lines” mode to add a single off-axis segment, for example – but any parts drawn under the influence of this control could be only horizontal or vertical.

With 1.0, the layman’s term for this button would now be the “draw perpendicular lines” mode. Now the segments are constrained by the first segment you draw: the second segment will be perpendicular to it (i.e. at a 90° angle to the first segment), the third segment will be perpendicular to the second (i.e. at the same angle as the first), and so on. The first path segment can be drawn at any angle, essentially turning this into a version of the previous paraxial mode, but with built-in rotation.

If you still require precise horizontal and vertical segments, make sure to hold the Ctrl key when drawing the first segment. That will constrain the initial line to one of a fixed series of angles, defined in the Behaviour > Steps section of Inkscape’s preferences, and defaulting to every 15°. The previous image was drawn using this method to fix the initial segment at a 30° angle.

Once again, you can switch to other modes mid-way through drawing a sequence of path segments, but the behaviour might not quite be what you expect. Consider drawing a series of paraxial paths at, say, a 30° initial angle. If you require a series of horizontal and vertical paths to continue the sequence, you might think that you can switch to the “straight line” mode, hold Ctrl to create your initial horizontal or vertical line, then switch back to paraxial mode to continue with further horizontal and vertical line segments.

In practice, the paraxial mode remembers the initial path angle you used, not the most recent one. So, after switching back to paraxial mode, you would end up with further lines at 30° and 120°, not at the 0° and 90° you wanted. You can see this effect in the following example where the fourth segment was drawn vertically, but the fifth and subsequent segments are still constrained by the angle set with the very first segment.

The workaround is to end your path, then start a new one. If the previous path is still selected, the Bézier tool lets you continue by starting your next line segment at the end node of the existing path. Each time you do this with paraxial mode enabled, the first segment you draw will be the reference segment for the remainder of that path. You can repeat this as many times as required to produce complex lines with differently oriented paraxial sections, interspersed with curves or lines at arbitrary angles.

Calligraphy Tool

There are two things that every sentence in this article has in common. Two basic rules of written English. They all start with a capital letter, and they all end with a punctuation character – usually a period (“full-stop” in British English), but often a question mark, exclamation mark, or colon. What all these characters have in common is that they require the ability to draw a dot. Given this fundamental requirement of written communication, it’s surprising to note that Inkscape’s calligraphy tool previously had no practical way to make a single dot.

You could kind of fake it by drawing a small circular shape with the tool, but make the circle too small and Inkscape would ignore it, while too big resulted in a large misshapen splodge. With 1.0, the developers have added the ability to directly create a dot – but in a rather odd way that, in my opinion, doesn’t really address the underlying requirement.

To draw a dot, you just have to click with the primary mouse button, as opposed to click-drag when drawing a calligraphic stroke. As that mouse button usually also maps to pressing the tip of the stylus on a graphics tablet, anyone trying to write some calligraphy using such a setup just needs to press the stylus down and up to draw a dot. It’s as simple and intuitive as can be.

You can also hold down the Shift key while performing the same operation to create a larger dot. Larger, in this case, means exactly twice the diameter of a small dot.

The fact that I can easily tell you it’s exactly – not roughly – twice the diameter reveals the first problem with this new feature. Whereas calligraphic strokes are actually created as filled paths, these dots are created as circles. If you want to edit a stroke, double-clicking on it allows you to drag the individual nodes around. To do the same with a calligraphic dot, however, first requires a trip to the Path > Object to Path function. Without that step you’re limited to the changes that can be performed with the Circle tool.

By rendering a circle, your dot is a pure shape, with no lumps, bumps or character to it. It doesn’t matter what your Calligraphy Tool settings are: you could be using the Wiggle or Splotchy preset, or have some custom values to create a frantically random stroke, but your dots will always be circular. Using the Dip Pen preset for a classic calligraphy style, with angled lines that would suit a diamond-shaped dot? Nope, you still get a circle.

A far larger – or rather, smaller – problem is the size of the dots. They’re tiny! Even the large ones. Here are four examples: each is drawn using the Marker preset, with the width set to 25, 50, 75 and 100. In each case, I’ve drawn a single calligraphic stroke, followed by a standard dot, then a large dot.

As you might imagine, these don’t make for great titles with your punctuation marks, should you be using the Calligraphy Tool for, you know, actual calligraphy. In an example about as far from classic calligraphy as you can get, here’s some mouse-drawn text to demonstrate just how useless these dots would be for terminating a sentence.

It seems obvious to me that the dot sizes should be far closer to the width of the line. Perhaps 75% of the width for a small dot, and 150% for a large one. As it stands, this feature is mostly useless. You could scale the dots up after drawing, but they’ll still be pure circles with none of the character of your selected pen. And quite honestly, if you have to manually scale the circles anyway, then you may as well just draw them using the circle tool after completing the rest of your lines.

Circle Tool

On the subject of the circle tool, there’s been one small but welcome addition. As you probably know, you can move the round handles on a circle or ellipse to open the shape out, forming arcs (when the mouse is released inside the shape) and segments (when the mouse is released outside the shape). You can toggle between these, and a completely closed shape, from buttons in the tool control bar. The new addition is the ability to create chords – arcs where the two ends are joined with a straight line. There doesn’t appear to be an on-canvas method for doing this, but if you create an arc or segment, you can switch it to a chord using a new button on the tool control bar. It’s a small addition, but good to have nevertheless.

issue163/inkscape.1606584558.txt.gz · Dernière modification : 2020/11/28 18:29 de auntiee