You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by poozle <jd...@bath.ac.uk> on 2007/10/18 17:32:01 UTC

Font Metrics for SVG Font

Hi

I was wondering if there was a way to obtain the font metrics for an SVGFont
in the same way as you can for a "standard" font, I have been using standard
fonts but due to their unpredictability I have decided that SVG fonts are a
much better way to go.  My current code works by getting the font metrics
from the JSVGCanvas (for the font required) and then using those to get the
font height, and widths of a number of strings.

eg.

FontMetrics fontMetrics = canvas.getFontMetrics(font);
int lineHeight = fontMetrics.getHeight()-1;
int wordWidth = fontMetrics.stringWidth(words[i]);

But this doesn't work for SVGFonts.

Any help anyone can give will be greatly appreciated.

Jon
-- 
View this message in context: http://www.nabble.com/Font-Metrics-for-SVG-Font-tf4647784.html#a13277034
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org