Package 

Class FontUtils

    • Method Summary

      Modifier and Type Method Description
      static float getFontHeight(Paint paint) Determines the height of the tallest character that can be drawn by paint.
      static Rect getPackedStringDimensions(String text, Paint paint) Get the smallest rect that ecompasses the text to be drawn using paint.
      static Rect getStringDimensions(String text, Paint paint) Like getPackedStringDimensions except adds extra space to accommodate allcharacters that can be drawn regardless of whether or not they exist in text.This ensures a more uniform appearance for things that have dynamic text.
      static void drawTextVerticallyCentered(Canvas canvas, String text, float cx, float cy, Paint paint) Draws text vertically centered on the specified coordinates
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getFontHeight

         static float getFontHeight(Paint paint)

        Determines the height of the tallest character that can be drawn by paint.

      • getStringDimensions

         static Rect getStringDimensions(String text, Paint paint)

        Like getPackedStringDimensions except adds extra space to accommodate allcharacters that can be drawn regardless of whether or not they exist in text.This ensures a more uniform appearance for things that have dynamic text.