| 1 |
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
| 2 |
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" |
| 3 |
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> |
| 4 |
|
| 5 |
<!-- |
| 6 |
|
| 7 |
Licensed to the Apache Software Foundation (ASF) under one or more |
| 8 |
contributor license agreements. See the NOTICE file distributed with |
| 9 |
this work for additional information regarding copyright ownership. |
| 10 |
The ASF licenses this file to You under the Apache License, Version 2.0 |
| 11 |
(the "License"); you may not use this file except in compliance with |
| 12 |
the License. You may obtain a copy of the License at |
| 13 |
|
| 14 |
http://www.apache.org/licenses/LICENSE-2.0 |
| 15 |
|
| 16 |
Unless required by applicable law or agreed to in writing, software |
| 17 |
distributed under the License is distributed on an "AS IS" BASIS, |
| 18 |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 19 |
See the License for the specific language governing permissions and |
| 20 |
limitations under the License. |
| 21 |
|
| 22 |
--> |
| 23 |
<!-- ====================================================================== --> |
| 24 |
<!-- Tests text-anchor on tspan elements --> |
| 25 |
<!-- --> |
| 26 |
<!-- @author [email protected] --> |
| 27 |
<!-- @version $Id$ --> |
| 28 |
<!-- ====================================================================== --> |
| 29 |
<?xml-stylesheet type="text/css" href="../../resources/style/test.css" ?> |
| 30 |
|
| 31 |
<svg width="450" height="500" viewBox="0 0 450 500"> |
| 32 |
|
| 33 |
<text class="title" x="50%" y="20">textLength with Anchor</text> |
| 34 |
|
| 35 |
|
| 36 |
<defs> |
| 37 |
<g id="fill-rgn"> |
| 38 |
<rect x="200" y="5" width="50" height="20" |
| 39 |
fill="#DDE8FF" stroke="none"/> |
| 40 |
<line x1="225" y1="3" x2="225" y2="27" stroke="red"/> |
| 41 |
</g> |
| 42 |
|
| 43 |
<g id="bg1"> |
| 44 |
<rect x="50" y="0" width ="350" height="45" |
| 45 |
fill="lightGrey" stroke="black"/> |
| 46 |
<use xlink:href="#fill-rgn"/> |
| 47 |
</g> |
| 48 |
|
| 49 |
<g id="bg2"> |
| 50 |
<rect x="50" y="0" width ="350" height="45" |
| 51 |
fill="white" stroke="black"/> |
| 52 |
<use xlink:href="#fill-rgn"/> |
| 53 |
</g> |
| 54 |
</defs> |
| 55 |
|
| 56 |
<g font-size="12" > |
| 57 |
<!-- no lengthadjust --> |
| 58 |
<g transform="translate(0, 30)"> |
| 59 |
<use xlink:href="#bg1"/> |
| 60 |
<text x="225" y="19" text-anchor="middle">xml-batik</text> |
| 61 |
<text x="225" y="40" text-anchor="middle">No textLength</text> |
| 62 |
</g> |
| 63 |
|
| 64 |
<!-- With lengthAdjust spacingAndGlyphs --> |
| 65 |
<g transform="translate(0, 75)"> |
| 66 |
<use xlink:href="#bg2"/> |
| 67 |
<text x="225" y="19" text-anchor="middle" textLength="50" |
| 68 |
lengthAdjust="spacingAndGlyphs">B</text> |
| 69 |
<text x="225" y="40" text-anchor="middle">textLength="50" lengthAdjust="spacingAndGlyphs"</text> |
| 70 |
</g> |
| 71 |
|
| 72 |
<!-- with lengthAdjust spacing --> |
| 73 |
<g transform="translate(0, 120)"> |
| 74 |
<use xlink:href="#bg1"/> |
| 75 |
<text x="225" y="19" text-anchor="middle" textLength="50" |
| 76 |
lengthAdjust="spacing">B</text> |
| 77 |
<text x="225" y="40" text-anchor="middle">textLength="50" lengthAdjust="spacing"</text> |
| 78 |
</g> |
| 79 |
|
| 80 |
<!-- with lengthAdjust spacing --> |
| 81 |
<g transform="translate(0, 165)"> |
| 82 |
<use xlink:href="#bg2"/> |
| 83 |
<text x="225" y="19" text-anchor="middle" textLength="50" |
| 84 |
lengthAdjust="spacingAndGlyphs">Batik</text> |
| 85 |
<text x="225" y="40" text-anchor="middle">textLength="50" lengthAdjust="spacingAndGlyphs"</text> |
| 86 |
</g> |
| 87 |
|
| 88 |
<!-- with lengthAdjust spacing --> |
| 89 |
<g transform="translate(0, 210)"> |
| 90 |
<use xlink:href="#bg1"/> |
| 91 |
<text x="225" y="19" text-anchor="middle" textLength="50" |
| 92 |
lengthAdjust="spacing">Batik</text> |
| 93 |
<text x="225" y="40" text-anchor="middle">textLength="50" lengthAdjust="spacing"</text> |
| 94 |
</g> |
| 95 |
|
| 96 |
<!-- large number --> |
| 97 |
<g transform="translate(0, 255)"> |
| 98 |
<use xlink:href="#bg2"/> |
| 99 |
<text x="225" y="19" text-anchor="middle" textLength="50" |
| 100 |
lengthAdjust="spacingAndGlyphs">Apache Batik</text> |
| 101 |
<text x="225" y="40" text-anchor="middle">textLength="50" lengthAdjust="spacingAndGlyphs" (shrinking)</text> |
| 102 |
</g> |
| 103 |
|
| 104 |
<!-- large number, no anchor --> |
| 105 |
<g transform="translate(0, 300)"> |
| 106 |
<use xlink:href="#bg1"/> |
| 107 |
<text x="200" y="19" textLength="50" |
| 108 |
lengthAdjust="spacingAndGlyphs">Apache Batik</text> |
| 109 |
<text x="225" y="40" text-anchor="middle">textLength="50" lengthAdjust="spacingAndGlyphs" (no anchor)</text> |
| 110 |
</g> |
| 111 |
|
| 112 |
<!-- large number, tspan --> |
| 113 |
<g transform="translate(0, 345)"> |
| 114 |
<use xlink:href="#bg2"/> |
| 115 |
<text x="225" y="19" text-anchor="middle" textLength="50" |
| 116 |
lengthAdjust="spacingAndGlyphs">Apache <tspan fill="red">Batik</tspan>!!</text> |
| 117 |
<text x="225" y="40" text-anchor="middle">textLength="50" lengthAdjust="spacingAndGlyphs" (tspan)</text> |
| 118 |
</g> |
| 119 |
|
| 120 |
<!-- Big Font Squeezed alot --> |
| 121 |
<g transform="translate(0, 390)"> |
| 122 |
<rect x="50" y="0" width ="350" height="95" |
| 123 |
fill="lightGrey" stroke="black"/> |
| 124 |
<rect x="112.5" y="5" width="25" height="80" |
| 125 |
fill="#DDE8FF" stroke="none"/> |
| 126 |
<line x1="125" y1="3" x2="125" y2="87" stroke="red"/> |
| 127 |
<text x="125" y="79" text-anchor="middle" textLength="25" |
| 128 |
lengthAdjust="spacingAndGlyphs" |
| 129 |
font-size="100">B a t i k</text> |
| 130 |
<text x="160" y="40">lengthAdjust="spacingAndGlyphs" |
| 131 |
<tspan x="160" dy="1.2em">textLength="25"</tspan> |
| 132 |
<tspan x="160" dy="1.2em">font-size="100"</tspan></text> |
| 133 |
</g> |
| 134 |
</g> |
| 135 |
|
| 136 |
<!-- ============================================================= --> |
| 137 |
<!-- Batik sample mark --> |
| 138 |
<!-- ============================================================= --> |
| 139 |
<use xlink:href="../../../batikLogo.svg#Batik_Tag_Box" /> |
| 140 |
</svg> |