Difference between revisions of "Legacy:Functions/Fonts"

From Spherical
Jump to: navigation, search
(created)
 
(Saving to disk: fix link)
 
Line 35: Line 35:
 
==== Saving to disk ====
 
==== Saving to disk ====
  
* [[API:Font/clone|Font.save]](filename): saves the Font_object as a font using the filename 'filename'
+
* [[API:Font/save|Font.save]](filename): saves the Font_object as a font using the filename 'filename'

Latest revision as of 21:36, 24 June 2013

Fonts

  • Sphere Font object: The graphical representation of text.
  • GetSystemFont(): Load the default system font.
  • LoadFont(): Load a font file.

Font object

Drawing text

  • Font.drawText(x, y, text): Draw text at (x, y) using the font.
  • Font.drawTextBox(x, y, width, height, y_offset, text): Draw wrapped text, shifted up/down by y_offset, in the box (x, y, width, height).
  • Font.drawZoomedText(x, y, scale, text): Draw scaled text with upper-left corner (x, y) using the font.
  • Font.wordWrapString(string, width): Splits a string into an array of lines as if it were wrapped using Font.drawTextBox().

Font size info

Font color masking

Font characters

Saving to disk

  • Font.save(filename): saves the Font_object as a font using the filename 'filename'