Package org.jfree.svg

Class StandardFontMapper

java.lang.Object
org.jfree.svg.StandardFontMapper
All Implemented Interfaces:
FontMapper

public class StandardFontMapper extends Object implements FontMapper
A default implementation of the FontMapper interface. 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
    Creates a new instance with mappings for the Java logical fonts.
  • Method Summary

    Modifier and Type
    Method
    Description
    get(String family)
    Returns the mapped (alternate) font family name.
    mapFont(String family)
    Maps the specified font family name to an alternative, or else returns the same family name.
    void
    put(String family, String alternate)
    Adds a font family mapping (if the specified alternate is null it has the effect of clearing any existing mapping).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • StandardFontMapper

      Creates a new instance with mappings for the Java logical fonts.
  • Method Details

    • get

      public String get(String family)
      Returns the mapped (alternate) font family name.
      Parameters:
      family - the font family (null not permitted).
      Returns:
      The alternate font family name (possibly null).
    • put

      public void put(String family, String alternate)
      Adds a font family mapping (if the specified alternate is null it has the effect of clearing any existing mapping).
      Parameters:
      family - the font family name (null not permitted).
      alternate - the alternate (null permitted).
    • mapFont

      public String mapFont(String family)
      Maps the specified font family name to an alternative, or else returns the same family name.
      Specified by:
      mapFont in interface FontMapper
      Parameters:
      family - the font family name (null not permitted).
      Returns:
      The same font family name or an alternative (never null).