Rather than trying to compute it, why not just tell the SVG text to center itself? I found a reference here:
http://www.w3.org/TR/SVG/text.html#TextAlignmentProperties.
...roboticus
When your only tool is a hammer, all problems look like your thumb.
Update: s/it/itself/ to clarify intent.
In reply to Re: SVG text width calculation
by roboticus
in thread SVG text width calculation
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |