File: textProperties2.svg

package info (click to toggle)
batik 1.18%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 28,972 kB
  • sloc: java: 192,233; xml: 19,449; javascript: 1,276; sh: 85; makefile: 5
file content (201 lines) | stat: -rw-r--r-- 9,243 bytes parent folder | download
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">

<!--

   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

-->
<!-- ========================================================================= -->
<!-- Test description here                                                     -->
<!--                                                                           -->
<!-- @author bill.haneman@ireland.sun.com                                      -->
<!-- @version $Id$                                                             -->
<!-- ========================================================================= -->
<?xml-stylesheet type="text/css" href="../../resources/style/test.css" ?>

<svg width="450" height="500" viewBox="0 0 450 500"
  xmlns="http://www.w3.org/2000/svg" 
  xmlns:xlink="http://www.w3.org/1999/xlink" >

     <style type="text/css"><![CDATA[
       .Caption { font-size: 8; font-family: dialog; font-weight: normal;
                  font-style: normal; stroke: none; stroke-width: 0; 
                  fill: black } 
       text > tspan { fill: blue; }
       text > tspan > tspan { fill: purple; }]]>
     </style>

    <script type="text/ecmascript"><![CDATA[
       var inRegard=false;
       var root;
       function regardStart() {
          inRegard = true;
          doChange();
       }
       function doSet(idx, attr, tv, tsv, ttsv) {
         var t   = root.getElementById("t"+idx);
         var ts  = root.getElementById("ts"+idx);
         var tts = root.getElementById("tts"+idx);
         if (tv)   t.setAttribute(attr, tv);
         if (tsv)  ts.setAttribute(attr, tsv);
         if (ttsv) tts.setAttribute(attr, ttsv);
       }

       function doChange() {
         root = document.getRootElement();
         doSet(1, "visibility", "hidden", "hidden", undefined);
         doSet(2, "visibility", undefined, undefined, "hidden");
         doSet(3, "visibility", undefined, undefined, "visible");
         doSet(4, "visibility", "visible", undefined, "visible");
         doSet(5, "visibility", undefined, undefined, "hidden");
         doSet(6, "visibility", "hidden",  undefined, undefined);

         doSet(7, "display", undefined,  "none", undefined);
         doSet(8, "display", undefined,  undefined, "inline");
         doSet(9, "display", undefined,  "inline", undefined);
         doSet(10, "display", "none",  "inline", "inline");
         doSet(11, "display", "inline",  undefined, undefined);

         if (inRegard) 
           regardTestInstance.scriptDone();
       }
    ]]></script>

   <rect fill="gold" stroke="crimson" x="15" y="15" width="70" height="25"
         onclick="doChange()"/>
   <text fill="crimson" x="50" y="32" font-weight="bold" text-anchor="middle"
    pointer-events="none">Change!</text>

