Inkscape.org
Beginners' Questions "transparent" through lower objects?
  1. #1
    Kyler Laird Kyler Laird @kylerlaird

    I have text on top of some shapes.  I want the fill of the text to not only be transparent, but also create a "hole" through any underlying shapes.

    For example, let's say there's text on top of green boxes, with the resulting SVG used on a stainless steel surface.  I want the text to have "stainless steel" fill (and black stroke).  If I use "X" fill, the green boxes will come through.

    Is there an easy way to do this or do I have to resort to path manipulation?  For now, I'm converting to a bitmap and then using the fill color for transparency.  I'd prefer an SVG solution.

  2. #2
    Freerk Holtes Freerk Holtes @Freerk

    That is a relatively easy boolean operation

    If you select the text and the green box and go to Path > Difference (shortcut "Ctrl" + "-") it will cut out the shape of the text from the green box.

     

  3. #3
    Kyler Laird Kyler Laird @kylerlaird

    Thank you, Freek.  I was hoping to avoid doing that so that I can easily move/change the text without having to go through path manipulation each time.  Looks like it's time to script...

  4. #4
    Kyler Laird Kyler Laird @kylerlaird

    Oops!  Sorry, *Freerk*.

  5. #5
    Freerk Holtes Freerk Holtes @Freerk
    *

    There is a way to do this while keeping the ability to change the text allthough I find it very wonky, meaning it doesn't always update properly.

    Select the text and hit ctrl + C
    Select the green box  go to Path > Path Effects and hit the + button there,

    Select Boolean operation

    In the Boolean operation menu select as "operand path" the option "link to item" and select "difference" in the drop down for Operation.

  6. #6
    Kyler Laird Kyler Laird @kylerlaird

    The linked Boolean Operation feels like a workable solution but you're right; it's wonky.  In my Inkscape 1.1, it has wild behaviors with some of the paths.

    Still looking for a simple solution...

  7. #7
    Kyler Laird Kyler Laird @kylerlaird

    Inkscape 1.2 fixes the funky Boolean Operation behavior.  That was a good upgrade.

  8. #8
    Kyler Laird Kyler Laird @kylerlaird

    Here are the steps I used:

    1. Select text.
    2. Set text's fill to "X".
    3. Control-C to copy.
    4. Control-D to duplicate.
    5. Select underlying shape.
    6. Perform boolean operation as described by @Freerk in comment #5.

    The reason that I duplicated the text after selecting it is so that I would get the stroke after using the other copy of the text to make the hole.

    This is still not a simple, easily modified solution, but it works for now.

  9. #9
    Tyler Durden Tyler Durden @TylerDurden

    Why script...?  What's the big picture here? 

  10. #10
    Kyler Laird Kyler Laird @kylerlaird

    There's no way to say "Make the fill of this text/object transparent through whatever is under it."  Getting the effect takes multiple steps each time the text is changed.  A script would make it easy to perform those steps.

    Fortunately I solved the immediate need that I have.

Inkscape Inkscape.org Inkscape Forum Beginners' Questions "transparent" through lower objects?