Table of Contents

Class Font

Namespace
Fantas
Assembly
Fantas.dll

Font (TTF font on iOS/tvOS/macOS, and SpriteFont on other platforms)

public sealed class Font
Inheritance
Font
Inherited Members

Properties

DefaultFont

Default Font used by LabelNode

public static Font DefaultFont { get; set; }

Property Value

Font

Name

Font name

public string Name { get; }

Property Value

string

Methods

FromCompressedResource(Assembly, string)

Load a font from a compressed embedded resource

public static Font FromCompressedResource(Assembly assembly, string resourceFontName)

Parameters

assembly Assembly
resourceFontName string

Returns

Font

FromCompressedResource(Assembly, string, float)

Load a font from a compressed embedded resource using the given scale

public static Font FromCompressedResource(Assembly assembly, string resourceFontName, float preferredFontSize)

Parameters

assembly Assembly
resourceFontName string
preferredFontSize float

Only used on iOS

Returns

Font

FromResource(Assembly, string)

Load a font from a embedded resource

public static Font FromResource(Assembly assembly, string resourceFontName)

Parameters

assembly Assembly
resourceFontName string

Returns

Font

FromResource(Assembly, string, float)

Load a font from a embedded resource using the given scale

public static Font FromResource(Assembly assembly, string resourceFontName, float preferredFontSize)

Parameters

assembly Assembly
resourceFontName string
preferredFontSize float

Preferred Font size to be used in labels (only for TTF fonts)

Returns

Font