Skip to content

Commit

Permalink
Add font properties to IUiBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
Critical-Impact committed Jul 6, 2024
1 parent 6992336 commit 2e0bd38
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions Dalamud/Interface/UiBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,34 @@ public interface IUiBuilder
/// </summary>
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>
/// Gets the game's active Direct3D device.
/// </summary>
Expand Down Expand Up @@ -345,6 +373,21 @@ internal UiBuilder(LocalPlugin plugin, string namespaceName)
/// </summary>
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>
/// Gets the handle to the default Dalamud font - supporting all game languages and icons.
/// </summary>
Expand Down

0 comments on commit 2e0bd38

Please sign in to comment.