<title>Text Properties</title>

    <!-- ============================================================= -->
    <!-- Test content                                                  -->
    <!-- ============================================================= -->
    <g id="testContent">
        <text class="title" x="50%" y="40" font-size="15" >
            Text display and visibility.</text>

        <text x="50%" y="74" text-anchor="middle"
         >Visibility on text &amp; tspans</text>
        <text x="50%" y="250" text-anchor="middle"
         >Display on text &amp; tspans</text>

         <g stroke="black" stroke-width="1">
         <rect x="12.5" y="82" width="425" height="25" fill="#EEE"/>
         <rect x="12.5" y="107" width="425" height="25" fill="#CCC"/>
         <rect x="12.5" y="132" width="425" height="25" fill="#EEE"/>
         <rect x="12.5" y="157" width="425" height="25" fill="#CCC"/>
         <rect x="12.5" y="182" width="425" height="25" fill="#EEE"/>
         <rect x="12.5" y="207" width="425" height="25" fill="#CCC"/>
         <line x1="325" x2="325" y1="82" y2="232"/>
         <line x1="381" x2="381" y1="82" y2="232"/>

         <rect x="12.5" y="257" width="425" height="25" fill="#EEE"/>
         <rect x="12.5" y="282" width="425" height="25" fill="#CCC"/>
         <rect x="12.5" y="307" width="425" height="25" fill="#EEE"/>
         <rect x="12.5" y="332" width="425" height="25" fill="#CCC"/>
         <rect x="12.5" y="357" width="425" height="25" fill="#EEE"/>
         <line x1="325" x2="325" y1="257" y2="382"/>
         <line x1="381" x2="381" y1="257" y2="382"/>
         </g>

         <text class="Caption" x="335" y="97" >---, ---, ---</text>
         <text class="Caption" x="335" y="122">---, hid, vis</text>
         <text class="Caption" x="335" y="147">---, hid, hid</text>
         <text class="Caption" x="335" y="172">hid, vis, hid</text>
         <text class="Caption" x="335" y="197">---, ---, ---</text>
         <text class="Caption" x="335" y="222">---, ---, ---</text>

         <text class="Caption" x="391" y="97" >hid, hid, ---</text>
         <text class="Caption" x="391" y="122">---, ---, hid</text>
         <text class="Caption" x="391" y="147">---, ---, vis</text>
         <text class="Caption" x="391" y="172">vis, ---, vis</text>
         <text class="Caption" x="391" y="197">---, ---, hid</text>
         <text class="Caption" x="391" y="222">hid, ---, ---</text>

         <text class="Caption" x="335" y="273">---, ---, ---</text>
         <text class="Caption" x="335" y="298">---, inl, non</text>
         <text class="Caption" x="335" y="323">---, non, inl</text>
         <text class="Caption" x="335" y="348">---, non, non</text>
         <text class="Caption" x="335" y="373">non, inl, non</text>

         <text class="Caption" x="391" y="273">---, non, ---</text>
         <text class="Caption" x="391" y="298">---, ---, inl</text>
         <text class="Caption" x="391" y="323">---, inl, ---</text>
         <text class="Caption" x="391" y="348">non, inl, inl</text>
         <text class="Caption" x="391" y="373">inl, ---, ---</text>

       <g transform="scale(1.25), translate(0, 10)">
        <text id="t1" x="20" y="70">Text <tspan id="ts1"
          >tspan 1 <tspan id="tts1"> tspan 2</tspan
          > more span 1</tspan> finish text</text>

        <text id="t2" x="20" y="90" >Text <tspan id="ts2" visibility="hidden"
         >tspan 1 <tspan id="tts2" visibility="visible"> tspan 2</tspan
         > more span 1</tspan> finish text</text>

        <text id="t3" x="20" y="110">Text <tspan id="ts3" visibility="hidden"
         >tspan 1 <tspan id="tts3" visibility="hidden"
         > tspan 2</tspan> more span 1</tspan> finish text</text>

        <text id="t4" x="20" y="130" visibility="hidden"
         >Text <tspan id="ts4" visibility="visible"
         >tspan 1 <tspan id="tts4" visibility="hidden"> tspan 2</tspan
         > more span 1</tspan> finish text</text>

        <text id="t5" x="20" y="150"
         >Text <tspan id="ts5"
         >tspan 1 <tspan id="tts5" > tspan 2</tspan
         > more span 1</tspan> finish text</text>

        <text id="t6" x="20" y="170" 
         >Text <tspan id="ts6" 
         >tspan 1 <tspan id="tts6" > tspan 2</tspan
         > more span 1</tspan> finish text</text>


        <text id="t7" x="20" y="210">Text <tspan id="ts7" 
         >tspan 1 <tspan id="tts7" 
         >tspan 2 </tspan>more span 1</tspan
         > finish text</text>
        <text id="t8" x="20" y="230">Text <tspan id="ts8" display="inline"
         >tspan 1 <tspan id="tts8" display="none"
         > tspan 2</tspan> more span 1</tspan
         > finish text</text>
        <text id="t9" x="20" y="250">Text <tspan id="ts9" display="none"
         >tspan 1 <tspan id="tts9" display="inline"
         > tspan 2</tspan> more span 1</tspan
         > finish text</text>
        <text id="t10" x="20" y="270">Text <tspan id="ts10" display="none"
         >tspan 1 <tspan id="tts10" display="none"
         > tspan 2</tspan> more span 1</tspan
         > finish text</text>
        <text id="t11" x="20" y="290" display="none"
         >Text <tspan id="ts11" display="inline"
         >tspan 1 <tspan id="tts11" display="none"
         > tspan 2</tspan> more span 1</tspan
         > finish text</text>
    </g>
    </g>

    <!-- ============================================================= -->
    <!-- Batik sample mark                                             -->
    <!-- ============================================================= -->
    <use xlink:href="../../../batikLogo.svg#Batik_Tag_Box" />
    
</svg>