Package org.apache.batik.bridge
Class SVGFontFamily
- java.lang.Object
-
- org.apache.batik.bridge.SVGFontFamily
-
- All Implemented Interfaces:
GVTFontFamily
public class SVGFontFamily extends java.lang.Object implements GVTFontFamily
A font family class for SVG fonts.- Version:
- $Id: SVGFontFamily.java 1802297 2017-07-18 13:58:12Z ssteiner $
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Booleancomplexprotected BridgeContextctxprotected org.w3c.dom.ElementfontElementprotected GVTFontFacefontFacestatic java.text.AttributedCharacterIterator.AttributeTEXT_COMPOUND_ID
-
Constructor Summary
Constructors Constructor Description SVGFontFamily(GVTFontFace fontFace, org.w3c.dom.Element fontElement, BridgeContext ctx)Constructs an SVGFontFamily.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description GVTFontderiveFont(float size, java.text.AttributedCharacterIterator aci)Derives a GVTFont object of the correct size.GVTFontderiveFont(float size, java.util.Map attrs)Derives a GVTFont object of the correct size from an attribute Map.java.lang.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(org.w3c.dom.Element fontElement, BridgeContext ctx)
-
-
-
Field Detail
-
TEXT_COMPOUND_ID
public static final java.text.AttributedCharacterIterator.Attribute TEXT_COMPOUND_ID
-
fontFace
protected GVTFontFace fontFace
-
fontElement
protected org.w3c.dom.Element fontElement
-
ctx
protected BridgeContext ctx
-
complex
protected java.lang.Boolean complex
-
-
Constructor Detail
-
SVGFontFamily
public SVGFontFamily(GVTFontFace fontFace, org.w3c.dom.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
-
getFamilyName
public java.lang.String getFamilyName()
Returns the family name of this font.- Specified by:
getFamilyNamein interfaceGVTFontFamily- Returns:
- The font family name.
-
getFontFace
public GVTFontFace getFontFace()
Returns the font-face associated with this font family.- Specified by:
getFontFacein interfaceGVTFontFamily- Returns:
- The font face.
-
deriveFont
public GVTFont deriveFont(float size, java.text.AttributedCharacterIterator aci)
Derives a GVTFont object of the correct size.- Specified by:
deriveFontin interfaceGVTFontFamily- 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, java.util.Map attrs)
Derives a GVTFont object of the correct size from an attribute Map.- Specified by:
deriveFontin interfaceGVTFontFamily- Parameters:
size- The required size of the derived font.attrs- The Attribute Map to get Values from.
-
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.- Specified by:
isComplexin interfaceGVTFontFamily
-
isComplex
public static boolean isComplex(org.w3c.dom.Element fontElement, BridgeContext ctx)
-
-