issue130:inkscape
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
issue130:inkscape [2018/03/02 19:13] – d52fr | issue130:inkscape [2018/03/08 18:58] (Version actuelle) – andre_domenech | ||
---|---|---|---|
Ligne 2: | Ligne 2: | ||
The program that performs the modification could be anything from a small shell script to a fully blown, compiled C++ application. In practice, most take the form of simple Python scripts. Because the program just needs to manipulate a text document, just about any language could be used, but the output must still be a well-formed SVG file, so using a language with good XML libraries certainly makes the job of writing an extension easier.** | The program that performs the modification could be anything from a small shell script to a fully blown, compiled C++ application. In practice, most take the form of simple Python scripts. Because the program just needs to manipulate a text document, just about any language could be used, but the output must still be a well-formed SVG file, so using a language with good XML libraries certainly makes the job of writing an extension easier.** | ||
+ | |||
+ | Avec, derrière nous, les 69 articles précédents de cette série, il est évident qu' | ||
+ | |||
+ | Le programme qui réalise la modification peut être n' | ||
**Because extensions are external programs, they can be shipped independently of Inkscape. If a manufacturer wants to create an extension to convert documents into the right format for their plotter or vinyl cutter, they can do so. With the right programming skills, users can even create their own extensions. But before considering third-party extensions, it’s worth looking at the ones that ship with Inkscape by default. | **Because extensions are external programs, they can be shipped independently of Inkscape. If a manufacturer wants to create an extension to convert documents into the right format for their plotter or vinyl cutter, they can do so. With the right programming skills, users can even create their own extensions. But before considering third-party extensions, it’s worth looking at the ones that ship with Inkscape by default. | ||
Extensions can be found, unsurprisingly, | Extensions can be found, unsurprisingly, | ||
+ | |||
+ | Comme les extensions sont des programmes externes, ils peuvent être livrés indépendamment d' | ||
+ | |||
+ | Les extensions peuvent être trouvées, sans surprise, sous le menu Extensions. Là, vous trouverez d' | ||
**If you take a couple of minutes to scroll through the available extensions, you’ll realise that there are a lot of them. Over 150 of them on my default installation of 0.92! That should keep this column full for the next few years, so let’s press on with the first one… | **If you take a couple of minutes to scroll through the available extensions, you’ll realise that there are a lot of them. Over 150 of them on my default installation of 0.92! That should keep this column full for the next few years, so let’s press on with the first one… | ||
…or maybe not. I’m not so cruel as to go through each and every extension in detail, but will pick out a few examples in order to show the common UI features that you’ll find. Since extensions are just normal programs, they can accept parameters, in the same way that running a tool on the command-line often requires additional arguments. The exact arguments that are needed are defined in a configuration file for the extension (this also includes other details, such as which sub-menu to put the launcher in). This file defines not only the names of any additional arguments, but also the type of value the argument expects. This allows Inkscape to generate a simple dialog, ensuring that the right type of UI widget is used for each parameter. You can tell in advance if an extension will prompt for additional parameters by looking at its name in the menu: as is the convention in computer programs, entries ending in an ellipsis (“…”) will display a dialog, while those without will have an immediate effect.** | …or maybe not. I’m not so cruel as to go through each and every extension in detail, but will pick out a few examples in order to show the common UI features that you’ll find. Since extensions are just normal programs, they can accept parameters, in the same way that running a tool on the command-line often requires additional arguments. The exact arguments that are needed are defined in a configuration file for the extension (this also includes other details, such as which sub-menu to put the launcher in). This file defines not only the names of any additional arguments, but also the type of value the argument expects. This allows Inkscape to generate a simple dialog, ensuring that the right type of UI widget is used for each parameter. You can tell in advance if an extension will prompt for additional parameters by looking at its name in the menu: as is the convention in computer programs, entries ending in an ellipsis (“…”) will display a dialog, while those without will have an immediate effect.** | ||
+ | |||
+ | Si vous prenez quelques minutes pour naviguer dans les extensions disponibles, | ||
+ | |||
+ | ... ou peut-être pas. Je ne suis pas assez cruel pour vous faire passer par chaque extension en détail, mais je vais prendre quelques exemples pour vous montrer les caractéristiques communes de l' | ||
**As an example of an extension with no UI, let’s consider the Color > Brighter extension. As you might expect this makes the selected objects brighter, which it does by altering their fill and stroke colors – albeit by only small amounts at a time. Here’s a before-and-after image, having applied this extension many, many times to the object on the right: | **As an example of an extension with no UI, let’s consider the Color > Brighter extension. As you might expect this makes the selected objects brighter, which it does by altering their fill and stroke colors – albeit by only small amounts at a time. Here’s a before-and-after image, having applied this extension many, many times to the object on the right: | ||
Because this extension has no UI, its effect takes place immediately, | Because this extension has no UI, its effect takes place immediately, | ||
+ | |||
+ | Comme exemple d' | ||
+ | |||
+ | Parce que cette extension n'a pas d'UI, son effet est immédiat ; aussi, vous pourriez penser que l' | ||
**A better approach to achieve a similar effect is to use the Color > HSL Adjust… extension. As the ellipsis indicates, this extension displays a user interface, so you can adjust the amount of brightening you wish to apply before the extension actually runs. Furthermore, | **A better approach to achieve a similar effect is to use the Color > HSL Adjust… extension. As the ellipsis indicates, this extension displays a user interface, so you can adjust the amount of brightening you wish to apply before the extension actually runs. Furthermore, | ||
On the surface it might seem like the “Live Preview” option is a bit of a no-brainer. Why would you ever not want that checked? But consider that each extension is a separate program that needs to be launched, receive a copy of the entire Inkscape document, process it, return the entire document back to Inkscape, and then close. And this process will happen for every little change you make to the settings in the dialog. With a large document or a complex extension it can take several seconds, or even minutes, to preview the changes. Un-ticking the checkbox lets you change several settings at once without this overhead. If you already know the values you need to enter, or just want to preview after making a number of changes, being able to turn off this checkbox is vital.** | On the surface it might seem like the “Live Preview” option is a bit of a no-brainer. Why would you ever not want that checked? But consider that each extension is a separate program that needs to be launched, receive a copy of the entire Inkscape document, process it, return the entire document back to Inkscape, and then close. And this process will happen for every little change you make to the settings in the dialog. With a large document or a complex extension it can take several seconds, or even minutes, to preview the changes. Un-ticking the checkbox lets you change several settings at once without this overhead. If you already know the values you need to enter, or just want to preview after making a number of changes, being able to turn off this checkbox is vital.** | ||
+ | |||
+ | Une meilleure approche pour réaliser un effet similaire est d' | ||
+ | |||
+ | À première vue, il pourrait sembler que l' | ||
**This dialog also shows a few other items worth noting. Inkscape has displayed the boolean parameters as checkboxes, and the numeric parameters as the GTK3 style hybrid spinbox and slider that is used elsewhere in the program. Furthermore, | **This dialog also shows a few other items worth noting. Inkscape has displayed the boolean parameters as checkboxes, and the numeric parameters as the GTK3 style hybrid spinbox and slider that is used elsewhere in the program. Furthermore, | ||
But Inkscape’s selection of UI widgets is limited to a few basic types, and doesn’t even allow the developer to specify a template or regular expression to validate free-text fields. For most extensions, this isn’t a problem, but some do have specific requirements for the data that you enter into their fields. For example, Render > Function Plotter… lets you draw mathematical curves by entering a function into a text field. Typing “sin(x*7)” and setting the checkbox to use polar coordinates, | But Inkscape’s selection of UI widgets is limited to a few basic types, and doesn’t even allow the developer to specify a template or regular expression to validate free-text fields. For most extensions, this isn’t a problem, but some do have specific requirements for the data that you enter into their fields. For example, Render > Function Plotter… lets you draw mathematical curves by entering a function into a text field. Typing “sin(x*7)” and setting the checkbox to use polar coordinates, | ||
+ | |||
+ | Ce dialogue montre aussi quelques autres éléments qui méritent d' | ||
+ | De plus, les réglettes ont différentes étendues, l' | ||
+ | |||
+ | Mais la sélection par Inkscape des éléments de l'UI est limité à quelques types de base et ne permet même pas au développeur de spécifier un modèle ou une expression régulière pour valider des champs en texte libre. Pour la plupart des extensions, ce n'est pas un problème, mais certaines ont des exigences spécifiques pour les données que vous saisissez dans leurs champs. Par exemple, Rendu > Traceur de fonction... vous permet de tracer des courbes mathématiques en entrant une fonction dans un champ de texte. En tapant « sin(x*7) » et en cochant la case pour utiliser des coordonnées polaires, par exemple, cette fleur à sept pétales apparaît. | ||
**Type an invalid function into the input field, however, and you’re likely to see something like this instead: | **Type an invalid function into the input field, however, and you’re likely to see something like this instead: | ||
Ligne 30: | Ligne 55: | ||
Whilst experimenting with different settings in an extension’s dialog, you’ll probably discover that you can’t zoom or pan the canvas, or change the selected objects. This is particularly frustrating when using something like the Function Plotter, as some combinations of parameters can lead to shapes being drawn that are too large or small for the current zoom level. The cause of this restriction is actually the preview mode – simply un-tick the Live Preview checkbox and you’ll be able to make changes on the canvas, before ticking it again to restore the preview.** | Whilst experimenting with different settings in an extension’s dialog, you’ll probably discover that you can’t zoom or pan the canvas, or change the selected objects. This is particularly frustrating when using something like the Function Plotter, as some combinations of parameters can lead to shapes being drawn that are too large or small for the current zoom level. The cause of this restriction is actually the preview mode – simply un-tick the Live Preview checkbox and you’ll be able to make changes on the canvas, before ticking it again to restore the preview.** | ||
+ | |||
+ | Cependant, si vous entrez une fonction invalide dans le champ de saisie, vous verrez à la place probablement quelque chose comme ceci : | ||
+ | |||
+ | Le problème est qu' | ||
+ | |||
+ | Une autre chose à guetter est l' | ||
+ | |||
+ | Tout en essayant différents réglages dans le dialogue de l' | ||
**Once you’ve finished playing with the Function Plotter, it’s worth exploring some of the other extensions in the Render sub-menu. Given the ubiquity of barcode scanning software on phones now, the Render > Barcode > QR Code… extension could be a useful tool when designing a poster, flyer or other promotional material. | **Once you’ve finished playing with the Function Plotter, it’s worth exploring some of the other extensions in the Render sub-menu. Given the ubiquity of barcode scanning software on phones now, the Render > Barcode > QR Code… extension could be a useful tool when designing a poster, flyer or other promotional material. | ||
Ligne 35: | Ligne 68: | ||
This menu also includes extensions to draw calendars, grids (including logarithmic and polar grids, which Inkscape can’t do natively), printer’s registration and color marks, and charts (though you’re probably better off using a spreadsheet or dedicated graphing program for anything other than the simplest of charts). On the more frivolous side of things, there are also extensions to create spirograph-style images, simple fractal trees, and fake 3D objects.** | This menu also includes extensions to draw calendars, grids (including logarithmic and polar grids, which Inkscape can’t do natively), printer’s registration and color marks, and charts (though you’re probably better off using a spreadsheet or dedicated graphing program for anything other than the simplest of charts). On the more frivolous side of things, there are also extensions to create spirograph-style images, simple fractal trees, and fake 3D objects.** | ||
- | The last extension to look at this month is one that you’ll find either absolutely invaluable, or you’ll probably never need to use at all. It’s also one of the extensions with a less than descriptive name: Render > Hershey Text. What this extension does is to render some text using a so-called Hershey font. At first glance, this might not look terribly different from normal Inkscape text in a similar font: | + | Une fois que vous avez fini de jouer avec le Traceur de fonctions, une exploration de quelques autres extensions du sous-menu Rendu vaut le détour. Étant donné l' |
+ | |||
+ | Ce menu inclut aussi des extensions pour dessiner des calendriers, | ||
+ | |||
+ | **The last extension to look at this month is one that you’ll find either absolutely invaluable, or you’ll probably never need to use at all. It’s also one of the extensions with a less than descriptive name: Render > Hershey Text. What this extension does is to render some text using a so-called Hershey font. At first glance, this might not look terribly different from normal Inkscape text in a similar font: | ||
Zoom in, however, and things start to look a little different. | Zoom in, however, and things start to look a little different. | ||
Switch them both to a minimal stroke, and no fill, and the difference really becomes apparent:** | Switch them both to a minimal stroke, and no fill, and the difference really becomes apparent:** | ||
+ | |||
+ | La dernière extension à regarder ce mois-ci en est une que vous trouverez absolument inestimable ou que vous ne devrez sans doute jamais utiliser. C'est aussi une des extensions avec un nom bien peu descriptif : Rendu > Texte Hershey. Ce que fait cette extension est de rendre du texte en utilisant une police appelée Hershey. À première vue, celle-ci ne paraît pas vraiment différente d'un texte normal d' | ||
+ | |||
+ | Cependant, agrandissez et les choses commencent à paraître un peu différentes. | ||
+ | |||
+ | Passez-les à la taille de contour minimale et sans fond, et la différence apparaît vraiment. | ||
**As you can see, the normal text has a clean and simple outline with curves where needed. Conversely the Hershey text is made up of straight lines that sometimes overlap awkwardly – and just what is that little square doing in the dot on the i? The answer is that Hershey text is intended for use with pen plotters, laser engravers, and similar devices. | **As you can see, the normal text has a clean and simple outline with curves where needed. Conversely the Hershey text is made up of straight lines that sometimes overlap awkwardly – and just what is that little square doing in the dot on the i? The answer is that Hershey text is intended for use with pen plotters, laser engravers, and similar devices. | ||
Suppose you’re preparing a file for use with a laser engraver, but you want some solid text. Such devices really care only about outlines, not fills, so using a normal font would just result in an outline version of your text. If you wanted to fill it, you would need to draw a hatch pattern inside the text, resulting in the laser going over adjacent parts of your design repeatedly. At best, this might cost you more, as the job will take a lot longer. At worst you might find that these parts of the design become excessively scorched by keeping the beam in the same area for so long.** | Suppose you’re preparing a file for use with a laser engraver, but you want some solid text. Such devices really care only about outlines, not fills, so using a normal font would just result in an outline version of your text. If you wanted to fill it, you would need to draw a hatch pattern inside the text, resulting in the laser going over adjacent parts of your design repeatedly. At best, this might cost you more, as the job will take a lot longer. At worst you might find that these parts of the design become excessively scorched by keeping the beam in the same area for so long.** | ||
+ | |||
+ | Comme vous pouvez le voir, le texte normal a un tracé simple et clair avec des courbures là où il faut. À l' | ||
+ | |||
+ | Supposez que vous préparez un fichier à utiliser sur un graveur laser, mais que vous voulez du texte plein. De tels appareils ne s' | ||
**Hershey text, on the other hand, is not designed to be used with a fill. Rather the letters should be left as outlines, with the thickness of the beam or pen being used to provide any “fill” as the outline is drawn. With that knowledge, the little square makes a lot more sense. | **Hershey text, on the other hand, is not designed to be used with a fill. Rather the letters should be left as outlines, with the thickness of the beam or pen being used to provide any “fill” as the outline is drawn. With that knowledge, the little square makes a lot more sense. | ||
If you print your designs using only an inkjet, laser printer, or even a professional printing press, you’ll be fine using normal text. But if you decide to use one of the increasing number of laser cutting and engraving bureaus that accept Inkscape files, or if you purchase one of the hobbyist pen plotters that work with the program, this little extension could save you a lot of time, money or ink.** | If you print your designs using only an inkjet, laser printer, or even a professional printing press, you’ll be fine using normal text. But if you decide to use one of the increasing number of laser cutting and engraving bureaus that accept Inkscape files, or if you purchase one of the hobbyist pen plotters that work with the program, this little extension could save you a lot of time, money or ink.** | ||
+ | |||
+ | D' | ||
+ | |||
+ | Si vous imprimez vos dessins en utilisant une imprimante à jet d' |
issue130/inkscape.1520014398.txt.gz · Dernière modification : 2018/03/02 19:13 de d52fr