Skip to main content

Class DalamudAssetFontAndFamilyId

Represents a font from Dalamud assets.

Assembly: Dalamud.dll
Declaration
public sealed class DalamudAssetFontAndFamilyId : IFontFamilyId, IFontId, IObjectWithLocalizableName

Implements:
Dalamud.Interface.FontIdentifier.IFontFamilyId, Dalamud.Interface.FontIdentifier.IFontId, Dalamud.Interface.FontIdentifier.IObjectWithLocalizableName

Properties

Asset

Gets the font asset.

Declaration
[JsonProperty]
public DalamudAsset Asset { get; init; }

EnglishName

Gets the name, preferrably in English.

Declaration
[JsonIgnore]
public string EnglishName { get; }

LocaleNames

Gets the names per locales.

Declaration
[JsonIgnore]
public IReadOnlyDictionary<string, string>? LocaleNames { get; }

Fonts

Gets the list of fonts under this family.

Declaration
[JsonIgnore]
public IReadOnlyList<IFontId> Fonts { get; }

Family

Gets the associated font family.

Declaration
[JsonIgnore]
public IFontFamilyId Family { get; }

Weight

Gets the font weight, ranging from 1 to 999.

Declaration
[JsonIgnore]
public int Weight { get; }

Stretch

Gets the font stretch, ranging from 1 to 9.

Declaration
[JsonIgnore]
public int Stretch { get; }

Style

Gets the font style. Treat as an opaque value.

Declaration
[JsonIgnore]
public int Style { get; }

Methods

Equals(object?)

Declaration
public override bool Equals(object? obj)
Returns

System.Boolean

Parameters
TypeName
System.Objectobj

GetHashCode()

Declaration
public override int GetHashCode()
Returns

System.Int32

ToString()

Declaration
public override string ToString()
Returns

System.String

FindBestMatch(int, int, int)

Finds the index of the font inside Dalamud.Interface.FontIdentifier.IFontFamilyId.Fonts that best matches the given parameters.

Declaration
public int FindBestMatch(int weight, int stretch, int style)
Returns

System.Int32: The index of the font. Guaranteed to be a valid index.

Parameters
TypeNameDescription
System.Int32weightThe weight of the font.
System.Int32stretchThe stretch of the font.
System.Int32styleThe style of the font.

AddToBuildToolkit(IFontAtlasBuildToolkitPreBuild, in SafeFontConfig)

Declaration
public ImFontPtr AddToBuildToolkit(IFontAtlasBuildToolkitPreBuild tk, in SafeFontConfig config)
Returns

Dalamud.Bindings.ImGui.ImFontPtr

Parameters
TypeName
Dalamud.Interface.ManagedFontAtlas.IFontAtlasBuildToolkitPreBuildtk
Dalamud.Interface.ManagedFontAtlas.SafeFontConfigconfig

Implements