Class FontKey


  • public class FontKey
    extends java.lang.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 boolean isBold
      Flag for bold.
      private boolean isItalic
      Flag for italic.
      private java.lang.String name
      The key name.
    • Constructor Summary

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

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static FontKey createFontKey​(java.awt.Font f)
      Creates a new key for a given font.
      boolean equals​(java.lang.Object obj)
      Tests this key for equality with an arbitrary object.
      int hashCode()
      Returns a hash code for this instance.
      java.lang.String toString()
      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 Detail

      • name

        private java.lang.String name
        The key name.
      • isBold

        private boolean isBold
        Flag for bold.
      • isItalic

        private boolean isItalic
        Flag for italic.
    • Constructor Detail

      • FontKey

        public FontKey​(java.lang.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:
        createFontKey(java.awt.Font)
    • Method Detail

      • createFontKey

        public static FontKey createFontKey​(java.awt.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​(java.lang.Object obj)
        Tests this key for equality with an arbitrary object.
        Overrides:
        equals in class java.lang.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 java.lang.Object
        Returns:
        A hash code.
      • toString

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