Type Function Library native.* Return value Userdata Revision Release 2024.3703 Keywords font, custom font, fonts See also Using Custom Fonts (guide) native.getFontNames() display.newText()
Creates a font object that you can use to specify fonts in native text fields, native text boxes, and text display objects.
Available fonts are platform-dependent. Also, the fonts available in the Simulator may be different from the fonts actually available on the device. When in doubt, check the available device font names using native.getFontNames().
native.newFont( name [, size] )
String, Userdata, or Constant. This can be one of the following:
main.lua
).Number. The point size of the font to use. By default, it will be the standard system font size of the device.
local textBox = native.newTextBox( 30, 140, 260, 100 ) textBox.font = native.newFont( "Helvetica-Bold", 16 ) textBox:setTextColor( 0.5 )