From 2e0bd3882b70da80e653180bbef0233e1d206929 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 1413f33471..a51dc5f6ae 100644 --- a/Dalamud/Interface/UiBuilder.cs +++ b/Dalamud/Interface/UiBuilder.cs @@ -117,6 +117,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. /// @@ -345,6 +373,21 @@ internal UiBuilder(LocalPlugin plugin, string namespaceName) /// 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. ///