IFontFactory Interface
Namespace: Stride.Graphics.FontAssembly: Stride.Graphics.dll
The interface to create and manage fonts.
public interface IFontFactory
Name | Description | |
---|---|---|
Methods | ||
NewDynamic(Single, String, FontStyle, FontAntiAliasMode, Boolean, Single, Single, Char) | Create a new instance of a dynamic font. |
|
NewScalable(Single, IList<Glyph>, IList<Image>, Single, Single, IList<Kerning>, Single, Single, Char) | Create a new instance of a scalable font. |
|
NewScalable(Single, IList<Glyph>, IList<Texture>, Single, Single, IList<Kerning>, Single, Single, Char) | Create a new instance of a scalable font. |
|
NewStatic(Single, IList<Glyph>, IList<Image>, Single, Single, IList<Kerning>, Single, Single, Char) | Create a new instance of a static font. |
|
NewStatic(Single, IList<Glyph>, IList<Texture>, Single, Single, IList<Kerning>, Single, Single, Char) | Create a new instance of a static font. |
Methods
NewDynamic(Single, String, FontStyle, FontAntiAliasMode, Boolean, Single, Single, Char)
Create a new instance of a dynamic font.
SpriteFont NewDynamic(float defaultSize, string fontName, FontStyle style, FontAntiAliasMode antiAliasMode = FontAntiAliasMode.Default, bool useKerning = false, float extraSpacing = 0F, float extraLineSpacing = 0F, char defaultCharacter = ' ')
Parameters
Type | Name | Description |
---|---|---|
System.Single | defaultSize | The default size of the font in pixels. |
System.String | fontName | The family name of the (TrueType) font. |
FontStyle | style | The style for the font. A combinaison of 'regular', 'bold' or 'italic'. |
FontAntiAliasMode | antiAliasMode | The anti-aliasing mode to use when rendering the font. By default, font textures are rendered in levels of grey. |
System.Boolean | useKerning | Specifies whether to use kerning information when rendering the font. Default value is false (NOT SUPPORTED YET) |
System.Single | extraSpacing | The character extra spacing in pixels. Zero is default spacing, negative closer together, positive further apart. |
System.Single | extraLineSpacing | This is the extra distance in pixels to add between each line of text. Zero is default spacing, negative closer together, positive further apart. |
System.Char | defaultCharacter | The default character fall-back. |
Returns
Type | Description |
---|---|
SpriteFont | The newly created dynamic font |
NewScalable(Single, IList<Glyph>, IList<Image>, Single, Single, IList<Kerning>, Single, Single, Char)
Create a new instance of a scalable font.
SpriteFont NewScalable(float size, IList<Glyph> glyphs, IList<Image> images, float baseOffset, float defaultLineSpacing, IList<Kerning> kernings = null, float extraSpacing = 0F, float extraLineSpacing = 0F, char defaultCharacter = ' ')
Parameters
Type | Name | Description |
---|---|---|
System.Single | size | The size of the font in pixels. |
System.Collections.Generic.IList<Glyph> | glyphs | The list of the font glyphs |
System.Collections.Generic.IList<Image> | images | The list of images containing the font character data |
System.Single | baseOffset | The number of pixels from the absolute top of the line to the base of the characters. |
System.Single | defaultLineSpacing | The default line spacing of the font. |
System.Collections.Generic.IList<Kerning> | kernings | The list of the kerning information of the font |
System.Single | extraSpacing | The character extra spacing in pixels. Zero is default spacing, negative closer together, positive further apart. |
System.Single | extraLineSpacing | This is the extra distance in pixels to add between each line of text. Zero is default spacing, negative closer together, positive further apart. |
System.Char | defaultCharacter | The default character fall-back. |
Returns
Type | Description |
---|---|
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(Single, IList<Glyph>, IList<Texture>, Single, Single, IList<Kerning>, Single, Single, Char)
Create a new instance of a scalable font.
SpriteFont NewScalable(float size, IList<Glyph> glyphs, IList<Texture> textures, float baseOffset, float defaultLineSpacing, IList<Kerning> kernings = null, float extraSpacing = 0F, float extraLineSpacing = 0F, char defaultCharacter = ' ')
Parameters
Type | Name | Description |
---|---|---|
System.Single | size | The size of the font in pixels. |
System.Collections.Generic.IList<Glyph> | glyphs | The list of the font glyphs |
System.Collections.Generic.IList<Texture> | textures | The list of textures containing the font character data |
System.Single | baseOffset | The number of pixels from the absolute top of the line to the base of the characters. |
System.Single | defaultLineSpacing | The default line spacing of the font. |
System.Collections.Generic.IList<Kerning> | kernings | The list of the kerning information of the font |
System.Single | extraSpacing | The character extra spacing in pixels. Zero is default spacing, negative closer together, positive further apart. |
System.Single | extraLineSpacing | This is the extra distance in pixels to add between each line of text. Zero is default spacing, negative closer together, positive further apart. |
System.Char | defaultCharacter | The default character fall-back. |
Returns
Type | Description |
---|---|
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(Single, IList<Glyph>, IList<Image>, Single, Single, IList<Kerning>, Single, Single, Char)
Create a new instance of a static font.
SpriteFont NewStatic(float size, IList<Glyph> glyphs, IList<Image> images, float baseOffset, float defaultLineSpacing, IList<Kerning> kernings = null, float extraSpacing = 0F, float extraLineSpacing = 0F, char defaultCharacter = ' ')
Parameters
Type | Name | Description |
---|---|---|
System.Single | size | The size of the font in pixels. |
System.Collections.Generic.IList<Glyph> | glyphs | The list of the font glyphs |
System.Collections.Generic.IList<Image> | images | The list of images containing the font character data |
System.Single | baseOffset | The number of pixels from the absolute top of the line to the base of the characters. |
System.Single | defaultLineSpacing | The default line spacing of the font. |
System.Collections.Generic.IList<Kerning> | kernings | The list of the kerning information of the font |
System.Single | extraSpacing | The character extra spacing in pixels. Zero is default spacing, negative closer together, positive further apart. |
System.Single | extraLineSpacing | This is the extra distance in pixels to add between each line of text. Zero is default spacing, negative closer together, positive further apart. |
System.Char | defaultCharacter | The default character fall-back. |
Returns
Type | Description |
---|---|
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(Single, IList<Glyph>, IList<Texture>, Single, Single, IList<Kerning>, Single, Single, Char)
Create a new instance of a static font.
SpriteFont NewStatic(float size, IList<Glyph> glyphs, IList<Texture> textures, float baseOffset, float defaultLineSpacing, IList<Kerning> kernings = null, float extraSpacing = 0F, float extraLineSpacing = 0F, char defaultCharacter = ' ')
Parameters
Type | Name | Description |
---|---|---|
System.Single | size | The size of the font in pixels. |
System.Collections.Generic.IList<Glyph> | glyphs | The list of the font glyphs |
System.Collections.Generic.IList<Texture> | textures | The list of textures containing the font character data |
System.Single | baseOffset | The number of pixels from the absolute top of the line to the base of the characters. |
System.Single | defaultLineSpacing | The default line spacing of the font. |
System.Collections.Generic.IList<Kerning> | kernings | The list of the kerning information of the font |
System.Single | extraSpacing | The character extra spacing in pixels. Zero is default spacing, negative closer together, positive further apart. |
System.Single | extraLineSpacing | This is the extra distance in pixels to add between each line of text. Zero is default spacing, negative closer together, positive further apart. |
System.Char | defaultCharacter | The default character fall-back. |
Returns
Type | Description |
---|---|
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.