Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add font properties to IUiBuilder #1865

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading