Interface IFontLoader
Allows loading fonts.
Namespace: AGS.API
Assembly: AGS.API.dll
Syntax
public interface IFontLoader
Methods
| Improve this Doc View SourceInstallFonts(String[])
Installs the specified fonts on the computer. This is required on the Mac, as there is no way to load a font without it being installed. If the font is not installed on a Mac it will be installed and the game will restart (otherwise the font will not render), therefore all fonts are recommended to be installed at the start of the game to make the experience seamless for the user.
Declaration
void InstallFonts(params string[] paths)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String[] | paths | Paths. |
LoadFont(String, Single, FontStyle)
Loads a font (which should be already installed).
Declaration
IFont LoadFont(string fontFamily, float sizeInPoints, FontStyle style = FontStyle.Regular)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | fontFamily | Font family. |
| System.Single | sizeInPoints | Size in points (http://www.computerhope.com/jargon/f/font-size.htm). |
| FontStyle | style | Style. |
Returns
| Type | Description |
|---|---|
| IFont | The font. |
LoadFontFromPath(String, Single, FontStyle)
Loads the font from resource/file path (IResourceLoader . If the font is not installed on a Mac it will be installed and the game will be restarted, therefore it is recommended to use InstallFonts(String[]) at the start of the game).
Declaration
IFont LoadFontFromPath(string path, float sizeInPoints, FontStyle style = FontStyle.Regular)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | path | Resource/file Path. |
| System.Single | sizeInPoints | Size in points (http://www.computerhope.com/jargon/f/font-size.htm). |
| FontStyle | style | Style. |
Returns
| Type | Description |
|---|---|
| IFont | The font. |