Class Font

java.lang.Object
io.deephaven.plot.Font
All Implemented Interfaces:
Serializable

public class Font extends Object implements Serializable
A font used to represent text.
See Also:
  • Constructor Details

    • Font

      public Font(String family, Font.FontStyle style, int size)
      Creates a new instance of the Font with the specified family, style, and size.
      Parameters:
      family - font family; if null, set to Arial
      style - font style; if null, set to Font.FontStyle PLAIN
      size - the point size of the Font
    • Font

      public Font(String family, String style, int size)
      Creates a new instance of the Font with the specified family, style, and size.
      Parameters:
      family - font family; if null, set to Arial
      style - font style; if null, set to Font.FontStyle PLAIN
      size - the point size of the Font
  • Method Details

    • fontStyle

      public static Font.FontStyle fontStyle(String style)
      Returns a font style.
      Parameters:
      style - case insensitive font style descriptor
      Returns:
      FontStyle corresponding to style
      Throws:
      IllegalArgumentException - style must not be null
    • fontStyleNames

      public static String[] fontStyleNames()
      Returns the names of available font styles.
      Returns:
      array of available FontStyle names
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • font

      public static Font font(String family, Font.FontStyle style, int size)
      Returns a font.
      Parameters:
      family - font family; if null, set to Arial
      style - font style; if null, set to Font.FontStyle PLAIN
      size - the point size of the Font
      Returns:
      font with the specified family, style and size
    • font

      public static Font font(String family, String style, int size)
      Returns a font.
      Parameters:
      family - font family; if null, set to Arial
      style - font style; if null, set to Font.FontStyle PLAIN
      size - the point size of the Font
      Returns:
      font with the specified family, style and size
    • fontFamilyNames

      public static String[] fontFamilyNames()
      Returns the names of available Font families.
      Returns:
      array of available Font family names
    • refamily

      public Font refamily(String family)
      Returns an instance of this Font with the family changed to the specified family
      Parameters:
      family - font family; if null, set to Arial
      Returns:
      Font with family and this Font's style and size
    • restyle

      public Font restyle(Font.FontStyle style)
      Gets an instance of this Font with the style changed to the specified style
      Parameters:
      style - font style; if null, set to Font.FontStyle PLAIN
      Returns:
      Font with style and this Font's family and size
    • restyle

      public Font restyle(String style)
      Returns an instance of this Font with the style changed to the specified style
      Parameters:
      style - font style; if null, set to Font.FontStyle PLAIN
      Returns:
      Font with style and this Font's family and size
    • resize

      public Font resize(int size)
      Returns an instance of this Font with the size changed to the specified size
      Parameters:
      size - point size of the font
      Returns:
      Font with size and this Font's family and style
    • javaFont

      public Font javaFont()
      Returns the Java object representative of this Font.
      Returns:
      Java object representative of this Font
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object