summaryrefslogtreecommitdiffstats
path: root/svgio/qa/cppunit/data/maskText.svg
blob: 7405f6a5697b3112199823ca16adb2da2d389356 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?xml version="1.0"?>
<svg width="200" height="80"
     viewBox="0 0 200 80" version="1.1"
     xmlns="http://www.w3.org/2000/svg"
     xmlns:xlink="http://www.w3.org/1999/xlink">

    <defs>
        <mask id="myMask"
              x="0" y="0" width="200" height="80">
            <rect x="0" y="0" width="100" height="80" fill="white"/>
        </mask>

        <text id="Text" x="100" y="48"
              font-size="26" font-weight="bold" text-anchor="middle">
            Black White
        </text>
    </defs>

    <!-- Draw black rectangle in the background -->
    <rect x="100" y="10" width="95" height="60"  />

    <!-- Draw the text string twice. First, the white text without mask.
         Second, the black text with the mask applied-->
    <use xlink:href="#Text" fill="white"/>
    <use xlink:href="#Text" fill="black" mask="url(#myMask)"/>
</svg>