Class FontDataFactory
A font factory initializing only the data members of font. Used when creating a font in the only purpose use serializing on disk.
public class FontDataFactory : IFontFactory
- Inheritance
-
FontDataFactory
- Implements
Methods
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, bool useKerning, float extraSpacing, float extraLineSpacing, char defaultCharacter)
Parameters
defaultSizefloatThe default size of the font in pixels.
fontNamestringThe family name of the (TrueType) font.
styleFontStyleThe style for the font. A combinaison of 'regular', 'bold' or 'italic'.
antiAliasModeFontAntiAliasModeThe anti-aliasing mode to use when rendering the font. By default, font textures are rendered in levels of grey.
useKerningboolSpecifies whether to use kerning information when rendering the font. Default value is false (NOT SUPPORTED YET)
extraSpacingfloatThe character extra spacing in pixels. Zero is default spacing, negative closer together, positive further apart.
extraLineSpacingfloatThis is the extra distance in pixels to add between each line of text. Zero is default spacing, negative closer together, positive further apart.
defaultCharactercharThe 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
sizefloatThe 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
baseOffsetfloatThe number of pixels from the absolute top of the line to the base of the characters.
defaultLineSpacingfloatThe default line spacing of the font.
kerningsIList<Kerning>The list of the kerning information of the font
extraSpacingfloatThe character extra spacing in pixels. Zero is default spacing, negative closer together, positive further apart.
extraLineSpacingfloatThis is the extra distance in pixels to add between each line of text. Zero is default spacing, negative closer together, positive further apart.
defaultCharactercharThe 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
sizefloatThe 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
baseOffsetfloatThe number of pixels from the absolute top of the line to the base of the characters.
defaultLineSpacingfloatThe default line spacing of the font.
kerningsIList<Kerning>The list of the kerning information of the font
extraSpacingfloatThe character extra spacing in pixels. Zero is default spacing, negative closer together, positive further apart.
extraLineSpacingfloatThis is the extra distance in pixels to add between each line of text. Zero is default spacing, negative closer together, positive further apart.
defaultCharactercharThe 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
sizefloatThe 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
baseOffsetfloatThe number of pixels from the absolute top of the line to the base of the characters.
defaultLineSpacingfloatThe default line spacing of the font.
kerningsIList<Kerning>The list of the kerning information of the font
extraSpacingfloatThe character extra spacing in pixels. Zero is default spacing, negative closer together, positive further apart.
extraLineSpacingfloatThis is the extra distance in pixels to add between each line of text. Zero is default spacing, negative closer together, positive further apart.
defaultCharactercharThe 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
sizefloatThe 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
baseOffsetfloatThe number of pixels from the absolute top of the line to the base of the characters.
defaultLineSpacingfloatThe default line spacing of the font.
kerningsIList<Kerning>The list of the kerning information of the font
extraSpacingfloatThe character extra spacing in pixels. Zero is default spacing, negative closer together, positive further apart.
extraLineSpacingfloatThis is the extra distance in pixels to add between each line of text. Zero is default spacing, negative closer together, positive further apart.
defaultCharactercharThe 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.