Class TTFont
- java.lang.Object
-
- nl.colorize.multimedialib.graphics.TTFont
-
- All Implemented Interfaces:
TextFont
public class TTFont extends java.lang.Object implements TextFont
Represents 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.TTFontderiveBold()Returns a bold version of this font.booleanequals(java.lang.Object o)ColorRGBgetColor()java.lang.StringgetFamily()intgetSize()inthashCode()booleanisBold()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
-
getColor
public ColorRGB getColor()
-
isBold
public boolean isBold()
-
derive
public TTFont derive(int newSize)
Description copied from interface:TextFontReturns a version of this font that uses the same font family and color, but has a different size.
-
derive
public TTFont derive(ColorRGB newColor)
Description copied from interface:TextFontReturns a version of this font which uses the same font family and size, but has a different color.
-
deriveBold
public TTFont deriveBold()
Description copied from interface:TextFontReturns a bold version of this font. All all properties will be identical to the current font.- Specified by:
deriveBoldin interfaceTextFont
-
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
-
-