Name
font:MeasureText -- calculate text byte length
Synopsis
bl, rw = font:MeasureText(text, len, width, fontsize, charspace,
              wordspace, wordwrap)
Function
font:MeasureText() calculates the byte length which can be included within the specified width.

The wordwrap parameter configures how words should be wrapped: Suppose there are three words: "ABCDE", "FGH", and "IJKL". Also, suppose the substring until "J" can be included within the width (12 bytes). If wordwrap is False the function returns 12. If wordwrap parameter is True, it returns 10 (the end of the previous word).

On success, returns byte length which can be included within specified width. Otherwise, returns 0.

Inputs
text
the text to use for calculation
len
the length of the text
width
the width of the area to put the text
fontsize
the size of the font
charspace
the character spacing
wordspace
the word spacing
wordwrap
boolean indicating whether to enable wordwrapping
Results
bl
byte length
rw
real width of text

Show TOC