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 "J. David Eisenberg" <ca...@catcode.com> on 2002/01/11 21:52:21 UTC
Problem with lengthAdjust?
Either I'm doing something horribly wrong, or Batik has a bug.
I tested this on Batik 1.1.1. As to _why_ I would want to squeeze a
large number into a small space -- don't ask! <grin>
===============================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg width="400px" height="250px"
viewBox="0 0 400 250"
preserveAspectRatio="xMinYMin meet">
<defs>
<g id="green-rect">
<rect x="200" y="20" width="10" height="20"
style="fill: #ccffcc; stroke: none;"/>
</g>
</defs>
<!-- no lengthadjust; works great -->
<g transform="translate(5, 10)" style="font-size: 10;">
<use xlink:href="#green-rect"/>
<text x="205" y="34" style="text-anchor:middle;">10</text>
</g>
<!-- with lengthAdjust spacingAndGlyphs: x-position is slightly off in Batik -->
<g transform="translate(5, 40)" style="font-size: 10;">
<use xlink:href="#green-rect"/>
<text x="205" y="34" style="text-anchor:middle;" textLength="10"
lengthAdjust="spacingAndGlyphs">5</text>
</g>
<!-- with lengthAdjust spacing: x-position is way off in Batik -->
<g transform="translate(5, 70)" style="font-size: 10;">
<use xlink:href="#green-rect"/>
<text x="205" y="34" style="text-anchor:middle;" textLength="10"
lengthAdjust="spacing">5</text>
</g>
<!-- large number: doesn't squeeze glyphs in Adobe; x-position off in Batik -->
<g transform="translate(5, 100)" style="font-size: 10;">
<use xlink:href="#green-rect"/>
<text x="205" y="34" style="text-anchor:middle;" textLength="10"
lengthAdjust="spacingAndGlyphs">123</text>
</g>
<!-- large number: doesn't squeeze glyphs in Adobe; works OK in Batik -->
<g transform="translate(5, 130)" style="font-size: 10;">
<use xlink:href="#green-rect"/>
<text x="200" y="34" textLength="10"
lengthAdjust="spacingAndGlyphs">123</text>
</g>
</svg>
--
J. David Eisenberg http://catcode.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org