Struct SafeFontConfig
Managed version of Dalamud.Bindings.ImGui.ImFontConfig, to avoid unnecessary heap allocation and use of unsafe blocks.
Assembly: Dalamud.dll
public struct SafeFontConfig
Properties
FontNo
Gets or sets the font face index within a TrueType Collection (TTC) file.
public int FontNo { get; set; }
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.
SizePx
Gets or sets the desired size of the new font, in pixels.
Effectively, this is the line height.
Value is tied with Dalamud.Interface.ManagedFontAtlas.SafeFontConfig.SizePt.
public float SizePx { get; set; }
SizePt
Gets or sets the desired size of the new font, in points.
Effectively, this is the line height.
Value is tied with Dalamud.Interface.ManagedFontAtlas.SafeFontConfig.SizePx.
public float SizePt { get; set; }
OversampleH
Gets or sets the horizontal oversampling pixel count.
Rasterize at higher quality for sub-pixel positioning.
Note the difference between 2 and 3 is minimal so you can reduce this to 2 to save memory.
Read https://github.com/nothings/stb/blob/master/tests/oversample/README.md for details.
public int OversampleH { get; set; }
OversampleV
Gets or sets the vertical oversampling pixel count.
Rasterize at higher quality for sub-pixel positioning.
This is not really useful as we don't use sub-pixel positions on the Y axis.
public int OversampleV { get; set; }
PixelSnapH
Gets or sets a value indicating whether to align every glyph to pixel boundary.
Useful e.g. if you are merging a non-pixel aligned font with the default font.
If enabled, you can set Dalamud.Interface.ManagedFontAtlas.SafeFontConfig.OversampleH and Dalamud.Interface.ManagedFontAtlas.SafeFontConfig.OversampleV to 1.
public bool PixelSnapH { get; set; }
GlyphExtraSpacing
Gets or sets the extra spacing (in pixels) between glyphs.
Only X axis is supported for now.
Effectively, it is the letter spacing.
public Vector2 GlyphExtraSpacing { get; set; }