poison.ui.fonts
Source
Module for fonts.
Authors:
Jacob Jensen
License:
https://github.com/PoisonEngine/poison-ui/blob/master/LICENSE
Imports
std.file : dirEntries, SpanMode
std.algorithm : filter, endsWith
std.string : toLower
std.path : stripExtension, baseName
public dsfml.graphics : Font
public:
public enum FontStyle
Enumeration of font styles.
normal = ""
Normal font style.
bold = "b"
Bold font style.
italic = "i"
Italic font style.
boldItalic = "z"
Bold & italic font style.
void loadFonts(string path);
Loads all fonts within a specific path.
Parameters:
path The path of the fonts.
public Font loadFont(string path);
Loads a font by its path or retrieves it from the font cache.
Parameters:
path The path of the font.
Note:
If the path is specified as a font-name, it must be prefixed with its proper font-style suffix. Use retrieveFont for easier access.
Returns:
The font loaded from its path or name.
public Font retrieveFont(string fontName, FontStyle style);
Retrieves a font by a name and style.
Parameters:
fontName The name of the font to retrieve.
style The style of the font.
Returns:
The font retrieved by its name and style.
Generated by venom - Poison Engine's Documentation Generator
Module for fonts.
Authors:
Jacob JensenLicense:
https://github.com/PoisonEngine/poison-ui/blob/master/LICENSEImports
std.file : dirEntries, SpanModestd.algorithm : filter, endsWith
std.string : toLower
std.path : stripExtension, baseName
public dsfml.graphics : Font
public enum FontStyle
Enumeration of font styles.
normal = ""
Normal font style.
bold = "b"
Bold font style.
italic = "i"
Italic font style.
boldItalic = "z"
Bold & italic font style.
void loadFonts(string path);
Loads all fonts within a specific path.
Parameters:
path | The path of the fonts. |
public Font loadFont(string path);
Loads a font by its path or retrieves it from the font cache.
Parameters:
path | The path of the font. |
Note:
If the path is specified as a font-name, it must be prefixed with its proper font-style suffix. Use retrieveFont for easier access.Returns:
The font loaded from its path or name.public Font retrieveFont(string fontName, FontStyle style);
Retrieves a font by a name and style.
Parameters:
fontName | The name of the font to retrieve. |
style | The style of the font. |