Discussion:
SVG text align problem converting to PNG
Mark Owens
2002-06-07 10:41:48 UTC
Permalink
Hi,
I'm using a combination of XML/XSL to generate a series of SVG text button
images.
I'm then using ImageMagick's CONVERT prog (v5.4.3) to convert SVG to PNG.

My SVG source uses the text anchor style attribute to centre-align text
along a given path (37.5, 16). Here's the source line:
<text x="37.5" y="16" style=" font-family:Arial; font-size:10;
text-anchor:middle">Abort</text>

The trouble is, the CONVERT tool doesn't seem to understand the text-anchor
attribute as the resulting PNG has the text left-aligned instead of
centre-aligned.

I'd be gratefull for any advice on a workaround.
Cheers
Mark
Leonard Rosenthol
2002-06-10 00:50:58 UTC
Permalink
Post by Mark Owens
I'm using a combination of XML/XSL to generate a series of SVG text
button images.
I'm then using ImageMagick's CONVERT prog (v5.4.3) to convert SVG to PNG.
Great!
Post by Mark Owens
My SVG source uses the text anchor style attribute to centre-align
<text x="37.5" y="16" style=" font-family:Arial; font-size:10;
text-anchor:middle">Abort</text>
The trouble is, the CONVERT tool doesn't seem to understand the
text-anchor attribute as the resulting PNG has the text left-aligned
instead of centre-aligned.
You are correct. At this time, AFAIK, our SVG parser doesn't
support that.
Post by Mark Owens
I'd be gratefull for any advice on a workaround.
You could patch the SVG coder module to support that attribute ;).


Leonard
--
---------------------------------------------------------------------------
Leonard Rosenthol <mailto:***@lazerware.com>
<http://www.lazerware.com>
Loading...