public class PointFont extends Object
Modifier and Type | Field and Description |
---|---|
static int |
BOLD
A bold font style.
|
static int |
ITALIC
An italic font style.
|
static int |
OUTLINE
An outlined font style.
|
static int |
PLAIN
A plain font style.
|
static int |
STRIKETHROUGH
A strikethrough font style.
|
static int |
SUBSCRIPT
A subscript font style.
|
static int |
SUPERSCRIPT
A superscript font style.
|
static int |
UNDERLINE
An underlined font style.
|
Constructor and Description |
---|
PointFont(String name,
int style,
double size)
Create a new Font.
|
PointFont(String name,
int style,
StringList text,
double width,
double height)
Specify a Font such that the size of the Font will be determined at runtime when applied to a
PointGraphics object using setFont().
|
Modifier and Type | Method and Description |
---|---|
PointFont |
change(FontChange fc)
Return a new Font with the specified changes applied.
|
PointFont |
change(int newStyle,
double newSize)
Return a new PointFont with the same name as this PointFont, but with a different size and style.
|
PointFont |
change(int newStyle,
StringList newText,
double fitWidth,
double fitHeight)
Return a new PointFont with the same name and style as this PointFont, but with a different size
as specified by the text which must fit into the specified dimensions.
|
PointFont |
changeSize(double newSize)
Return a new PointFont with the same name and style as this PointFont, but with a different size.
|
PointFont |
changeSize(StringList newText,
double fitWidth,
double fitHeight)
Return a new PointFont with the same name and style as this PointFont, but with a different size
as specified by the text which must fit into the specified dimensions.
|
PointFont |
changeStyle(int newStyle)
Return a new PointFont with the same size as this PointFont, but with a different style.
|
boolean |
equals(Object obj)
Returns if this object is considered equal to the other object.
|
String |
getName()
Return the name of the Font.
|
double |
getPointSize(PointFontDescriptor pd)
Return the size of the font as if it would be rendered on an ideal device.
|
double |
getSize()
Return the size of the font only if it was explicitly set.
|
double |
getSize(PointGraphics pg)
Return the size of the font as rendered on a specific PointGraphics.
|
int |
getStyle()
Return the style of the Font.
|
int |
hashCode()
Returns a hashCode for the object.
|
boolean |
isSame(PointFont f)
Return if this Font is the same as another.
|
String |
toString()
Return a String representation of this object.
|
public static final int PLAIN
public static final int BOLD
public static final int ITALIC
public static final int UNDERLINE
public static final int OUTLINE
public static final int STRIKETHROUGH
public static final int SUPERSCRIPT
public static final int SUBSCRIPT
public PointFont(String name, int style, double size)
name
- the name of the Font.style
- any of the font styles ORed together.size
- the size (height) of the Font in points.public PointFont(String name, int style, StringList text, double width, double height)
name
- the name of the Font.style
- any of the font styles ORed together.text
- the Text that must fit within the specified area.width
- the width of the text area in points.
Set this to a negative value if you are only interested in the height of the data.height
- the height of the text area in points.
Set this to a negative value if you are only interested in the width of the data.public String getName()
public int getStyle()
public double getSize(PointGraphics pg)
pg
- The destination PointGraphics.public double getSize()
public double getPointSize(PointFontDescriptor pd)
public PointFont changeStyle(int newStyle)
newStyle
- the style for the new font.public PointFont changeSize(double newSize)
newSize
- the size for the new font in points.public PointFont change(int newStyle, double newSize)
newStyle
- the style for the new font.newSize
- the size for the new font in points.public PointFont changeSize(StringList newText, double fitWidth, double fitHeight)
newText
- the new text.fitWidth
- the width of the area in points that the text must fit in.fitHeight
- the height of the area in points that the text must fit in.public PointFont change(int newStyle, StringList newText, double fitWidth, double fitHeight)
newStyle
- the style for the new font.newText
- the new text.fitWidth
- the width of the area in points that the text must fit in.fitHeight
- the height of the area in points that the text must fit in.public String toString()
Object
public int hashCode()
Object
public boolean isSame(PointFont f)
f
- another Font.public boolean equals(Object obj)
Object
public PointFont change(FontChange fc)
fc
- a FontChange object.