You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by bi...@apache.org on 2001/02/27 14:09:13 UTC
cvs commit: xml-batik/samples/tests textLayout.svg textLayout2.svg
billh 01/02/27 05:09:13
Added: samples/tests textLayout.svg textLayout2.svg
Log:
Addes two sample files illustrating use of textLength, lengthAdjust,
word-spacing, letter-spacing, kerning, and explicit glyph positioning
via x="<val1> <val2> ..." , dx, etc. Also illustrates multi-line
text selection.
Revision Changes Path
1.1 xml-batik/samples/tests/textLayout.svg
Index: textLayout.svg
===================================================================
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20000802//EN"
"http://www.w3.org/TR/2000/CR-SVG-20000802/DTD/svg-20000802.dtd">
<!-- ========================================================================= -->
<!-- Copyright (C) The Apache Software Foundation. All rights reserved. -->
<!-- -->
<!-- This software is published under the terms of the Apache Software License -->
<!-- version 1.1, a copy of which has been included with this distribution in -->
<!-- the LICENSE file. -->
<!-- ========================================================================= -->
<!-- ========================================================================= -->
<!-- Test description here -->
<!-- -->
<!-- @author bill.haneman@ireland.sun.com -->
<!-- @version $Id: textLayout.svg,v 1.1 2001/02/27 13:09:12 billh Exp $ -->
<!-- ========================================================================= -->
<?xml-stylesheet type="text/css" href="test.css" ?>
<svg width="450" height="500" viewBox="0 0 450 500">
<title>Text Layout Properties</title>
<!-- ============================================================= -->
<!-- Test content -->
<!-- ============================================================= -->
<defs>
<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 } ]]>
</style>
<style type="text/css"><![CDATA[
.SerifPlain { font-size: 24; font-family: Serif; font-weight: normal;
font-style: normal; stroke: none; stroke-width: 0;
fill: black } ]]>
</style>
<text x="0" y="0" text-anchor="start" id="sample">sample</text>
</defs>
<g id="testContent" text-anchor="start" font-size="6%" class="SerifPlain">
<text text-anchor="middle" class="title" x="50%" y="10%" font-size="3%" >
Text Layout Properties</text>
<text x="50%" y="15%" text-anchor="middle" font-size="2%">Explicit Glyph Positioning</text>
<g>
<text><tspan x="40,60,80,105,125,140" y="110">sample</tspan></text>
<text x="40" y="125" class="Caption">tspan x="40,60,80,105,125,140"</text>
</g>
<g>
<text x="185" y="110">sample</text>
<text x="185" y="125" class="Caption">Serif, default spacing</text>
</g>
<g>
<text x="290" y="110"><tspan dx="0,10,10,10,10,10">sample</tspan></text>
<text x="290" y="125" class="Caption">x="175" dx="0,10,10,10,10,10"
</text>
</g>
<text x="50%" y="30%" text-anchor="middle" font-size="2%">Letter Spacing Adjustment and Explicit Length Specification</text>
<g>
<text x="40" y="180" textLength="120">sample</text>
<text x="40" y="195" class="Caption">textLength="120"</text>
</g>
<g>
<text x="185" y="180" textLength="70">sample</text>
<text x="185" y="195" class="Caption">textLength="70"</text>
</g>
<g>
<text x="290" y="180" kerning="10">sample</text>
<text x="290" y="195" class="Caption">kerning="10"</text>
</g>
<g>
<text x="40" y="225" textLength="120" lengthAdjust="spacingAndGlyphs">sample</text>
<text x="40" y="240" class="Caption">textLength="120",
<tspan x="40" dy="10">lengthAdjust="spacingAndGlyphs"</tspan></text>
</g>
<g>
<text x="185" y="225" textLength="70" lengthAdjust="spacingAndGlyphs">sample</text>
<text x="185" y="240" class="Caption">textLength="70" <tspan x="185" dy="10">lengthAdjust="spacingAndGlyphs"</tspan></text>
</g>
<g>
<text x="290" y="225" textLength="120" lengthAdjust="spacingAndGlyphs" kerning="10">sample</text>
<text x="290" y="240" class="Caption">textLength="120",kerning="10"</text>
</g>
<g>
<text x="40" y="275" letter-spacing="0.3em">sample</text>
<text x="40" y="290" class="Caption">letter-spacing="0.3em"</text>
</g>
<g>
<text x="185" y="275" letter-spacing="-3">sample</text>
<text x="185" y="290" class="Caption">letter-spacing="-3"</text>
</g>
<g>
<text x="290" y="275" letter-spacing="10">sample</text>
<text x="290" y="290" class="Caption">letter-spacing="10"</text>
</g>
<text x="50%" y="64%" text-anchor="middle" font-size="2%">Word Spacing Adjustment</text>
<g font-size="3%">
<text x="40" y="350" textLength="350" word-spacing="3em">Wide separation between words</text>
<text x="40" y="365" class="Caption">textLength="350" word-spacing="3em"</text>
</g>
<g font-size="3%">
<text x="40" y="395" textLength="350" word-spacing="-5">Narrow separation between words</text>
<text x="40" y="410" class="Caption">textLength="350" word-spacing="-5"</text>
</g>
<g font-size="3%">
<text x="40" y="440" textLength="350" lengthAdjust="spacingAndGlyphs" word-spacing="-5">Narrow separation between words</text>
<text x="40" y="455" class="Caption">textLength="350" lengthAdjust="spacingAndGlyphs" word-spacing="-5"</text>
</g>
</g>
<!-- ============================================================= -->
<!-- Batik sample mark -->
<!-- ============================================================= -->
<use xlink:href="../batikLogo.svg#Batik_Tag_Box" />
</svg>
1.1 xml-batik/samples/tests/textLayout2.svg
Index: textLayout2.svg
===================================================================
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20000802//EN"
"http://www.w3.org/TR/2000/CR-SVG-20000802/DTD/svg-20000802.dtd">
<!-- ========================================================================= -->
<!-- Copyright (C) The Apache Software Foundation. All rights reserved. -->
<!-- -->
<!-- This software is published under the terms of the Apache Software License -->
<!-- version 1.1, a copy of which has been included with this distribution in -->
<!-- the LICENSE file. -->
<!-- ========================================================================= -->
<!-- ========================================================================= -->
<!-- Test description here -->
<!-- -->
<!-- @author bill.haneman@ireland.sun.com -->
<!-- @version $Id: textLayout2.svg,v 1.1 2001/02/27 13:09:12 billh Exp $ -->
<!-- ========================================================================= -->
<?xml-stylesheet type="text/css" href="test.css" ?>
<svg width="450" height="500" viewBox="0 0 450 500">
<title>Text Layout Properties</title>
<!-- ============================================================= -->
<!-- Test content -->
<!-- ============================================================= -->
<defs>
<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 } ]]>
</style>
<style type="text/css"><![CDATA[
.SerifPlain { font-size: 24; font-family: Serif; font-weight: normal;
font-style: normal; stroke: none; stroke-width: 0;
fill: black } ]]>
</style>
<text x="0" y="0" text-anchor="start" id="sample">sample</text>
</defs>
<g id="testContent" text-anchor="start" font-size="6%" class="SerifPlain">
<text text-anchor="middle" class="title" x="50%" y="10%" font-size="3%" >
Text Layout Properties (2)</text>
<text x="50%" y="15%" text-anchor="middle" font-size="2%">Baseline Properties</text>
<g text-anchor="middle">
<text x="225" y="110" font-size="3%"><tspan baseline-shift="super" fill="blue">super</tspan> and <tspan baseline-shift="sub" fill="green">sub</tspan>scripts</text>
<text x="225" y="135" class="Caption">baseline-shift="super"/baseline-shift="sub"</text>
</g>
<g text-anchor="middle">
<text x="225" y="165" font-size="3%"><tspan baseline-shift="+20%" fill="blue">positive</tspan> and <tspan baseline-shift="-20%" fill="green">negative </tspan>baseline-shift</text>
<text x="225" y="180" class="Caption">baseline-shift="+/-20%"</text>
</g>
<text x="50%" y="47%" text-anchor="middle" font-size="2%">Multi-line Text Selection</text>
<text x="50%" y="50%" text-anchor="middle" font-size="1.5%" font-style="italic">(Try selecting the following text regions)</text>
<text text-anchor="start" font-size="3%">
<tspan x="100" y="280">Text selections can span multiple</tspan>
<tspan x="100" y="300">lines via <tspan> elements.</tspan>
</text>
<text text-anchor="start" fill="blue" font-size="4%" transform="translate(175, 390)">
<tspan x="0 10 25 50 75 90 100 90 75 50 25 10 0"
y="0 -25 -40 -50 -40 -25 0 25 40 50 40 25 10 0">Text-circle.</tspan>
</text>
</g>
<!-- ============================================================= -->
<!-- Batik sample mark -->
<!-- ============================================================= -->
<use xlink:href="../batikLogo.svg#Batik_Tag_Box" />
</svg>