public class FontUtils
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
FontUtils.MeasureDirection |
| Constructor and Description |
|---|
FontUtils() |
| Modifier and Type | Method and Description |
|---|---|
static int |
breakText(IFont pFont,
java.lang.CharSequence pText,
FontUtils.MeasureDirection pMeasureDirection,
float pWidthMaximum,
float[] pMeasuredWidth)
Measure the text, stopping early if the measured width exceeds pMaximumWidth.
|
static float |
measureText(IFont pFont,
java.lang.CharSequence pText) |
static float |
measureText(IFont pFont,
java.lang.CharSequence pText,
float[] pWidths) |
static float |
measureText(IFont pFont,
java.lang.CharSequence pText,
int pStart,
int pEnd) |
static float |
measureText(IFont pFont,
java.lang.CharSequence pText,
int pStart,
int pEnd,
float[] pWidths)
Does not respect linebreaks!
|
static <L extends java.util.List<java.lang.CharSequence>> |
splitLines(java.lang.CharSequence pText,
L pResult) |
static <L extends java.util.List<java.lang.CharSequence>> |
splitLines(IFont pFont,
java.lang.CharSequence pText,
L pResult,
AutoWrap pAutoWrap,
float pAutoWrapWidth)
Does not respect linebreaks!
|
public static float measureText(IFont pFont, java.lang.CharSequence pText)
pFont - pText - public static float measureText(IFont pFont, java.lang.CharSequence pText, int pStart, int pEnd)
pFont - pText - pStart - the index of the first character to start measuring.pEnd - 1 beyond the index of the last character to measure.public static float measureText(IFont pFont, java.lang.CharSequence pText, float[] pWidths)
pFont - pText - pWidths - (optional) If not null, returns the actual width measured.public static float measureText(IFont pFont, java.lang.CharSequence pText, int pStart, int pEnd, float[] pWidths)
pFont - pText - pStart - the index of the first character to start measuring.pEnd - 1 beyond the index of the last character to measure.pWidths - (optional) If not null, returns the actual width after each character.public static int breakText(IFont pFont, java.lang.CharSequence pText, FontUtils.MeasureDirection pMeasureDirection, float pWidthMaximum, float[] pMeasuredWidth)
pFont - pText - pMeasureDirection - If FontUtils.MeasureDirection.FORWARDS, starts with the first character in the CharSequence. If FontUtils.MeasureDirection.BACKWARDS starts with the last character in the CharSequence.pWidthMaximum - pMeasuredWidth - (optional) If not null, returns the actual width measured. Must be an Array of size 1 or bigger.public static <L extends java.util.List<java.lang.CharSequence>> L splitLines(java.lang.CharSequence pText,
L pResult)