C# Class Axiom.Fonts.Font

This class is simply a way of getting a font texture into the engine and to easily retrieve the texture coordinates required to accurately render them. Fonts can either be loaded from precreated textures, or the texture can be generated using a truetype font. You can either create the texture manually in code, or you can use an XML font script to define it (probably more practical since you can reuse the definition more easily)
This class extends both Resource and ManualResourceLoader since it is both a resource in it's own right, but it also provides the manual load implementation for the Texture it creates.
Inheritance: Axiom.Core.Resource, IManualResourceLoader
Mostra file Open project: WolfgangSt/axiom Class Usage Examples

Public Methods

Method Description
Font ( ResourceManager parent, string name, System.UInt64 handle, string group ) : System

Constructor, should be called through FontManager.Create().

Font ( ResourceManager parent, string name, System.UInt64 handle, string group, bool isManual, IManualResourceLoader loader ) : System
LoadResource ( Axiom.Core.Resource resource ) : void

Protected Methods

Method Description
calculateSize ( ) : int
createTexture ( ) : void
load ( ) : void
unload ( ) : void

Private Methods

Method Description
GetGlyphAspectRatio ( char c ) : float
GetGlyphTexCoords ( UInt32 c, Real &u1, Real &v1, Real &u2, Real &v2 ) : void
SetGlyphTexCoords ( UInt32 c, Real u1, Real v1, Real u2, Real v2 ) : void
SetGlyphTexCoords ( UInt32 c, Real u1, Real v1, Real u2, Real v2, Real aspect ) : void
StrBBox ( string text, float char_height, Axiom.Graphics.RenderWindow window ) : Pair

Returns the size in pixels of a box that could contain the whole string.

Method Details

Font() public method

Constructor, should be called through FontManager.Create().
public Font ( ResourceManager parent, string name, System.UInt64 handle, string group ) : System
parent Axiom.Core.ResourceManager
name string
handle System.UInt64
group string
return System

Font() public method

public Font ( ResourceManager parent, string name, System.UInt64 handle, string group, bool isManual, IManualResourceLoader loader ) : System
parent Axiom.Core.ResourceManager
name string
handle System.UInt64
group string
isManual bool
loader IManualResourceLoader
return System

LoadResource() public method

public LoadResource ( Axiom.Core.Resource resource ) : void
resource Axiom.Core.Resource
return void

calculateSize() protected method

protected calculateSize ( ) : int
return int

createTexture() protected method

protected createTexture ( ) : void
return void

load() protected method

protected load ( ) : void
return void

unload() protected method

protected unload ( ) : void
return void