Legacy:Functions/Fonts

From Spherical
< Legacy:Functions
Revision as of 17:32, 22 May 2013 by Apollolux (talk | contribs) (created)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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'