ERY.AgateLib.ImplBase.BitmapFontImpl Class Reference

Provides a basic implementation for the use of non-system fonts provided as a bitmap. More...

Inherits ERY.AgateLib.ImplBase.FontSurfaceImpl.

List of all members.

Public Member Functions

 BitmapFontImpl (string filename, Size characterSize)
 Constructs a BitmapFontImpl, assuming the characters in the given file are all the same size, and are in their ASCII order.
 BitmapFontImpl (Surface surface, IDictionary< char, RectangleF > srcRects)
 Constructs a BitmapFontImpl, taking the passed surface as the source for the characters. The source rectangles for each character are passed in.
override void Dispose ()
 Disposes of the object.
override int StringDisplayWidth (string text)
 Measures the width of the text.
override int StringDisplayHeight (string text)
 Measures the height of the text.
override Size StringDisplaySize (string text)
 Measures the size of the text.
override void DrawText (int destX, int destY, string text)
 Draws the text to the screen.
override void DrawText (double destX, double destY, string text)
 Draws the text to the screen.
override void DrawText (Point destPt, string text)
 Draws the text to the screen.
override void DrawText (PointF destPt, string text)
 Draws the text to the screen.

Static Public Member Functions

static FontSurfaceImpl FromOSFont (string fontFamily, float sizeInPoints, FontStyle style)
 Creates a bitmap font by loading an OS font, and drawing it to a bitmap to use as a Surface object. You should only use this method if writing a driver.

Properties

override Color Color [get, set]
 Overrides the base Color method to catch color changes to set them on the surface.


Detailed Description

Provides a basic implementation for the use of non-system fonts provided as a bitmap.

To construct a bitmap font, call the appropriate static FontSurface method.


Constructor & Destructor Documentation

ERY.AgateLib.ImplBase.BitmapFontImpl.BitmapFontImpl ( string  filename,
Size  characterSize 
)

Constructs a BitmapFontImpl, assuming the characters in the given file are all the same size, and are in their ASCII order.

Parameters:
filename 
characterSize 

ERY.AgateLib.ImplBase.BitmapFontImpl.BitmapFontImpl ( Surface  surface,
IDictionary< char, RectangleF srcRects 
)

Constructs a BitmapFontImpl, taking the passed surface as the source for the characters. The source rectangles for each character are passed in.

Parameters:
surface Surface which contains the image data for the font glyphs.
srcRects An object implementing the IDictionary<char, Rectangle> interface, containing the source rectangles on the surface for each font glyph.


Member Function Documentation

override void ERY.AgateLib.ImplBase.BitmapFontImpl.Dispose (  )  [virtual]

Disposes of the object.

Implements ERY.AgateLib.ImplBase.FontSurfaceImpl.

static FontSurfaceImpl ERY.AgateLib.ImplBase.BitmapFontImpl.FromOSFont ( string  fontFamily,
float  sizeInPoints,
FontStyle  style 
) [static]

Creates a bitmap font by loading an OS font, and drawing it to a bitmap to use as a Surface object. You should only use this method if writing a driver.

See also:
FontSurface.BitmapFont(string, float, FontStyle)

Parameters:
fontFamily 
sizeInPoints 
style 
Returns:

override int ERY.AgateLib.ImplBase.BitmapFontImpl.StringDisplayWidth ( string  text  )  [virtual]

Measures the width of the text.

Parameters:
text 
Returns:

Implements ERY.AgateLib.ImplBase.FontSurfaceImpl.

override int ERY.AgateLib.ImplBase.BitmapFontImpl.StringDisplayHeight ( string  text  )  [virtual]

Measures the height of the text.

Parameters:
text 
Returns:

Implements ERY.AgateLib.ImplBase.FontSurfaceImpl.

override Size ERY.AgateLib.ImplBase.BitmapFontImpl.StringDisplaySize ( string  text  )  [virtual]

Measures the size of the text.

Parameters:
text 
Returns:

Implements ERY.AgateLib.ImplBase.FontSurfaceImpl.

override void ERY.AgateLib.ImplBase.BitmapFontImpl.DrawText ( int  destX,
int  destY,
string  text 
) [virtual]

Draws the text to the screen.

Parameters:
destX 
destY 
text 

Implements ERY.AgateLib.ImplBase.FontSurfaceImpl.

override void ERY.AgateLib.ImplBase.BitmapFontImpl.DrawText ( double  destX,
double  destY,
string  text 
) [virtual]

Draws the text to the screen.

Parameters:
destX 
destY 
text 

Implements ERY.AgateLib.ImplBase.FontSurfaceImpl.

override void ERY.AgateLib.ImplBase.BitmapFontImpl.DrawText ( Point  destPt,
string  text 
) [virtual]

Draws the text to the screen.

Parameters:
destPt 
text 

Implements ERY.AgateLib.ImplBase.FontSurfaceImpl.

override void ERY.AgateLib.ImplBase.BitmapFontImpl.DrawText ( PointF  destPt,
string  text 
) [virtual]

Draws the text to the screen.

Parameters:
destPt 
text 

Implements ERY.AgateLib.ImplBase.FontSurfaceImpl.


Property Documentation

override Color ERY.AgateLib.ImplBase.BitmapFontImpl.Color [get, set]

Overrides the base Color method to catch color changes to set them on the surface.

Reimplemented from ERY.AgateLib.ImplBase.FontSurfaceImpl.


The documentation for this class was generated from the following file:
AgateLib
Awesome Game and Tool Engine Library
SourceForge.net Logo