Class MathVariant

  • All Implemented Interfaces:
    java.io.Serializable

    public final class MathVariant
    extends java.lang.Object
    implements java.io.Serializable
    Class to represent and use MathVariants.
    Version:
    $Revision: e6bd6c2d9bf4 $
    See Also:
    Serialized Form
    • Field Detail

      • BOLD

        public static final MathVariant BOLD
        Mathvariant constant. Bold style.
      • BOLD_FRAKTUR

        public static final MathVariant BOLD_FRAKTUR
        Mathvariant constant. Bold fraktur style.
      • BOLD_ITALIC

        public static final MathVariant BOLD_ITALIC
        Mathvariant constant. Bold-italic style.
      • BOLD_SANS_SERIF

        public static final MathVariant BOLD_SANS_SERIF
        Mathvariant constant. Bold sans-serif style.
      • BOLD_SCRIPT

        public static final MathVariant BOLD_SCRIPT
        Mathvariant constant. Bold script style.
      • DOUBLE_STRUCK

        public static final MathVariant DOUBLE_STRUCK
        Mathvariant constant. Double struck style.
      • FRAKTUR

        public static final MathVariant FRAKTUR
        Mathvariant constant. Fraktur style.
      • ITALIC

        public static final MathVariant ITALIC
        Mathvariant constant. Italic style.
      • MONOSPACE

        public static final MathVariant MONOSPACE
        Mathvariant constant. Monospace style.
      • NORMAL

        public static final MathVariant NORMAL
        Mathvariant constant. Normal style.
      • SANS_SERIF

        public static final MathVariant SANS_SERIF
        Mathvariant constant. Sans-serif style.
      • SANS_SERIF_BOLD_ITALIC

        public static final MathVariant SANS_SERIF_BOLD_ITALIC
        Mathvariant constant. Bold italic sans-serif style.
      • SANS_SERIF_ITALIC

        public static final MathVariant SANS_SERIF_ITALIC
        Mathvariant constant. Italic sans-serif style.
      • SCRIPT

        public static final MathVariant SCRIPT
        Mathvariant constant. Script style.
    • Constructor Detail

      • MathVariant

        public MathVariant​(int awtstyle,
                           FontFamily family)
        Creates a Mathvariant with the given AWT-Style and font-family.
        Parameters:
        awtstyle - the awt Style
        family - the font family
    • Method Detail

      • stringToMathVariant

        public static MathVariant stringToMathVariant​(java.lang.String variant)
        Creates a Mathvariant object from an attribute value.
        Parameters:
        variant - the string representation of the attribute value
        Returns:
        a mathVariant object or null if none is found.
      • createFont

        public java.awt.Font createFont​(float size,
                                        int codepoint,
                                        LayoutContext context,
                                        boolean force)
        Create a font for the given attributes.
        Parameters:
        size - size of the font to create
        codepoint - a character that must exist in this font
        context - LayoutContext to use.
        force - if true will always return a font, otherwise will return null.
        Returns:
        a font object.
      • getAwtStyle

        public int getAwtStyle()
        Returns:
        the awtStyle
      • getFontFamily

        public FontFamily getFontFamily()
        Returns:
        the fontFamily
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object