org.apache.batik.bridge

Class SVGFontUtilities

public abstract class SVGFontUtilities extends Object implements SVGConstants

Utility class for SVG fonts.
Method Summary
static ListgetFontFaces(Document doc, BridgeContext ctx)
static GVTFontFamilygetFontFamily(Element textElement, BridgeContext ctx, String fontFamilyName, String fontWeight, String fontStyle)
Given a font family name tries to find a matching SVG font object.
protected static StringgetFontWeightNumberString(String fontWeight)
Returns a string that contains all of the font weight numbers for the specified font weight attribute value.

Method Detail

getFontFaces

public static List getFontFaces(Document doc, BridgeContext ctx)

getFontFamily

public static GVTFontFamily getFontFamily(Element textElement, BridgeContext ctx, String fontFamilyName, String fontWeight, String fontStyle)
Given a font family name tries to find a matching SVG font object. If finds one, returns an SVGFontFamily otherwise returns an UnresolvedFontFamily.

Parameters: textElement The text element that the font family will be attached to. ctx The bridge context, used to search for a matching SVG font element. fontFamilyName The name of the font family to search for. fontWeight The weight of the font to use when trying to match an SVG font family. fontStyle The style of the font to use when trying to match as SVG font family.

Returns: A GVTFontFamily for the specified font attributes. This will be unresolved unless a matching SVG font was found.

getFontWeightNumberString

protected static String getFontWeightNumberString(String fontWeight)
Returns a string that contains all of the font weight numbers for the specified font weight attribute value.

Parameters: fontWeight The font-weight attribute value.

Returns: The font weight expressed as font weight numbers. e.g. "normal" becomes "400".

Copyright B) 2008 Apache Software Foundation. All Rights Reserved.