Class MathVariant
- java.lang.Object
-
- net.sourceforge.jeuclid.elements.support.attributes.MathVariant
-
- All Implemented Interfaces:
java.io.Serializable
public final class MathVariant extends java.lang.Object implements java.io.SerializableClass to represent and use MathVariants.- Version:
- $Revision: e6bd6c2d9bf4 $
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static MathVariantBOLDMathvariant constant.static MathVariantBOLD_FRAKTURMathvariant constant.static MathVariantBOLD_ITALICMathvariant constant.static MathVariantBOLD_SANS_SERIFMathvariant constant.static MathVariantBOLD_SCRIPTMathvariant constant.static MathVariantDOUBLE_STRUCKMathvariant constant.static MathVariantFRAKTURMathvariant constant.static MathVariantITALICMathvariant constant.static MathVariantMONOSPACEMathvariant constant.static MathVariantNORMALMathvariant constant.static MathVariantSANS_SERIFMathvariant constant.static MathVariantSANS_SERIF_BOLD_ITALICMathvariant constant.static MathVariantSANS_SERIF_ITALICMathvariant constant.static MathVariantSCRIPTMathvariant constant.
-
Constructor Summary
Constructors Constructor Description MathVariant(int awtstyle, FontFamily family)Creates a Mathvariant with the given AWT-Style and font-family.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.FontcreateFont(float size, int codepoint, LayoutContext context, boolean force)Create a font for the given attributes.booleanequals(java.lang.Object obj)intgetAwtStyle()FontFamilygetFontFamily()inthashCode()static MathVariantstringToMathVariant(java.lang.String variant)Creates a Mathvariant object from an attribute value.java.lang.StringtoString()
-
-
-
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 Stylefamily- 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 createcodepoint- a character that must exist in this fontcontext- 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:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-