Inkscape.org
Beginners' Questions "Smarter" double outlines of text
  1. #1
    jgalak jgalak @jgalak

    I am working on a file where I have a short bit of text that needs a double outline (a light and a dark, so it pops on any background).  For the "inner" outline, I just set the stroke to one of my outline colors (let's say the light one).  For the "outer" outline, I make a copy in place, change the stroke and fill to black, push it below the original text, and then use dynamic offset to make it a big bigger.

    Works fine, except when I need to change the text (as I do in this project), I have to redo the same process again.  Is there any solution to this?  Some way to link the text in the main text object to the text in the outline object and have it work automatically?  Or some other technique for doing this in an easier fashion?

  2. #2
    Xav Xav @Xav👹

    I've used two different approaches to achieve this in the past:

    1) Create a filter that draws the two outlines. This has the advantage of only requiring you to have a single object to manage, but creating the filter is tricky stuff if you're not familiar with how they work, and the idiosyncracies of Inkscape's UI.

    2) 'Unset' the stroke on your text, then clone it twice. You can then set the stroke on each clone independently: give the a thin stroke to the 'inner' and a thick stroke to the 'outer' then stack them to get the effect you want. You can edit the original text and the clones will update accordingly.

     

    For the second method, you can hide the original text object off the page, behind the other objects or in a hidden layer. I usually put it behind the clones, and bring it to the front when I need to edit it. Group the parent and both clones together to make it easier to move them around as one.

  3. #3
    jgalak jgalak @jgalak
    Xav

    1) Create a filter that draws the two outlines. This has the advantage of only requiring you to have a single object to manage, but creating the filter is tricky stuff if you're not familiar with how they work, and the idiosyncracies of Inkscape's UI.

    Yeah, while I've used Inkscape for a while, I've not used filters before, so have no idea how to do this :)

    2) 'Unset' the stroke on your text, then clone it twice. You can then set the stroke on each clone independently: give the a thin stroke to the 'inner' and a thick stroke to the 'outer' then stack them to get the effect you want. You can edit the original text and the clones will update accordingly.

    Interesting, I'll give that a try.  Thanks!

  4. #4
    jgalak jgalak @jgalak

    Thank you, option 2 worked briliantly.

    Hiding wasn't an issue, since I was using the "page" size as a mask anyway, and only exporting bitmaps that were withing the page.  So original just got placed outside the page.

  5. #5
    Xav Xav @Xav👹

    Here's an example of using filters for this. If you look at the filter editor it looks complex, but boils down to two sections, each of three parts:

    1) A flood filter to set the outline colour. Ideally this could connect to the 'Fill Paint' input so the outer outline would match the fill of the text (or the 'Stroke paint' for the inner outline), but that doesn't work in Inkscape. Instead the colour is manually set in the filter.

    2) A morphology filter that takes the alpha of the text (i.e. a silhouette of it), and grows it by a few pixels using 'dilate' mode. The amount is set in the filter - the first instance is larger, as it produces the outer outline; the second is smaller for the inner outline.

    3) A composite filter that basically clips the flood filter to the size and shape of the morphology output, resulting in some slightly grown text, filled with colour.

     

    These three parts are repeated for each outline required - twice in this case, but if you use several repeats with large dilation and gaudy flood colours you can get some groovy 70s effects. Finally a merge filter stacks all the sections together, and puts the original text object on top.

     

    The result is not as neat as the cloning method, but can work well for certain effects and fonts, with the advantage of only having one object to deal with, and being able to reuse the filter on multiple objects (and not necessarily just text) if needed.

     

    Text Outline Filter
Inkscape Inkscape.org Inkscape Forum Beginners' Questions "Smarter" double outlines of text