xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomas.dewe...@kodak.com
Subject Re: style -> Font?
Date Tue, 07 Feb 2006 10:44:18 GMT
Hi Michael,

"Bishop, Michael W. CONTR J9C880" <Michael.Bishop@je.jfcom.mil> wrote on 
02/06/2006 02:14:26 PM:

> Is there a parser that will allow me to parse style information from an 
> element into a Font object based on style elements like font-family, 
> weight, font-style, and font-size? 

        Heh! If only font selection were so simple.  You can get close 
the code in SVGTextElementBridge.getFontFamilyList.  First off this will
result in a list of possible font familes (which Batik selects from based
on actual availability and ability to display the text).  Second some of 
these may be SVG Font references.

      You might also look at batik.gvt.font.fontFamilyResolver which
does the family -> AWT font mapping (other code handles SVG fonts).

> I want to be able to “edit” a text element and have the current font 
> information pre-chosen; font, pt size, Bold, Italic, Underline, etc.

      The above will get you close but more or less can't give
'full fidelity' which is probably fine for your needs...

View raw message