public class TextWidthUtils
extends java.lang.Object
| Constructor and Description |
|---|
TextWidthUtils() |
| Modifier and Type | Method and Description |
|---|---|
static float |
getComponentWidth(ATextComponent component)
Calculate the width of a component using the default widths.
|
static float |
getComponentWidth(ATextComponent component,
float[] widths)
Calculate the width of a component using the given widths array.
|
static float |
getComponentWidth(ATextComponent component,
float[] widths,
float boldOffset)
Calculate the width of a component using the given widths array.
|
public static float getComponentWidth(ATextComponent component)
charwidths.bin resource.component - The component to calculate the width ofjava.lang.IllegalStateException - If the charwidths.bin resource could not be foundjava.lang.RuntimeException - If the charwidths.bin resource could not be readpublic static float getComponentWidth(ATextComponent component, float[] widths)
component - The component to calculate the width ofwidths - The char widths arraypublic static float getComponentWidth(ATextComponent component, float[] widths, float boldOffset)
component - The component to calculate the width ofwidths - The char widths arrayboldOffset - The bold offset