Class FontDefinition

  • All Implemented Interfaces:
    Serializable, Cloneable

    public class FontDefinition
    extends Object
    implements Serializable, Cloneable
    Deprecated.
    use single properties instead.
    The FontDefinition encapsulates all Font-Style information. The java.awt.Font class does not support extended Styles like Strikethrough or Underline or font metadata like the base encoding.
    Author:
    Thomas Morgner
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static boolean BOLD
      Deprecated.
      a constant to draw a font in bold style.
      static boolean ITALIC
      Deprecated.
      a constant to draw a font in italic style.
      static boolean PLAIN
      Deprecated.
      a constant to draw a font in plain style.
      static boolean STRIKETHROUGH
      Deprecated.
      a constant to draw a font with strikethrough style.
      static boolean UNDERLINE
      Deprecated.
      a constant to draw a font with underline style.
    • Constructor Summary

      Constructors 
      Constructor Description
      FontDefinition​(Font font)
      Deprecated.
      Creates a font definition base on the given AWT font.
      FontDefinition​(String fontName, int fontSize)
      Deprecated.
      Creates a font definition using the given name and size and with no additional style enabled.
      FontDefinition​(String fontName, int fontSize, boolean bold, boolean italic, boolean underline, boolean strikeThrough)
      Deprecated.
      Creates a font definition using the given name and size and with the given styles defined.
      FontDefinition​(String fontName, int fontSize, boolean bold, boolean italic, boolean underline, boolean strikeThrough, String encoding, boolean embedded)
      Deprecated.
      Creates a font definition using the given name and size and with the given styles defined.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      Object clone()
      Deprecated.
      Creates and returns a copy of this object.
      boolean equals​(Object o)
      Deprecated.
      Indicates whether some other object is "equal to" this one.
      Font getFont()
      Deprecated.
      returns the AWT-Font defined by this FontDefinition.
      String getFontEncoding​(String defaultEncoding)
      Deprecated.
      Returns this fonts string encoding.
      String getFontName()
      Deprecated.
      Returns the font name of this font definition.
      int getFontSize()
      Deprecated.
      Returns the size of the defined font.
      int hashCode()
      Deprecated.
      Returns a hash code value for the object.
      boolean isBold()
      Deprecated.
      Returns the bold style of this font definition.
      boolean isCourier()
      Deprecated.
      Returns true if the logical font name is equivalent to 'Courier', and false otherwise.
      boolean isEmbeddedFont()
      Deprecated.
      Returns whether the font should be embedded in the target document.
      boolean isItalic()
      Deprecated.
      Returns the italic style of this font definition.
      boolean isSansSerif()
      Deprecated.
      Returns true if the logical font name is equivalent to 'SansSerif', and false otherwise.
      boolean isSerif()
      Deprecated.
      Returns true if the logical font name is equivalent to 'Serif', and false otherwise.
      boolean isStrikeThrough()
      Deprecated.
      Returns the strikethrough style of this font definition.
      boolean isUnderline()
      Deprecated.
      Returns the underline style of this font definition.
      String toString()
      Deprecated.
      Returns a string representation of this font definition.
    • Field Detail

      • BOLD

        public static final boolean BOLD
        Deprecated.
        a constant to draw a font in bold style.
        See Also:
        Constant Field Values
      • ITALIC

        public static final boolean ITALIC
        Deprecated.
        a constant to draw a font in italic style.
        See Also:
        Constant Field Values
      • UNDERLINE

        public static final boolean UNDERLINE
        Deprecated.
        a constant to draw a font with underline style.
        See Also:
        Constant Field Values
      • STRIKETHROUGH

        public static final boolean STRIKETHROUGH
        Deprecated.
        a constant to draw a font with strikethrough style.
        See Also:
        Constant Field Values
      • PLAIN

        public static final boolean PLAIN
        Deprecated.
        a constant to draw a font in plain style.
        See Also:
        Constant Field Values
    • Constructor Detail

      • FontDefinition

        public FontDefinition​(String fontName,
                              int fontSize,
                              boolean bold,
                              boolean italic,
                              boolean underline,
                              boolean strikeThrough,
                              String encoding,
                              boolean embedded)
        Deprecated.
        Creates a font definition using the given name and size and with the given styles defined.
        Parameters:
        fontName - the font name used in this font definition.
        fontSize - the font size for the defined font.
        bold - true, if the font should be bold, false otherwise
        italic - true, if the font should be italic, false otherwise
        underline - true, if the font should be drawn with underline style, false otherwise
        strikeThrough - true, if the font should be drawn with strikethrough style, false otherwise
        encoding - the default text encoding that should be used with this font.
        embedded - whether this font should be embedded in the target document.
      • FontDefinition

        public FontDefinition​(String fontName,
                              int fontSize,
                              boolean bold,
                              boolean italic,
                              boolean underline,
                              boolean strikeThrough)
        Deprecated.
        Creates a font definition using the given name and size and with the given styles defined.
        Parameters:
        fontName - the font name used in this font definition.
        fontSize - the font size for the defined font.
        bold - true, if the font should be bold, false otherwise
        italic - true, if the font should be italic, false otherwise
        underline - true, if the font should be drawn with underline style, false otherwise
        strikeThrough - true, if the font should be drawn with strikethrough style, false otherwise
      • FontDefinition

        public FontDefinition​(String fontName,
                              int fontSize)
        Deprecated.
        Creates a font definition using the given name and size and with no additional style enabled.
        Parameters:
        fontName - the font name used in this font definition.
        fontSize - the font size for the defined font.
      • FontDefinition

        public FontDefinition​(Font font)
        Deprecated.
        Creates a font definition base on the given AWT font.
        Parameters:
        font - the awt font that should be used as definition source.
    • Method Detail

      • getFontName

        public String getFontName()
        Deprecated.
        Returns the font name of this font definition. The font name is the font face name.
        Returns:
        the name of the font.
      • getFontSize

        public int getFontSize()
        Deprecated.
        Returns the size of the defined font.
        Returns:
        the font size in points.
      • isEmbeddedFont

        public boolean isEmbeddedFont()
        Deprecated.
        Returns whether the font should be embedded in the target document.
        Returns:
        true, if the font should be embedded.
      • isBold

        public boolean isBold()
        Deprecated.
        Returns the bold style of this font definition.
        Returns:
        true, if the font should be drawn in bold style.
      • isItalic

        public boolean isItalic()
        Deprecated.
        Returns the italic style of this font definition.
        Returns:
        true, if the font should be drawn in italic style.
      • isUnderline

        public boolean isUnderline()
        Deprecated.
        Returns the underline style of this font definition.
        Returns:
        true, if the font should be drawn in underline style.
      • isStrikeThrough

        public boolean isStrikeThrough()
        Deprecated.
        Returns the strikethrough style of this font definition.
        Returns:
        true, if the font should be drawn in strikethrough style.
      • getFont

        public Font getFont()
        Deprecated.
        returns the AWT-Font defined by this FontDefinition.
        Returns:
        the AWT font.
      • getFontEncoding

        public String getFontEncoding​(String defaultEncoding)
        Deprecated.
        Returns this fonts string encoding. If the font does not define an encoding, the given default encoding is returned.
        Parameters:
        defaultEncoding - the font encoding to be used if this font definition does not define an own encoding.
        Returns:
        the font encoding or the default encoding.
      • toString

        public String toString()
        Deprecated.
        Returns a string representation of this font definition.
        Overrides:
        toString in class Object
        Returns:
        a string representation of this font definition.
      • equals

        public boolean equals​(Object o)
        Deprecated.
        Indicates whether some other object is "equal to" this one.
        Overrides:
        equals in class Object
        Parameters:
        o - the reference object with which to compare.
        Returns:
        true if this object is the same as the obj argument; false otherwise.
        See Also:
        hashCode(), Hashtable
      • hashCode

        public int hashCode()
        Deprecated.
        Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by java.util.Hashtable.
        Overrides:
        hashCode in class Object
        Returns:
        a hash code value for this object.
        See Also:
        Object.equals(java.lang.Object)
      • isSansSerif

        public boolean isSansSerif()
        Deprecated.
        Returns true if the logical font name is equivalent to 'SansSerif', and false otherwise.
        Returns:
        true or false.
      • isCourier

        public boolean isCourier()
        Deprecated.
        Returns true if the logical font name is equivalent to 'Courier', and false otherwise.
        Returns:
        true or false.
      • isSerif

        public boolean isSerif()
        Deprecated.
        Returns true if the logical font name is equivalent to 'Serif', and false otherwise.
        Returns:
        true or false.