Package chemaxon.struc.graphics
Class MFont
java.lang.Object
chemaxon.struc.graphics.MFont
- All Implemented Interfaces:
- Serializable,- Cloneable
Font wrapper class that does not require an X server.
- Since:
- Marvin 4.1, 11/29/2005
- See Also:
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionclone()Creates a clone.Creates a clone.booleanTests whether two font objects equal.Gets an AWT font instance.Gets the font family name.getScaledAWTFont(Float scale) Gets an AWT font instance after scaling.doubleGets the font size.Gets the string representation.intgetStyle()Gets the font style.inthashCode()booleanisBold()Tests whether the font is bold.booleanisItalic()Tests whether the font is italic.static StringsizeToString(double size) Converts an integer or fractional size to a string.toString()
- 
Field Details- 
PLAINpublic static final int PLAINPlain font style.- See Also:
 
- 
BOLDpublic static final int BOLDBold font style.- See Also:
 
- 
ITALICpublic static final int ITALICItalic font style.- See Also:
 
 
- 
- 
Constructor Details- 
MFontContructs a font.- Parameters:
- family- the family
- style- the style
- size- the size
 
- 
MFontParses a font from a string.- Parameters:
- str- the string to be converted
- Throws:
- IllegalArgumentException
 
- 
MFontCopy constructor.- Parameters:
- f- the font to copy
 
- 
MFontCreate a wrapper for the specified AWT font.- Parameters:
- f- the AWT font
 
 
- 
- 
Method Details- 
getFamilyGets the font family name.- Returns:
- the font family
 
- 
getStylepublic int getStyle()Gets the font style.- Returns:
- the font style
 
- 
getSizeDoublepublic double getSizeDouble()Gets the font size.- Returns:
- the font size
 
- 
isBoldpublic boolean isBold()Tests whether the font is bold.- Returns:
- true if the font is bold, false otherwise
 
- 
isItalicpublic boolean isItalic()Tests whether the font is italic.- Returns:
- true if the font is italic, false otherwise
 
- 
getAWTFontGets an AWT font instance.- Returns:
- the AWT font
 
- 
getScaledAWTFontGets an AWT font instance after scaling.- Parameters:
- scale- the scaling factor
- Returns:
- the AWT font
 
- 
getStringGets the string representation.- Returns:
- the string representation
 
- 
equalsTests whether two font objects equal.
- 
hashCodepublic int hashCode()
- 
cloneMFontCreates a clone.- Returns:
- the clone
 
- 
cloneCreates a clone.
- 
sizeToStringConverts an integer or fractional size to a string.- Returns:
- the string
 
- 
toString
 
-