Skip to content

Ttf FontSizeUnicode

Tangent 128 edited this page Mar 28, 2015 · 3 revisions

Font:sizeUnicode

Compute the text size.

Method

SYNOPSIS

w, h, err = function Font:sizeText(seq)

ARGUMENTS

  • seq, a sequence table of all unicode characters

RETURNS

  • w, the width or nil on failure
  • h, the height or nil on failure
  • err, the error message

EXAMPLE

-- "Gérard" 
local s = { 'G', 233, 'r', 'a', 'r', 'd' }

-- f is a font loaded with ttf.openFont
local w, h = f:sizeUnicode(s)
Clone this wiki locally