Package com.orsonpdf

Class FontKey

java.lang.Object
com.orsonpdf.FontKey

public class FontKey extends Object
A key to represent a Java2D font. This is used to maintain a mapping between Java2D fonts and PDF fonts.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final boolean
    Flag for bold.
    private final boolean
    Flag for italic.
    private final String
    The key name.
  • Constructor Summary

    Constructors
    Constructor
    Description
    FontKey(String name, boolean bold, boolean italic)
    Creates a new font key.
  • Method Summary

    Modifier and Type
    Method
    Description
    static FontKey
    Creates a new key for a given font.
    boolean
    Tests this key for equality with an arbitrary object.
    int
    Returns a hash code for this instance.
    Returns a string representation of this instance, primarily for debugging purposes.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • name

      private final String name
      The key name.
    • isBold

      private final boolean isBold
      Flag for bold.
    • isItalic

      private final boolean isItalic
      Flag for italic.
  • Constructor Details

    • FontKey

      public FontKey(String name, boolean bold, boolean italic)
      Creates a new font key.
      Parameters:
      name - the name.
      bold - the bold flag.
      italic - the italic flag.
      See Also:
  • Method Details

    • createFontKey

      public static FontKey createFontKey(Font f)
      Creates a new key for a given font.
      Parameters:
      f - the font (null not permitted).
      Returns:
      The font key.
    • equals

      public boolean equals(Object obj)
      Tests this key for equality with an arbitrary object.
      Overrides:
      equals in class Object
      Parameters:
      obj - the object to test against (null permitted).
      Returns:
      A boolean.
    • hashCode

      public int hashCode()
      Returns a hash code for this instance.
      Overrides:
      hashCode in class Object
      Returns:
      A hash code.
    • toString

      public String toString()
      Returns a string representation of this instance, primarily for debugging purposes.
      Overrides:
      toString in class Object
      Returns:
      A string.