Class FontSystem
The system managing the fonts.
public class FontSystem : IFontFactory- Inheritance
- 
      objectFontSystem
- Implements
Constructors
FontSystem()
Create a new instance of FontSystem base on the provided GraphicsDevice.
public FontSystem()Methods
Draw()
public void Draw()Load(GraphicsDevice, IDatabaseFileProviderService)
Load this system.
public void Load(GraphicsDevice graphicsDevice, IDatabaseFileProviderService fileProviderService)Parameters
- graphicsDeviceGraphicsDevice
- The graphics device. 
- fileProviderServiceIDatabaseFileProviderService
Exceptions
- ArgumentNullException
- graphicsDevice 
NewDynamic(float, string, FontStyle, FontAntiAliasMode, bool, float, float, char)
Create a new instance of a dynamic font.
public SpriteFont NewDynamic(float defaultSize, string fontName, FontStyle style, FontAntiAliasMode antiAliasMode = FontAntiAliasMode.Default, bool useKerning = false, float extraSpacing = 0, float extraLineSpacing = 0, char defaultCharacter = ' ')Parameters
- defaultSizefloat
- The default size of the font in pixels. 
- fontNamestring
- The family name of the (TrueType) font. 
- styleFontStyle
- The style for the font. A combinaison of 'regular', 'bold' or 'italic'. 
- antiAliasModeFontAntiAliasMode
- The anti-aliasing mode to use when rendering the font. By default, font textures are rendered in levels of grey. 
- useKerningbool
- Specifies whether to use kerning information when rendering the font. Default value is false (NOT SUPPORTED YET) 
- extraSpacingfloat
- The character extra spacing in pixels. Zero is default spacing, negative closer together, positive further apart. 
- extraLineSpacingfloat
- This is the extra distance in pixels to add between each line of text. Zero is default spacing, negative closer together, positive further apart. 
- defaultCharacterchar
- The default character fall-back. 
Returns
- SpriteFont
- The newly created dynamic font 
NewScalable(float, IList<Glyph>, IList<Image>, float, float, IList<Kerning>, float, float, char)
Create a new instance of a scalable font.
public SpriteFont NewScalable(float size, IList<Glyph> glyphs, IList<Image> images, float baseOffset, float defaultLineSpacing, IList<Kerning> kernings = null, float extraSpacing = 0, float extraLineSpacing = 0, char defaultCharacter = ' ')Parameters
- sizefloat
- The size of the font in pixels. 
- glyphsIList<Glyph>
- The list of the font glyphs 
- imagesIList<Image>
- The list of images containing the font character data 
- baseOffsetfloat
- The number of pixels from the absolute top of the line to the base of the characters. 
- defaultLineSpacingfloat
- The default line spacing of the font. 
- kerningsIList<Kerning>
- The list of the kerning information of the font 
- extraSpacingfloat
- The character extra spacing in pixels. Zero is default spacing, negative closer together, positive further apart. 
- extraLineSpacingfloat
- This is the extra distance in pixels to add between each line of text. Zero is default spacing, negative closer together, positive further apart. 
- defaultCharacterchar
- The default character fall-back. 
Returns
- SpriteFont
- The newly created static font 
Remarks
The font does not copy the provided glyphs information. Provided glyphs should not be modified after the creation of the font.
NewScalable(float, IList<Glyph>, IList<Texture>, float, float, IList<Kerning>, float, float, char)
Create a new instance of a scalable font.
public SpriteFont NewScalable(float size, IList<Glyph> glyphs, IList<Texture> textures, float baseOffset, float defaultLineSpacing, IList<Kerning> kernings = null, float extraSpacing = 0, float extraLineSpacing = 0, char defaultCharacter = ' ')Parameters
- sizefloat
- The size of the font in pixels. 
- glyphsIList<Glyph>
- The list of the font glyphs 
- texturesIList<Texture>
- The list of textures containing the font character data 
- baseOffsetfloat
- The number of pixels from the absolute top of the line to the base of the characters. 
- defaultLineSpacingfloat
- The default line spacing of the font. 
- kerningsIList<Kerning>
- The list of the kerning information of the font 
- extraSpacingfloat
- The character extra spacing in pixels. Zero is default spacing, negative closer together, positive further apart. 
- extraLineSpacingfloat
- This is the extra distance in pixels to add between each line of text. Zero is default spacing, negative closer together, positive further apart. 
- defaultCharacterchar
- The default character fall-back. 
Returns
- SpriteFont
- The newly created static font 
Remarks
The font does not copy the provided textures, glyphs information. Provided data should not be modified after the creation of the font. The textures should be disposed manually (if useless) after that the sprite font is not used anymore.
NewStatic(float, IList<Glyph>, IList<Image>, float, float, IList<Kerning>, float, float, char)
Create a new instance of a static font.
public SpriteFont NewStatic(float size, IList<Glyph> glyphs, IList<Image> images, float baseOffset, float defaultLineSpacing, IList<Kerning> kernings = null, float extraSpacing = 0, float extraLineSpacing = 0, char defaultCharacter = ' ')Parameters
- sizefloat
- The size of the font in pixels. 
- glyphsIList<Glyph>
- The list of the font glyphs 
- imagesIList<Image>
- The list of images containing the font character data 
- baseOffsetfloat
- The number of pixels from the absolute top of the line to the base of the characters. 
- defaultLineSpacingfloat
- The default line spacing of the font. 
- kerningsIList<Kerning>
- The list of the kerning information of the font 
- extraSpacingfloat
- The character extra spacing in pixels. Zero is default spacing, negative closer together, positive further apart. 
- extraLineSpacingfloat
- This is the extra distance in pixels to add between each line of text. Zero is default spacing, negative closer together, positive further apart. 
- defaultCharacterchar
- The default character fall-back. 
Returns
- SpriteFont
- The newly created static font 
Remarks
The font does not copy the provided glyphs information. Provided glyphs should not be modified after the creation of the font.
NewStatic(float, IList<Glyph>, IList<Texture>, float, float, IList<Kerning>, float, float, char)
Create a new instance of a static font.
public SpriteFont NewStatic(float size, IList<Glyph> glyphs, IList<Texture> textures, float baseOffset, float defaultLineSpacing, IList<Kerning> kernings = null, float extraSpacing = 0, float extraLineSpacing = 0, char defaultCharacter = ' ')Parameters
- sizefloat
- The size of the font in pixels. 
- glyphsIList<Glyph>
- The list of the font glyphs 
- texturesIList<Texture>
- The list of textures containing the font character data 
- baseOffsetfloat
- The number of pixels from the absolute top of the line to the base of the characters. 
- defaultLineSpacingfloat
- The default line spacing of the font. 
- kerningsIList<Kerning>
- The list of the kerning information of the font 
- extraSpacingfloat
- The character extra spacing in pixels. Zero is default spacing, negative closer together, positive further apart. 
- extraLineSpacingfloat
- This is the extra distance in pixels to add between each line of text. Zero is default spacing, negative closer together, positive further apart. 
- defaultCharacterchar
- The default character fall-back. 
Returns
- SpriteFont
- The newly created static font 
Remarks
The font does not copy the provided textures, glyphs information. Provided data should not be modified after the creation of the font. The textures should be disposed manually (if useless) after that the sprite font is not used anymore.
Unload()
public void Unload()