xhookLua
Game

Font

Custom font from draw.create_font, ready one frame after creation or a Themes font reload.

Methods

font:ready

font:ready() -> boolean

True once in the atlas; until then draw.text_font uses the menu font.

Stays false forever if the font file is missing.

font:size

font:size() -> number

Created pixel height, clamped to 4 to 256.

Returns 0 while not ready

font:measure

font:measure(text [, size]) -> w, h
NameTypeDescription
textstring
sizeoptionalnumberPixel size. Default the font's size.

Measures text as draw.text_font draws it.

Returns pixels

Menu-font results while not ready; 0, 0 before the first menu frame.

Font ยท Lua API ยท xhook