public class FontUtils
extends java.lang.Object
| Constructor and Description |
|---|
FontUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
drawTextVerticallyCentered(android.graphics.Canvas canvas,
java.lang.String text,
float cx,
float cy,
android.graphics.Paint paint)
Draws text vertically centered on the specified coordinates
|
static float |
getFontHeight(android.graphics.Paint paint)
Determines the height of the tallest character that can be drawn by paint.
|
static android.graphics.Rect |
getPackedStringDimensions(java.lang.String text,
android.graphics.Paint paint)
Get the smallest rect that ecompasses the text to be drawn using paint.
|
static android.graphics.Rect |
getStringDimensions(java.lang.String text,
android.graphics.Paint paint)
Like getPackedStringDimensions except adds extra space to accommodate all
characters that can be drawn regardless of whether or not they exist in text.
|
public static float getFontHeight(android.graphics.Paint paint)
paint - public static android.graphics.Rect getPackedStringDimensions(java.lang.String text,
android.graphics.Paint paint)
text - paint - public static android.graphics.Rect getStringDimensions(java.lang.String text,
android.graphics.Paint paint)
text - paint - public static void drawTextVerticallyCentered(android.graphics.Canvas canvas,
java.lang.String text,
float cx,
float cy,
android.graphics.Paint paint)
canvas - paint - text - cx - cy -