Page.measureText

Calculates the byte length which can be included within the specified width.

class Page
uint
measureText
(
string text
,
float width
,,
float* realWidth
)

Parameters

text string

The text to get width.

width float

The width of the area to put the text.

wordWrap bool

When there are three words of "ABCDE", "FGH", and "IJKL", and the substring until "J" can be included within the width, if wordWrap parameter is false it returns 12, and if word_wrap parameter is true, it returns 10 (the end of the previous word).

realWidth float*

If this parameter is not null, the real widths of the text is set. An application can set it to null, if it is unnecessary.

Return Value

Type: uint

When succeed it returns the byte length which can be included within the specified width in current fontsize, character spacing and word spacing. Otherwise it returns ZERO and error-handler is called.

Meta