DummyFontpublic abstract class Font
extends be.yildizgames.common.util.Resource
| Modifier and Type | Field | Description |
|---|---|---|
protected static int |
CHARS |
Number of char to use.
|
Color |
color |
Font color.
|
int |
size |
Font height.
|
| Modifier | Constructor | Description |
|---|---|---|
protected |
Font(String fontName,
int fontSize,
Color color) |
Full constructor.
|
| Modifier and Type | Method | Description |
|---|---|---|
int |
computeTextWidth(String text) |
Compute the width of a text with this font.
|
String |
crop(String originalText,
int width) |
Crop a text if it is longer than a given width.
|
boolean |
equals(Object obj) |
|
static Font |
get(String name) |
Retrieve a Font from its name.
|
float |
getCharSize(int key) |
Return the width of a particular char.
|
int |
hashCode() |
|
protected void |
setCharWidth(float[] widthArray) |
Set the size for every char for this font.
|
protected static final int CHARS
public final int size
public final Color color
public static Font get(String name)
name - Font to retrieve.public String crop(String originalText, int width)
originalText - Text to crop.width - Maximum text width allowed.public final int computeTextWidth(String text)
text - Text to use.public final float getCharSize(int key)
key - Char to get the width.protected final void setCharWidth(float[] widthArray)
widthArray - Array containing the size for every char.public final int hashCode()
hashCode in class be.yildizgames.common.util.BaseRegisterablepublic final boolean equals(Object obj)
equals in class be.yildizgames.common.util.BaseRegisterableCopyright © 2014–2018. All rights reserved.