public class FontHelper extends Object
Constructor and Description |
---|
FontHelper() |
Modifier and Type | Method and Description |
---|---|
static int |
getCharacterIndexFromPixelPosition(RenderFont font,
String text,
int pixel,
float size)
get index into text from a given pixel position.
|
static char |
getNextCharacter(String text,
int i) |
static char |
getPrevCharacter(String text,
int i) |
static int |
getVisibleCharactersFromEnd(RenderFont font,
String text,
int width,
float size)
Get character index into the given text that is no more pixel as the given width.
|
static int |
getVisibleCharactersFromStart(RenderFont font,
String text,
int width,
float size)
Get character index into the given text that is no more pixel as the given width.
|
public static int getVisibleCharactersFromStart(RenderFont font, String text, int width, float size)
font
- fonttext
- the string to checkwidth
- the minimum widthpublic static int getVisibleCharactersFromEnd(RenderFont font, String text, int width, float size)
font
- fonttext
- the string to checkwidth
- the minimum widthpublic static int getCharacterIndexFromPixelPosition(RenderFont font, String text, int pixel, float size)
font
- fonttext
- text stringpixel
- pixel indexsize
- font sizepublic static char getNextCharacter(String text, int i)
text
- i
- public static char getPrevCharacter(String text, int i)
text
- i
- Copyright © 2013. All Rights Reserved.