public class Font
extends java.lang.Object
Constructor and Description |
---|
Font(boolean bold,
boolean italic,
int size)
Creates a sans serif font with the specified size and style.
|
Font(int size)
Creates a sans serif font of a given size.
|
Font(java.lang.String name,
boolean bold,
boolean italic,
int size)
Creates a font from the specified font name, size and style.
|
Font(java.lang.String name,
int size)
Creates a font from the specified font name and size.
|
Modifier and Type | Method and Description |
---|---|
Font |
deriveFont(float size)
Returns a new
Font object obtained by deriving the
java.awt.Font font field applying a new size to it. |
boolean |
equals(java.lang.Object obj)
* Determines whether another object is equal to this font.
|
java.lang.String |
getName()
Returns the logical name of this font.
|
int |
getSize()
Returns the point size of this font, rounded to an integer.
|
int |
hashCode()
Returns a hashcode for this font.
|
boolean |
isBold()
Indicates whether or not this Font style is bold.
|
boolean |
isItalic()
Indicates whether or not this Font style is italic.
|
boolean |
isPlain()
Indicates whether or not this Font style is plain.
|
java.lang.String |
toString()
Return a text representation of the font.
|
public Font(java.lang.String name, boolean bold, boolean italic, int size)
name
- The font namebold
- True if the font is meant to be bolditalic
- True if the font is meant to be italicsize
- The size of the fontpublic Font(boolean bold, boolean italic, int size)
bold
- True if the font is meant to be bolditalic
- True if the font is meant to be italicsize
- The size of the fontpublic Font(java.lang.String name, int size)
name
- The font namesize
- The size of the fontpublic Font(int size)
size
- The size of the fontpublic boolean isPlain()
public boolean isBold()
public boolean isItalic()
public java.lang.String getName()
String
representing the logical name of this font.public int getSize()
public Font deriveFont(float size)
Font
object obtained by deriving the
java.awt.Font font
field applying a new size to it.size
- the size for the new Font
Font
object.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object to test for equality with this fontpublic int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object