Interface IFontSpec
Represents a user's choice of font(s).
Not intended for plugins to implement.
Assembly: Dalamud.dll
public interface IFontSpec
Derived:
Dalamud.Interface.FontIdentifier.SingleFontSpec
Properties
SizePx
Gets the font size in pixels.
float SizePx { get; }
SizePt
Gets the font size in points.
float SizePt { get; }
LineHeightPx
Gets the line height in pixels.
float LineHeightPx { get; }
FontNo
Gets the font face index within a TrueType Collection (TTC) file.
int FontNo { get; }
Remarks
This property only applies to Dalamud.DalamudAsset.NotoSansCjkRegular and Dalamud.DalamudAsset.NotoSansCjkMedium, which are TTC fonts bundling multiple language-specific CJK glyph sets (Japanese, Traditional Chinese, Simplified Chinese, Korean) into a single file.
The index corresponds to the font face order in the TTC:
<ul><li>0 = Japanese</li><li>1 = Traditional Chinese</li><li>2 = Simplified Chinese</li><li>3 = Korean</li></ul>
This value is ignored for all other Dalamud.DalamudAsset entries. Only one glyph set can be active at a time. In most cases, you can omit this— Dalamud automatically selects the appropriate face based on the UI language.
Methods
CreateFontHandle(IFontAtlas, FontAtlasBuildStepDelegate?)
Creates a font handle corresponding to this font specification.
IFontHandle CreateFontHandle(IFontAtlas atlas, FontAtlasBuildStepDelegate? callback = null)
Returns
Dalamud.Interface.ManagedFontAtlas.IFontHandle: The new font handle.
Parameters
| Type | Name | Description |
|---|---|---|
| Dalamud.Interface.ManagedFontAtlas.IFontAtlas | atlas | The atlas to bind this font handle to. |
| Dalamud.Interface.ManagedFontAtlas.FontAtlasBuildStepDelegate | callback | Optional callback to be called after creating the font handle. |
Remarks
Dalamud.Interface.ManagedFontAtlas.IFontAtlasBuildToolkit.Font will be set when <code class="paramref">callback</code> is invoked.
AddToBuildToolkit(IFontAtlasBuildToolkitPreBuild, ImFontPtr)
Adds this font to the given font build toolkit.
ImFontPtr AddToBuildToolkit(IFontAtlasBuildToolkitPreBuild tk, ImFontPtr mergeFont = default)
Returns
Dalamud.Bindings.ImGui.ImFontPtr: The added font.
Parameters
| Type | Name | Description |
|---|---|---|
| Dalamud.Interface.ManagedFontAtlas.IFontAtlasBuildToolkitPreBuild | tk | The font build toolkit. |
Dalamud.Bindings.ImGui.ImFontPtr | mergeFont | The font to merge to. |
ToLocalizedString(string)
Represents this font specification, preferrably in the requested locale.
string ToLocalizedString(string localeCode)
Returns
System.String: The value.
Parameters
| Type | Name | Description |
|---|---|---|
System.String | localeCode | The locale code. Must be in lowercase(invariant). |