Merge pull request #1865 from Critical-Impact/ui-builder-fonts

Add font properties to IUiBuilder
This commit is contained in:
goat 2025-08-07 13:33:18 +02:00 committed by GitHub
commit c39c957923
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -122,6 +122,34 @@ public interface IUiBuilder
/// </summary> /// </summary>
IFontSpec DefaultFontSpec { get; } IFontSpec DefaultFontSpec { get; }
/// <summary>
/// Gets the default Dalamud font size in points.
/// </summary>
public float FontDefaultSizePt { get; }
/// <summary>
/// Gets the default Dalamud font size in pixels.
/// </summary>
public float FontDefaultSizePx { get; }
/// <summary>
/// Gets the default Dalamud font - supporting all game languages and icons.<br />
/// <strong>Accessing this static property outside of <see cref="Draw"/> is dangerous and not supported.</strong>
/// </summary>
public ImFontPtr FontDefault { get; }
/// <summary>
/// Gets the default Dalamud icon font based on FontAwesome 5 Free solid.<br />
/// <strong>Accessing this static property outside of <see cref="Draw"/> is dangerous and not supported.</strong>
/// </summary>
public ImFontPtr FontIcon { get; }
/// <summary>
/// Gets the default Dalamud monospaced font based on Inconsolata Regular.<br />
/// <strong>Accessing this static property outside of <see cref="Draw"/> is dangerous and not supported.</strong>
/// </summary>
public ImFontPtr FontMono { get; }
/// <summary> /// <summary>
/// Gets the game's active Direct3D device. /// Gets the game's active Direct3D device.
/// </summary> /// </summary>
@ -380,6 +408,21 @@ public sealed class UiBuilder : IDisposable, IUiBuilder
/// </summary> /// </summary>
public IFontSpec DefaultFontSpec => Service<FontAtlasFactory>.Get().DefaultFontSpec; public IFontSpec DefaultFontSpec => Service<FontAtlasFactory>.Get().DefaultFontSpec;
/// <inheritdoc/>
public float FontDefaultSizePt => Service<FontAtlasFactory>.Get().DefaultFontSpec.SizePt;
/// <inheritdoc/>
public float FontDefaultSizePx => Service<FontAtlasFactory>.Get().DefaultFontSpec.SizePx;
/// <inheritdoc/>
public ImFontPtr FontDefault => InterfaceManager.DefaultFont;
/// <inheritdoc/>
public ImFontPtr FontIcon => InterfaceManager.IconFont;
/// <inheritdoc/>
public ImFontPtr FontMono => InterfaceManager.MonoFont;
/// <summary> /// <summary>
/// Gets the handle to the default Dalamud font - supporting all game languages and icons. /// Gets the handle to the default Dalamud font - supporting all game languages and icons.
/// </summary> /// </summary>