Click or drag to resize
Ab4d.SharpEngine logo

BitmapFont Class

BitmapFont class defines a font that is created by a bitmap with rendered characters and font data that define where on the bitmap each character is. This class can read bitmap font from binary data (usually form .fnt files). The created BitmapFont can be used by the BitmapTextCreator. To use the build-in default font call the GetDefaultBitmapTextCreator(Scene) method. See remarks for the BitmapTextCreator for more information on how to generate bitmap font files.
Inheritance Hierarchy
SystemObject
  Ab4d.SharpEngine.UtilitiesBitmapFont

Namespace: Ab4d.SharpEngine.Utilities
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 2.0.8956+4c7684e186ca1be74e7a284fbe739d9a1b843d3c
Syntax
C#
public class BitmapFont

The BitmapFont type exposes the following members.

Constructors
 NameDescription
Public methodBitmapFont(Stream)Constructor with Stream
Public methodBitmapFont(String)Constructor with file name
Top
Properties
 NameDescription
Public propertyAlphaChannel 0 if the channel holds the glyph data, 1 if it holds the outline, 2 if it holds the glyph and the outline, 3 if its set to zero, and 4 if its set to one.
Public propertyBaseHeight The number of pixels from the absolute top of the line to the base of the characters.
Public propertyBlueChannel 0 if the channel holds the glyph data, 1 if it holds the outline, 2 if it holds the glyph and the outline, 3 if its set to zero, and 4 if its set to one.
Public propertyBold True if the font is bold.
Public propertyCharacters The characters that comprise the font.
Public propertyCharset Gets or sets the name of the OEM charset used.
Public propertyFamilyName The name of the true type font.
Public propertyFontSize The size of the font.
Public propertyGreenChannel 0 if the channel holds the glyph data, 1 if it holds the outline, 2 if it holds the glyph and the outline, 3 if its set to zero, and 4 if its set to one.
Public propertyInvalidChar Gets the fallback character used when a matching character cannot be found.
Public propertyItalic True if the font is italic.
Public propertyItem Indexer to get items within this collection using array index syntax.
Public propertyKernings The character kernings for the font.
Public propertyLineHeight This is the distance in pixels between each line of text.
Public propertyOutlineSize The outline thickness for the characters.
Public propertyPacked True if the monochrome characters have been packed into each of the texture channels. In this case alphaChannel describes what is stored in each channel.
Public propertyPadding The padding for each character.
Public propertyPages Texture pages for the font.
Public propertyRedChannel 0 if the channel holds the glyph data, 1 if it holds the outline, 2 if it holds the glyph and the outline, 3 if its set to zero, and 4 if its set to one.
Public propertySmoothed True if the font is smoothed.
Public propertyStretchedHeight The font height stretch.
Public propertySuperSampling The level of super sampling used by the font.
Public propertyTextureHeight The height of the texture, normally used to scale the y pos of the character image.
Public propertyTextureWidth The width of the texture, normally used to scale the x pos of the character image.
Public propertyUnicode True if the font is Unicode.
Public propertyXSpacing The horizontal spacing for each character
Public propertyYSpacing The vertical spacing for each character
Top
Methods
 NameDescription
Public methodGetKerning Gets the kerning for the specified character combination.
Public methodMeasureText Provides the size, in pixels, of the specified text when drawn with this font. When maxWidth is bigger then 0, then text is wrapped keep within the specified with.
Top
See Also