Class Font
Represents a font with information about glyph size, spacing, and glyph atlas.
Inherited Members
Namespace: Genesis.Graphics
Assembly: Genesis.dll
Syntax
public class Font
Constructors
Font()
Initializes a new instance of the Font class.
Declaration
public Font()
Properties
Column
Gets or sets the number of columns in the glyph atlas.
Declaration
public int Column { get; set; }
Property Value
Type | Description |
---|---|
int |
FontAtlas
Gets or sets the bitmap containing the font atlas.
Declaration
public Bitmap FontAtlas { get; set; }
Property Value
Type | Description |
---|---|
Bitmap |
GlyphSize
Gets or sets the size of each glyph in the font.
Declaration
public float GlyphSize { get; set; }
Property Value
Type | Description |
---|---|
float |
Glyphes
Gets or sets the list of glyphs in the font.
Declaration
public List<Glyphe> Glyphes { get; set; }
Property Value
Type | Description |
---|---|
List<Glyphe> |
Name
Gets or sets the name of the font.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
string |
RenderID
Gets or sets the render ID associated with the font.
Declaration
public int RenderID { get; set; }
Property Value
Type | Description |
---|---|
int |
Rows
Gets or sets the number of rows in the glyph atlas.
Declaration
public int Rows { get; set; }
Property Value
Type | Description |
---|---|
int |
Spacing
Gets or sets the spacing between glyphs.
Declaration
public float Spacing { get; set; }
Property Value
Type | Description |
---|---|
float |
Methods
Base64ToImage(string)
Converts a base64-encoded image string to a Bitmap.
Declaration
public Bitmap Base64ToImage(string base64)
Parameters
Type | Name | Description |
---|---|---|
string | base64 | The base64-encoded image string. |
Returns
Type | Description |
---|---|
Bitmap | The decoded Bitmap image. |
FromFile(string)
Loads font information from an XML file.
Declaration
public void FromFile(string file)
Parameters
Type | Name | Description |
---|---|---|
string | file | The path to the XML file containing font information. |
GetGlyphe(char)
Gets the glyph associated with a specific character.
Declaration
public Glyphe GetGlyphe(char character)
Parameters
Type | Name | Description |
---|---|---|
char | character | The character for which to retrieve the glyph. |
Returns
Type | Description |
---|---|
Glyphe | The glyph associated with the specified character. |
LoadSystemFont(string)
Loads a system font with a default set of glyphs.
Declaration
public static Font LoadSystemFont(string fontName)
Parameters
Type | Name | Description |
---|---|---|
string | fontName | The name of the system font to load. |
Returns
Type | Description |
---|---|
Font | The loaded system font. |