public class VectorFont
extends java.lang.Object
Constructor and Description |
---|
VectorFont() |
Modifier and Type | Method and Description |
---|---|
static int |
charWidthNative(int face,
float size,
char character)
Gets the width of the given character with this font.
The width is the horizontal distance that would be occupied if the character was drawn using this font. |
static java.awt.Font |
get(int fontHandle,
float size)
Gets a
Font given its handle. |
static int |
getBaselinePositionNative(int face,
float height)
Returns the vertical distance in pixels between the top of this font and its baseline for the given height.
|
static int |
loadTrueTypeFont(byte[] fontPath)
Loads a font given its path.
|
static int |
stringWidthNative(int face,
float size,
char[] str)
Gets the width of the given string with this font.
The width is the horizontal distance that would be occupied if the string was drawn using this font. |
public static int loadTrueTypeFont(byte[] fontPath)
fontPath
- the path of the font in the application classpath in C string formatpublic static final java.awt.Font get(int fontHandle, float size)
Font
given its handle.
The font must have been previously loaded.fontHandle
- the font handlesize
- the font height in number of pixelsFont
public static int charWidthNative(int face, float size, char character)
face
- the reference to the fontsize
- the font height in number of pixelscharacter
- the character to measurepublic static int stringWidthNative(int face, float size, char[] str)
face
- the reference to the fontsize
- the font height in number of pixelsstr
- the string to measure as a char arraypublic static int getBaselinePositionNative(int face, float height)
face
- the reference to the fontheight
- the size of the font in pixel