public class FontHelper extends Object
| Constructor and Description |
|---|
FontHelper() |
| Modifier and Type | Method and Description |
|---|---|
static int |
getCharacterIndexFromPixelPosition(RenderFont font,
CharSequence text,
int pixel,
float size)
get index into text from a given pixel position.
|
static char |
getNextCharacter(CharSequence text,
int i) |
static char |
getPrevCharacter(CharSequence text,
int i) |
static int |
getVisibleCharactersFromEnd(RenderFont font,
CharSequence 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,
CharSequence 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, CharSequence text, int width, float size)
font - fonttext - the string to checkwidth - the minimum widthpublic static int getVisibleCharactersFromEnd(RenderFont font, CharSequence text, int width, float size)
font - fonttext - the string to checkwidth - the minimum widthpublic static int getCharacterIndexFromPixelPosition(RenderFont font, CharSequence text, int pixel, float size)
font - fonttext - text stringpixel - pixel indexsize - font sizepublic static char getNextCharacter(CharSequence text, int i)
text - i - public static char getPrevCharacter(CharSequence text, int i)
text - i - Copyright © 2013. All Rights Reserved.