C# Class FontPack.PackedFont

PackedFont - Class to read fonts packed by FontPacker
Show file Open project: sriharshachilakapati/FontPacker Class Usage Examples

Public Methods

Method Description
DrawString ( string text, float x, float y, Graphics g ) : void

Draws a string using this font at a position using the given Graphics context.

GetAdvanceWidth ( char c ) : int

Get the AdvanceWidth of a glyph

GetGlyph ( char c ) : Image

Get the Glyph of the char

PackedFont ( Stream stream ) : System

Load a PackedFont from a stream.

PackedFont ( string filename ) : System

Load a PackedFont from a file.

Method Details

DrawString() public method

Draws a string using this font at a position using the given Graphics context.
public DrawString ( string text, float x, float y, Graphics g ) : void
text string The text to be drawn.
x float The x-position
y float The y-position
g System.Drawing.Graphics The graphics context to be used
return void

GetAdvanceWidth() public method

Get the AdvanceWidth of a glyph
public GetAdvanceWidth ( char c ) : int
c char The character of glyph
return int

GetGlyph() public method

Get the Glyph of the char
public GetGlyph ( char c ) : Image
c char The character of glyph
return Image

PackedFont() public method

Load a PackedFont from a stream.
public PackedFont ( Stream stream ) : System
stream Stream The stream containing the data.
return System

PackedFont() public method

Load a PackedFont from a file.
public PackedFont ( string filename ) : System
filename string The name of the file
return System