Home  Contents

Character Range

Graphics Core4 Lua Commands

SYNOPSIS

  1. ch = fnt:first_char()
  2. ch = fnt:last_char()

DESCRIPTION

A loaded font doesn't usually contain the full range of unicode characters. These functions allow querying the first and last character code available in the font. Please note that the font still might not contain all characters inbetween.

RETURN VALUE

The function fnt:first_char() returns the codepoint of the first character, and fnt:last_char() returns the codepoint of the last character in the font.

ERRORS

Raises an error if fnt is not a font handle.

EXAMPLE

>  > 
fnt = gfx.default_font() print (fnt:first_char(), fnt:last_char())
32 255

SEE ALSO