Class DalamudAssetFontAndFamilyId
Represents a font from Dalamud assets.
Assembly: Dalamud.dll
View Source
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.
View Source
[JsonProperty]
public DalamudAsset Asset { get; init; }
EnglishName
Gets the name, preferrably in English.
View Source
[JsonIgnore]
public string EnglishName { get; }
LocaleNames
Gets the names per locales.
View Source
[JsonIgnore]
public IReadOnlyDictionary<string, string>? LocaleNames { get; }
Fonts
Gets the list of fonts under this family.
View Source
[JsonIgnore]
public IReadOnlyList<IFontId> Fonts { get; }
Family
Gets the associated font family.
View Source
[JsonIgnore]
public IFontFamilyId Family { get; }
Weight
Gets the font weight, ranging from 1 to 999.
View Source
[JsonIgnore]
public int Weight { get; }
Stretch
Gets the font stretch, ranging from 1 to 9.
View Source
[JsonIgnore]
public int Stretch { get; }
Style
Gets the font style. Treat as an opaque value.
View Source
[JsonIgnore]
public int Style { get; }
Methods
Equals(object?)
Determines whether the specified object is equal to the current object.
View Source
public override bool Equals(object? obj)
Returns
System.Boolean
: true if the specified object is equal to the current object; otherwise, false.
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The object to compare with the current object. |
GetHashCode()
Serves as the default hash function.
View Source
public override int GetHashCode()
Returns
System.Int32
: A hash code for the current object.### ToString()
Returns a string that represents the current object.
View Source
public override string ToString()
Returns
System.String
: A string that represents the current object.### FindBestMatch(int, int, int)
Finds the index of the font inside Dalamud.Interface.FontIdentifier.IFontFamilyId.Fonts that best matches the given parameters.
View Source
public int FindBestMatch(int weight, int stretch, int style)
Returns
System.Int32
: The index of the font. Guaranteed to be a valid index.
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | weight | The weight of the font. |
System.Int32 | stretch | The stretch of the font. |
System.Int32 | style | The style of the font. |
AddToBuildToolkit(IFontAtlasBuildToolkitPreBuild, in SafeFontConfig)
Adds this font to the given font build toolkit.
View Source
public ImFontPtr AddToBuildToolkit(IFontAtlasBuildToolkitPreBuild tk, in SafeFontConfig config)
Returns
ImGuiNET.ImFontPtr: The added font.
Parameters
Type | Name | Description |
---|---|---|
Dalamud.Interface.ManagedFontAtlas.IFontAtlasBuildToolkitPreBuild | tk | The font build toolkit. |
Dalamud.Interface.ManagedFontAtlas.SafeFontConfig | config | The font configuration. Some parameters may be ignored. |