Forum › How do I...?
SVG text positioning problem
Which text? Can you post a screenshot showing the difference? It looks quite similar in Firefox.
Have a look in Chrome, the numbers in the boxes are aligned in the center. I used alignment-baseline: central; on the text element.
Ah... that explains it then. Thank you! To your knowledge, is there another way to vertically center text in relation to another element?
Oh and sorry for posting in this forum category... could you move the discussion to a more appropriate category?
Oh and sorry for posting in this forum category... could you move the discussion to a more appropriate category?
Any word on when PrinceXML will start supporting alignment-baseline when rendering SVG? This is important to me. Thanks.
May I ask what is your major requirement for alignment-baseline? We have found that it does not seem to be supported by many SVG renderers, and there are other vertical alignment properties such as vertical-align and dominant-baseline.
To vertically position text in the middle of graphics. In the mean time I've found I fake this by aligning the graphics to the top of the point equal to half way down the graphic plus half the font's height, which works but makes my code very hard to alter/maintain.
We have now added support for the SVG dominant-baseline and baseline-shift properties, these can be used for vertical centering and may be more portable than alignment-baseline, which doesn't work in most browsers.
If you would like to try the new properties, just let me know which operating system you are running Prince on.
If you would like to try the new properties, just let me know which operating system you are running Prince on.
Thanks mikeday. That's great. I use Prince on Docraptor so I guess I'll have to wait for you to push a new GM that they support.
Hi mikeday -- do you mind advising which version of PrinceXML you added this to? I think DocRaptor supports v9 only but I've pinged them to check.
Actually DocRaptor just confirmed they support v10, even though their docs only mentioned v9, so all good
Actually these new SVG properties are only supported in Prince latest builds, not Prince 10.