Package ilcd
Class Control

Public Method getUnicodeTextExtent

static Size getUnicodeTextExtent(String unicodeText)

Throws:

_INSERT_METHOD_SIGNATURE_HERE_

Description:

Parameter Range Description
unicodeText Unicode chars ('/u0001' ... '/uFFFF') unicode text to measure

this method returns:

Returns Description
static Size size of the unicode text

This method returns the extent of a unicode text string according to the current font. The Size return type delivers the height and width values of the unicodeText.

Note

Example

Size textUnicode = Control.getUnicodeTextExtent("Hello World!");

int height = textUnicode.getHeight();

int width  = textUnicode.getWidth();

Alternatively a value can be optained with a single call:

int height = Control.getUnicodeTextExtent("Hello World!").getHeight();

int width  = Control.getUnicodeTextExtent("Hello World!").getWidth();

This response means that the Unicode text "Hello World!" will occupy a space of width = 81 (0x51) pixels, and height = 16 (0x10) pixels with the selected font.

See also:

Draw.writeASCIIText(String)
Draw.writeText(String)
Control.getTextExtent(String)
Control.getTextMessageExtent(int)