- java.lang.Object
-
- org.jfree.svg.StandardFontMapper
-
- All Implemented Interfaces:
FontMapper
public class StandardFontMapper extends java.lang.Object implements FontMapper
A default implementation of theFontMapperinterface. This implementation will map the Java logical fonts to equivalent SVG generic fonts. You can add your own mappings if you need to.- Since:
- 1.5
-
-
Constructor Summary
Constructors Constructor Description StandardFontMapper()Creates a new instance with mappings for the Java logical fonts.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Stringget(java.lang.String family)Returns the mapped (alternate) font family name.java.lang.StringmapFont(java.lang.String family)Maps the specified font family name to an alternative, or else returns the same family name.voidput(java.lang.String family, java.lang.String alternate)Adds a font family mapping (if the specified alternate isnullit has the effect of clearing any existing mapping).
-
-
-
Constructor Detail
-
StandardFontMapper
public StandardFontMapper()
Creates a new instance with mappings for the Java logical fonts.
-
-
Method Detail
-
get
public java.lang.String get(java.lang.String family)
Returns the mapped (alternate) font family name.- Parameters:
family- the font family (nullnot permitted).- Returns:
- The alternate font family name (possibly
null).
-
put
public void put(java.lang.String family, java.lang.String alternate)
Adds a font family mapping (if the specified alternate isnullit has the effect of clearing any existing mapping).- Parameters:
family- the font family name (nullnot permitted).alternate- the alternate (nullpermitted).
-
mapFont
public java.lang.String mapFont(java.lang.String family)
Maps the specified font family name to an alternative, or else returns the same family name.- Specified by:
mapFontin interfaceFontMapper- Parameters:
family- the font family name (nullnot permitted).- Returns:
- The same font family name or an alternative (never
null).
-
-