org.apache.batik.bridge

Class SVGFontFamily

public class SVGFontFamily extends Object implements GVTFontFamily

A font family class for SVG fonts.
Field Summary
protected Booleancomplex
protected BridgeContextctx
protected ElementfontElement
protected GVTFontFacefontFace
static AttributeTEXT_COMPOUND_ID
Constructor Summary
SVGFontFamily(GVTFontFace fontFace, Element fontElement, BridgeContext ctx)
Constructs an SVGFontFamily.
Method Summary
GVTFontderiveFont(float size, AttributedCharacterIterator aci)
Derives a GVTFont object of the correct size.
GVTFontderiveFont(float size, Map attrs)
Derives a GVTFont object of the correct size from an attribute Map.
StringgetFamilyName()
Returns the family name of this font.
GVTFontFacegetFontFace()
Returns the font-face associated with this font family.
booleanisComplex()
This method looks at the SVG font and checks if any of the glyphs use renderable child elements.
static booleanisComplex(Element fontElement, BridgeContext ctx)

Field Detail

complex

protected Boolean complex

ctx

protected BridgeContext ctx

fontElement

protected Element fontElement

fontFace

protected GVTFontFace fontFace

TEXT_COMPOUND_ID

public static final Attribute TEXT_COMPOUND_ID

Constructor Detail

SVGFontFamily

public SVGFontFamily(GVTFontFace fontFace, Element fontElement, BridgeContext ctx)
Constructs an SVGFontFamily.

Parameters: fontFace The font face object that describes this font family. fontElement The element that contains the font data for this family. ctx The bridge context. This is required for lazily loading the font data at render time.

Method Detail

deriveFont

public GVTFont deriveFont(float size, AttributedCharacterIterator aci)
Derives a GVTFont object of the correct size.

Parameters: size The required size of the derived font. aci The character iterator containing the text to be rendered using the derived font.

Returns: The derived font.

deriveFont

public GVTFont deriveFont(float size, Map attrs)
Derives a GVTFont object of the correct size from an attribute Map.

Parameters: size The required size of the derived font. attrs The Attribute Map to get Values from.

getFamilyName

public String getFamilyName()
Returns the family name of this font.

Returns: The font family name.

getFontFace

public GVTFontFace getFontFace()
Returns the font-face associated with this font family.

Returns: The font face.

isComplex

public boolean isComplex()
This method looks at the SVG font and checks if any of the glyphs use renderable child elements. If so this is a complex font in that full CSS inheritance needs to be applied. Otherwise if it only uses the 'd' attribute it does not need CSS treatment.

isComplex

public static boolean isComplex(Element fontElement, BridgeContext ctx)
Copyright B) 2007 Apache Software Foundation. All Rights Reserved.