com.orsoncharts.plot

## Class StandardFontSource

- java.lang.Object
- - com.orsoncharts.plot.StandardFontSource

- All Implemented Interfaces:
    FontSource, java.io.Serializable

      public final class StandardFontSource
      extends java.lang.Object
      implements FontSource, java.io.Serializable

  A standard implementation of the `FontSource` interface.
  NOTE: This class is serializable, but the serialization format is subject to change in future releases and should not be relied upon for persisting instances of this class.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `StandardFontSource()` Creates a new instance with default fonts.
    `StandardFontSource(java.awt.Font defaultFont)` Creates a new font source with the specified default font.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(java.lang.Object obj)` Tests this paint source for equality with an arbitrary object.
    `java.awt.Font` | `getDefaultFont()` Returns the default font.
    `java.awt.Font` | `getFont(java.lang.Comparable<?> key)` Returns the font for the specified key.
    `void` | `setDefaultFont(java.awt.Font font)` Sets the default font.
    `void` | `setFont(java.lang.Comparable<?> key, java.awt.Font font)` Sets the font associated with the specified key.
    `void` | `style(java.awt.Font font)` Clears existing font settings and sets the default font to the supplied value.

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### StandardFontSource

          public StandardFontSource()

      Creates a new instance with default fonts.

    - #### StandardFontSource

          public StandardFontSource(java.awt.Font defaultFont)

      Creates a new font source with the specified default font.
      Parameters:
        `defaultFont` - the default font (`null` not permitted).

  - ### Method Detail

    - #### getDefaultFont

          public java.awt.Font getDefaultFont()

      Returns the default font. The default value is `DEFAULT_FONT`.
      Returns:
        The default font (never `null`).

    - #### setDefaultFont

          public void setDefaultFont(java.awt.Font font)

      Sets the default font.
      Parameters:
        `font` - the font (`null` not permitted).

    - #### getFont

          public java.awt.Font getFont(java.lang.Comparable<?> key)

      Returns the font for the specified key.
      Specified by:
        `getFont` in interface `FontSource`
      Parameters:
        `key` - the key (`null` not permitted).
      Returns:
        The font (never `null`).

    - #### setFont

          public void setFont(java.lang.Comparable<?> key,
                              java.awt.Font font)

      Sets the font associated with the specified key.
      Specified by:
        `setFont` in interface `FontSource`
      Parameters:
        `key` - the key (`null` not permitted).
        `font` - the font (`null` permitted).

    - #### style

          public void style(java.awt.Font font)

      Clears existing font settings and sets the default font to the supplied value. This method is used by the framework and is not normally called by client code.
      Specified by:
        `style` in interface `FontSource`
      Parameters:
        `font` - the font (`null` not permitted).
      Since:
        1.2

    - #### equals

          public boolean equals(java.lang.Object obj)

      Tests this paint source for equality with an arbitrary object.
      Overrides:
        `equals` in class `java.lang.Object`
      Parameters:
        `obj` - the object (`null` permitted).
      Returns:
        A boolean.