From 7883e2e8faadddf1f3f82260aaa9736cf3360440 Mon Sep 17 00:00:00 2001 From: Critical Date: Sat, 29 Jun 2024 11:29:14 +1000 Subject: [PATCH] Add font properties to IUiBuilder --- Dalamud/Interface/UiBuilder.cs | 43 ++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/Dalamud/Interface/UiBuilder.cs b/Dalamud/Interface/UiBuilder.cs index b00df1a00..e38537018 100644 --- a/Dalamud/Interface/UiBuilder.cs +++ b/Dalamud/Interface/UiBuilder.cs @@ -122,6 +122,34 @@ public interface IUiBuilder /// IFontSpec DefaultFontSpec { get; } + /// + /// Gets the default Dalamud font size in points. + /// + public float FontDefaultSizePt { get; } + + /// + /// Gets the default Dalamud font size in pixels. + /// + public float FontDefaultSizePx { get; } + + /// + /// Gets the default Dalamud font - supporting all game languages and icons.
+ /// Accessing this static property outside of is dangerous and not supported. + ///
+ public ImFontPtr FontDefault { get; } + + /// + /// Gets the default Dalamud icon font based on FontAwesome 5 Free solid.
+ /// Accessing this static property outside of is dangerous and not supported. + ///
+ public ImFontPtr FontIcon { get; } + + /// + /// Gets the default Dalamud monospaced font based on Inconsolata Regular.
+ /// Accessing this static property outside of is dangerous and not supported. + ///
+ public ImFontPtr FontMono { get; } + /// /// Gets the game's active Direct3D device. /// @@ -380,6 +408,21 @@ public sealed class UiBuilder : IDisposable, IUiBuilder /// public IFontSpec DefaultFontSpec => Service.Get().DefaultFontSpec; + /// + public float FontDefaultSizePt => Service.Get().DefaultFontSpec.SizePt; + + /// + public float FontDefaultSizePx => Service.Get().DefaultFontSpec.SizePx; + + /// + public ImFontPtr FontDefault => InterfaceManager.DefaultFont; + + /// + public ImFontPtr FontIcon => InterfaceManager.IconFont; + + /// + public ImFontPtr FontMono => InterfaceManager.MonoFont; + /// /// Gets the handle to the default Dalamud font - supporting all game languages and icons. ///