Usage of alignment-baseline
Posted: 2017-07-03T08:33:45-07:00
Hi, I want to create an SVG with a single letter (well maybe more, if a single line would work, that'd be great)
The letter should be in the middle of the image, vertically and horizontally.
This is my svg
However, when I try to convert it with image magick or inkspace (or just open it in inkscape) the vertical alignment does not work.
Version: ImageMagick 7.0.6-0 Q16 x64 2017-06-11
Version 0.91 and 0.92.1pre1 r15355 tested
What can I do to make magick or inkscape understand alignment-baseline:central, or how can I do it without this attribute?
Result is this:
Thanks for you time reading all of this. <3
The letter should be in the middle of the image, vertically and horizontally.
This is my svg
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<svg version="1.2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 16 16" style="enable-background:new 0 0 16 16;" xml:space="preserve">
<style type="text/css">
.st0{fill:red;}
.st1{font-family:'Tahoma';}
.st2{font-size:14px;}
.problem{alignment-baseline:central;text-anchor:middle;}
</style>
<g id="Ebene_1">
<rect x="0" y="0" class="st0" width="16" height="16"/>
<text x="8" y="8" class="st1 st2 problem">P</text>
</g>
</svg>
Code: Select all
inkscape -z -e test.png -w 1024 -h 1024 test.svg
Code: Select all
magick mogrify -size 100x100 -format jpg *.svg
What can I do to make magick or inkscape understand alignment-baseline:central, or how can I do it without this attribute?
Result is this:
Thanks for you time reading all of this. <3