issue161: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 | ||
issue161:inkscape [2020/10/04 08:38] – d52fr | issue161:inkscape [2020/10/06 17:40] (Version actuelle) – andre_domenech | ||
---|---|---|---|
Ligne 3: | Ligne 3: | ||
There is an “Object Properties” dialog in Inkscape, which is available from the right-click context menu, making it easy for new users to stumble upon. It allows you to set the ID, Label, Title and Description of your object, but, in practice, most of those items only have any real value when the SVG is loaded into a web browser and manipulated with JavaScript. Small JavaScript snippets can be entered directly into this dialog, via the Interactivity section at the bottom (see part 82 of this series).** | There is an “Object Properties” dialog in Inkscape, which is available from the right-click context menu, making it easy for new users to stumble upon. It allows you to set the ID, Label, Title and Description of your object, but, in practice, most of those items only have any real value when the SVG is loaded into a web browser and manipulated with JavaScript. Small JavaScript snippets can be entered directly into this dialog, via the Interactivity section at the bottom (see part 82 of this series).** | ||
- | Les très nombreuses façons de rendre quelque chose accidentellement invisible | + | Les très nombreuses façons de rendre quelque chose accidentellement invisible |
- | Dans Inkscape existe un dialogue « Propriétés de l' | + | Dans Inkscape existe un dialogue « Propriétés de l' |
**There are also a couple of checkboxes in this dialog that can easily tempt an unwary user. The “Lock” option stops you interacting with the object at all. Initially the object remains selected, and can be affected by keyboard shortcuts, but, as soon as the selection is removed – by clicking on the background or selecting another element – the object becomes completely inert. You can’t select it, move it, resize it, or delete it. The “Hide” checkbox also makes your object inert – but, in addition, it makes it completely invisible, even to the prying eyes of Outline View and its friends. | **There are also a couple of checkboxes in this dialog that can easily tempt an unwary user. The “Lock” option stops you interacting with the object at all. Initially the object remains selected, and can be affected by keyboard shortcuts, but, as soon as the selection is removed – by clicking on the background or selecting another element – the object becomes completely inert. You can’t select it, move it, resize it, or delete it. The “Hide” checkbox also makes your object inert – but, in addition, it makes it completely invisible, even to the prying eyes of Outline View and its friends. | ||
Ligne 13: | Ligne 13: | ||
Il y a aussi quelques cases à cocher dans ce dialogue, qui peuvent facilement tenter un utilisateur imprudent. L' | Il y a aussi quelques cases à cocher dans ce dialogue, qui peuvent facilement tenter un utilisateur imprudent. L' | ||
- | À l' | + | À l' |
**The correct way to unlock or unhide your object was actually to unlock or unhide all the objects in your drawing, via options in the Object menu. There was no UI (other than the XML editor) to let you unlock or unhide individual items, making these capabilities rather useless for managing the state of very specific parts of your drawing. | **The correct way to unlock or unhide your object was actually to unlock or unhide all the objects in your drawing, via options in the Object menu. There was no UI (other than the XML editor) to let you unlock or unhide individual items, making these capabilities rather useless for managing the state of very specific parts of your drawing. | ||
Ligne 19: | Ligne 19: | ||
With 0.91 came a new Objects dialog (Object > Objects… described in part 63). This lists every element in the drawing – including the hidden ones – with handy toggle buttons to (un)lock and (un)hide them. It’s a very familiar interface in other graphics software, and turns these properties into genuinely useful features. Personally, I think the checkboxes should have been removed from the Object Properties dialog to avoid further confusion, leaving them available only from the Objects dialog, but they still exist in the dialog to this day.** | With 0.91 came a new Objects dialog (Object > Objects… described in part 63). This lists every element in the drawing – including the hidden ones – with handy toggle buttons to (un)lock and (un)hide them. It’s a very familiar interface in other graphics software, and turns these properties into genuinely useful features. Personally, I think the checkboxes should have been removed from the Object Properties dialog to avoid further confusion, leaving them available only from the Objects dialog, but they still exist in the dialog to this day.** | ||
- | La façon correcte de déverrouiller ou de démasquer votre objet consistait en fait à déverrouiller ou démasquer tous les objets de votre dessin, | + | La façon correcte de déverrouiller ou de démasquer votre objet consistait en fait à déverrouiller ou démasquer tous les objets de votre dessin, |
- | Avec la 0.91 vinrent un nouveau dialogue Objets (Objets -> Objets.. décrite dans la partie 63). Celui-là fait la liste de tous les objets de votre dessin | + | Avec la 0.91 vinrent un nouveau dialogue Objets (Objets -> Objets.. décrite dans la partie 63). Celui-là fait la liste de tous les objets de votre dessin, y compris ceux qui sont cachés, avec des boutons de commutation |
**Inkscape v1.0 adds more UI niceties to work with these capabilities, | **Inkscape v1.0 adds more UI niceties to work with these capabilities, | ||
Ligne 43: | Ligne 43: | ||
Unhiding follows the same rules, but it’s obviously a little harder to find the correct spot to right-click on. As mentioned, none of the usual options for seeing invisible objects will work, so I hope you’ve kept track of where everything is in your drawing. To help with this treasure hunt just a little, the Unhide menu option will be enabled only if there is actually a hidden object below the mouse pointer, so you can be sure you’re in the right place. If you can’t find the object easily then a trip to the Objects dialog is probably a better use of your time than trying to play a hobbled version of Battleships against Inkscape.** | Unhiding follows the same rules, but it’s obviously a little harder to find the correct spot to right-click on. As mentioned, none of the usual options for seeing invisible objects will work, so I hope you’ve kept track of where everything is in your drawing. To help with this treasure hunt just a little, the Unhide menu option will be enabled only if there is actually a hidden object below the mouse pointer, so you can be sure you’re in the right place. If you can’t find the object easily then a trip to the Objects dialog is probably a better use of your time than trying to play a hobbled version of Battleships against Inkscape.** | ||
- | Les options Montrer et Déverrouiller font référence à « en dessous » dans leurs titres. Dans le cas présent, ça signifie « sous le pointeur de la souris ». Faites un clic droit sur un objet verrouillé et sélectionner | + | Les options Montrer et Déverrouiller font référence à « en dessous » dans leurs titres. Dans le cas présent, ça signifie « sous le pointeur de la souris ». Faites un clic droit sur un objet verrouillé et sélectionnez |
- | Montrer suit les mêmes règles, mais c'est évidemment un peu plus dur de trouver l' | + | Montrer suit les mêmes règles, mais c'est évidemment un peu plus dur de trouver l' |
**The Unlock menu option also becomes enabled and disabled based on whether or not there’s a locked item below the mouse pointer, but it gets confused by locked layers, becoming enabled when you right-click over any object in the locked layer, regardless of whether or not the object itself is locked. | **The Unlock menu option also becomes enabled and disabled based on whether or not there’s a locked item below the mouse pointer, but it gets confused by locked layers, becoming enabled when you right-click over any object in the locked layer, regardless of whether or not the object itself is locked. | ||
Ligne 53: | Ligne 53: | ||
L' | L' | ||
- | En dépit des ces problèmes mineurs, l' | + | En dépit des ces problèmes mineurs, l' |
**Another small new feature is even more welcome, at least by me: inverse clipping. This is an omission from the SVG specs which has always frustrated me, not least because it solves common problems trivially, but is no harder for a browser or graphics program to implement than the standard clipping routines. For lack of an extra paragraph or two in the spec, users have been forced to spend time reinventing inverse clipping with their own complex paths time and time again. | **Another small new feature is even more welcome, at least by me: inverse clipping. This is an omission from the SVG specs which has always frustrated me, not least because it solves common problems trivially, but is no harder for a browser or graphics program to implement than the standard clipping routines. For lack of an extra paragraph or two in the spec, users have been forced to spend time reinventing inverse clipping with their own complex paths time and time again. | ||
Ligne 59: | Ligne 59: | ||
I covered clipping all the way back in part 13 of this series. If you’re a very long-term reader, you may recall that this series began with a few articles to help you get to grips with the basics of Inkscape by drawing a snowman. By part 13 it was time to adorn him with a scarf.** | I covered clipping all the way back in part 13 of this series. If you’re a very long-term reader, you may recall that this series began with a few articles to help you get to grips with the basics of Inkscape by drawing a snowman. By part 13 it was time to adorn him with a scarf.** | ||
- | Une autre petite nouvelle fonctionnalité est même encore plus bienvenue, au moins pour moi : le découpage inverse. C'est une omission des specifs SVG qui m'a toujours frustré ; non seulement parce qu' | + | Une autre petite nouvelle fonctionnalité est encore plus bienvenue, au moins pour moi : le découpage inverse. C'est une omission des specifs SVG qui m'a toujours frustré ; non seulement parce qu' |
- | J'ai tout expliqué du découpage dans la partie 13 de cette série. Si vous nous lisez depuis longtemps, vous vous rapellez | + | J'ai tout expliqué du découpage dans la partie 13 de cette série. Si vous lisez la revue depuis longtemps, vous vous rappelez |
**I began by drawing a scarf in its entirety, including the part that would normally be hidden behind the snowman’s head (“neck” seems a little too generous a term in this case). I first demonstrated how a simple clipping path (in green) wouldn’t do the job – it would leave the back of the scarf visible, whilst hiding the part you actually wanted to see. | **I began by drawing a scarf in its entirety, including the part that would normally be hidden behind the snowman’s head (“neck” seems a little too generous a term in this case). I first demonstrated how a simple clipping path (in green) wouldn’t do the job – it would leave the back of the scarf visible, whilst hiding the part you actually wanted to see. | ||
Ligne 67: | Ligne 67: | ||
It’s a classic approach: first show the audience what doesn’t work, then follow up with a demonstration of what does work. In this case, it’s an “inverse clipping mask”, created by using Path > Difference to cut the desired shape out of a larger enclosing rectangle. The resultant complex path is then used for clipping, giving the desired result.** | It’s a classic approach: first show the audience what doesn’t work, then follow up with a demonstration of what does work. In this case, it’s an “inverse clipping mask”, created by using Path > Difference to cut the desired shape out of a larger enclosing rectangle. The resultant complex path is then used for clipping, giving the desired result.** | ||
- | J'ai commencé par dessiner intégralement un foulard, y compris la partie que serait normalement cachée par la tête du bonhomme de neige. (« cou » semble un mot trop généreux dans notre cas). J' | + | J'ai commencé par dessiner intégralement un foulard, y compris la partie que serait normalement cachée par la tête du bonhomme de neige. (« cou » semble un mot trop généreux dans notre cas). J' |
- | C'est une approche classique : d' | + | C'est une approche classique : d' |
**It works, but it’s not really beginner friendly. When a new user just wants to cut the center out of a circle to make a donut, being forced to confront Boolean operations and bounding boxes makes Inkscape seem rather unfriendly. If the SVG Working Group had only added an “inverse” parameter to clipping paths all those years ago, Inkscape probably would have included this feature from the earliest versions. As it is, we’ve had to wait until now – and it’s still included only as a user-friendly addition by the developers, not because of any change to the SVG specs itself (this option was proposed for SVG2, but didn’t make the cut, much to my ongoing frustration). | **It works, but it’s not really beginner friendly. When a new user just wants to cut the center out of a circle to make a donut, being forced to confront Boolean operations and bounding boxes makes Inkscape seem rather unfriendly. If the SVG Working Group had only added an “inverse” parameter to clipping paths all those years ago, Inkscape probably would have included this feature from the earliest versions. As it is, we’ve had to wait until now – and it’s still included only as a user-friendly addition by the developers, not because of any change to the SVG specs itself (this option was proposed for SVG2, but didn’t make the cut, much to my ongoing frustration). | ||
Ligne 75: | Ligne 75: | ||
So how does this new feature work in Inkscape? As with many “extensions” to the basic SVG capabilities, | So how does this new feature work in Inkscape? As with many “extensions” to the basic SVG capabilities, | ||
- | Ça marche, mais ce n'est pas vraiment facile pour un débutant. Quand un nouvel utilisateur veut juste enlever le centre d'un cercle pour en faire un donut, se trouver contronté à des opérations booléennes et des des boîtes englobantes rend Inkscape plutôt inhospitalier. Si, il y a bien longtemps, le groupe de travail du SVG avait juste ajouté le paramètre « inverse » à la découpe des chemins, Inkscape aurait probablement inclus cette focntionnalité | + | Ça marche, mais ce n'est pas vraiment facile pour un débutant. Quand un nouvel utilisateur veut juste enlever le centre d'un cercle pour en faire un donut, se trouver contronté à des opérations booléennes et des boîtes englobantes rend Inkscape plutôt inhospitalier. Si, il y a bien longtemps, le groupe de travail du SVG avait juste ajouté le paramètre « inverse » à la découpe des chemins, Inkscape aurait probablement inclus cette fonctionnalité |
- | Alors, comment marche cette fonctionnalité dans Inkscape ? Comme avec de nomvreuses | + | Alors, comment marche cette nouvelle |
**There’s no real trick to it, actually. You just create a path (or an object that can be converted to a path) that encloses the part of the image you want to clip away. Then select both the clipping path and the object or group to be clipped and you’re ready to proceed. Whereas the option for a normal clip can be found on the context menu, it takes a trip to the Object > Clip > Set Inverse (LPE) option to trigger the inverse mode. And that’s it. No complex paths or bounding boxes. Just a simple interface for what should be a simple task. | **There’s no real trick to it, actually. You just create a path (or an object that can be converted to a path) that encloses the part of the image you want to clip away. Then select both the clipping path and the object or group to be clipped and you’re ready to proceed. Whereas the option for a normal clip can be found on the context menu, it takes a trip to the Object > Clip > Set Inverse (LPE) option to trigger the inverse mode. And that’s it. No complex paths or bounding boxes. Just a simple interface for what should be a simple task. | ||
Ligne 83: | Ligne 83: | ||
Internally, of course, complex paths and bounding boxes still come into play. You can see this by switching to the Node tool (F2), where you’ll see that Inkscape has automatically created a complex path consisting of your clipping path and another that hugs the bounding box of your selected object. As usual, you can edit the nodes and lines of these paths for an instant effect on the clipped object – ideal for fine-tuning the resultant shape to make sure your scarf provides a nice, snug fit.** | Internally, of course, complex paths and bounding boxes still come into play. You can see this by switching to the Node tool (F2), where you’ll see that Inkscape has automatically created a complex path consisting of your clipping path and another that hugs the bounding box of your selected object. As usual, you can edit the nodes and lines of these paths for an instant effect on the clipped object – ideal for fine-tuning the resultant shape to make sure your scarf provides a nice, snug fit.** | ||
- | Ici, il n'y a pas vraiment | + | En fait, ce n'est pas vraiment |
- | En interne, bien sûr, des chemins complexes et des boîtes englobantes entrent en jeu. Vous pouvez le voir en passant sur ll'outil Nœuds (F2), où vous verrez qu' | + | En interne, bien sûr, des chemins complexes et des boîtes englobantes entrent en jeu. Vous pouvez le voir en passant sur l'outil Nœuds (F2), où vous verrez qu' |
**There’s also a new inverse mode for masks, though its behaviour is not so obvious. Masking was covered in part 14. It’s basically similar to clipping, but uses the color of each pixel in the mask to determine the opacity of that part of the masked object. White parts remain visible, black or transparent parts are made transparent, | **There’s also a new inverse mode for masks, though its behaviour is not so obvious. Masking was covered in part 14. It’s basically similar to clipping, but uses the color of each pixel in the mask to determine the opacity of that part of the masked object. White parts remain visible, black or transparent parts are made transparent, | ||
This particular result could obviously be produced simply by blurring a colored ellipse, but in a real example you might have a far more complex shape in your mask, or the object you’re masking might be a group made up of lots of different elements.** | This particular result could obviously be produced simply by blurring a colored ellipse, but in a real example you might have a far more complex shape in your mask, or the object you’re masking might be a group made up of lots of different elements.** | ||
+ | |||
+ | Un nouveau mode existe aussi pour les masques, bien que son comportement ne soit pas évident. Les masques ont été traités en partie 14. C'est en gros similaire à la découpe, mais la couleur de chaque pixel du masque est utilisée pour déterminer l' | ||
+ | |||
+ | Ce résultat particulier peut être évidemment obtenu simplement en floutant une ellipse colorée, mais dans un vrai exemple, vous pourriez avoir une forme largement plus compliquée comme masque, ou l' | ||
**Once again, the SVG spec offers no inverse version of a mask. But Inkscape provides such a feature in v1.0, so to cut a hole in the colored rectangle, surely just requires us to use the Object > Mask > Set Inverse (LPE) option, right? Of course not! That would be far too sensible. Instead the result is just a colored rectangle, as though no mask even existed. | **Once again, the SVG spec offers no inverse version of a mask. But Inkscape provides such a feature in v1.0, so to cut a hole in the colored rectangle, surely just requires us to use the Object > Mask > Set Inverse (LPE) option, right? Of course not! That would be far too sensible. Instead the result is just a colored rectangle, as though no mask even existed. | ||
What’s happening here is a discussion for another article – probably once I get round to a further examination of the new LPEs in version 1.0. Suffice to say that we can get the effect we’re after by drawing the mask in black rather than white, then using the Set Inverse option.** | What’s happening here is a discussion for another article – probably once I get round to a further examination of the new LPEs in version 1.0. Suffice to say that we can get the effect we’re after by drawing the mask in black rather than white, then using the Set Inverse option.** | ||
+ | |||
+ | Une fois encore, la spécif SVG n' | ||
+ | |||
+ | Ce qui se passe ici fera l' | ||
**The irony here is that we’ve had to manually invert the color of the mask in order to use the automatic feature for inverting the mask! There is some logic to this, but it’s tied up to the way the LPE operates, and the default settings that get applied when you select this option. For now, I’ll be sticking to creating inverse masks by hand, the old fashioned way, but I can definitely see a lot of inverse clipping paths in my future. | **The irony here is that we’ve had to manually invert the color of the mask in order to use the automatic feature for inverting the mask! There is some logic to this, but it’s tied up to the way the LPE operates, and the default settings that get applied when you select this option. For now, I’ll be sticking to creating inverse masks by hand, the old fashioned way, but I can definitely see a lot of inverse clipping paths in my future. | ||
There’s one final caveat to using these new features: because they’re implemented as Live Path Effects, they won’t work directly on bitmap images. Note the word “directly” – these LPEs can also be used on groups, even if the group contains only a single bitmap image. So, if you really want to poke a hole through a treasured family photo, just put it into its own group, then get going with the inverse clip or mask. I usually advise putting a bitmap into a single-object group anyway, as it opens up some other creative possibilities I’ve covered in the past, so it’s perhaps worth getting into the habit of always grouping a bitmap as soon as you place it in your drawing.** | There’s one final caveat to using these new features: because they’re implemented as Live Path Effects, they won’t work directly on bitmap images. Note the word “directly” – these LPEs can also be used on groups, even if the group contains only a single bitmap image. So, if you really want to poke a hole through a treasured family photo, just put it into its own group, then get going with the inverse clip or mask. I usually advise putting a bitmap into a single-object group anyway, as it opens up some other creative possibilities I’ve covered in the past, so it’s perhaps worth getting into the habit of always grouping a bitmap as soon as you place it in your drawing.** | ||
+ | |||
+ | L' | ||
+ | |||
+ | Il y a un dernier problème dans l' | ||
issue161/inkscape.1601793537.txt.gz · Dernière modification : 2020/10/04 08:38 de d52fr