vx.Font

From vx
Revision as of 04:54, 4 August 2009 by Admin (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

Contents

[edit] vx.Font

A bitmap font handle that can do a bunch of printing operations.

[edit] Constructors

vx.Font(handle_index)

  • Wraps around a raw verge handle. It is doubtful you'll need to use this, as the only real objects that need to be raw handles to begin with is font 0.

vx.Font(filename)

  • Open an font image from disk (autodetects size).

vx.Font(filename, width, height)

  • Open an font image from disk with specified cell width and height (for when autodetect fails).

[edit] Attributes

vx.Font.height -> number (read)

  • The height of the font in pixels

[edit] Methods

vx.Font:Free()

  • Destroys the font handle. Any further font operations on this object will probably not end so pretty.

vx.Font:EnableVariableWidth()

  • Enables variable width on the font, allowing each character in the font to be of a different width.

vx.Font:SetCharacterWidth(character, width)

  • Forces a specific character to be the given width in pixels wide.

vx.Font:TextWidth(text) -> number

  • Gets the width of the given text string in pixels

vx.Font:Print(x, y, text, [dest])

  • Draws the given text to the specified spot on a destination image. If destination is not given, it assumes you want the screen.

vx.Font:PrintRight(x, y, text, [dest])

  • Prints the text with right justification at (x, y)

vx.Font:PrintCenter(x, y, text, [dest])

  • Prints the text centered at (x, y)

vs.Font:WrapText(text, width) -> string

  • Returns a string that is the given text with newlines inserted so that it wraps within the given width.
Personal tools