Class TTFont
- java.lang.Object
-
- nl.colorize.multimedialib.graphics.TTFont
-
public class TTFont extends java.lang.ObjectRepresents a TrueType font that can be used to draw text.There are two ways to obtain a font. The first is to create an instance of this class manually, which will use the local system fonts. If no font with the requested name is available, this will revert to the system's default font. The second approach is to load a font from a
.ttffile using theMediaLoaderclass. This ensures that the requested font is available.
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_SIZE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TTFontderive(int newSize)Returns a version of this font that uses the same font family and color, but has a different size.TTFontderive(ColorRGB newColor)Returns a version of this font which uses the same font family and size, but has a different color.booleanequals(java.lang.Object o)ColorRGBgetColor()java.lang.StringgetFamily()intgetSize()inthashCode()java.lang.StringtoString()
-
-
-
Field Detail
-
DEFAULT_SIZE
public static final int DEFAULT_SIZE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TTFont
public TTFont(java.lang.String family, int size, ColorRGB color)
-
-
Method Detail
-
getFamily
public java.lang.String getFamily()
-
getSize
public int getSize()
-
getColor
public ColorRGB getColor()
-
derive
public TTFont derive(int newSize)
Returns a version of this font that uses the same font family and color, but has a different size.
-
derive
public TTFont derive(ColorRGB newColor)
Returns a version of this font which uses the same font family and size, but has a different color.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-