Add SetFontScaleMode(ImFontPtr, FontScaleMode) (#1666)

* Add SetFontScaleMode(ImFontPtr, FontScaleMode)

`IgnoreGlobalScale` was advertised as "excludes the given font from
global scaling", but the intent I had in mind was "excludes the given
font from being scaled in any manner". As the latter functionality is
needed, obsoleted `IgnoreGlobalScale` and added `SetFontScaleMode`.

* Make it correct

* Name consistency
This commit is contained in:
srkizer 2024-02-18 23:08:07 +09:00 committed by GitHub
parent 7dc99c9307
commit 2d8b71c647
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 166 additions and 66 deletions

View file

@ -1,4 +1,5 @@
using Dalamud.Interface.Internal;
using Dalamud.Utility;
using ImGuiNET;
@ -10,12 +11,13 @@ namespace Dalamud.Interface.ManagedFontAtlas;
/// </summary>
public interface IFontAtlasBuildToolkitPostBuild : IFontAtlasBuildToolkit
{
/// <summary>
/// Gets whether global scaling is ignored for the given font.
/// </summary>
/// <param name="fontPtr">The font.</param>
/// <returns>True if ignored.</returns>
bool IsGlobalScaleIgnored(ImFontPtr fontPtr);
/// <inheritdoc cref="IFontAtlasBuildToolkitPreBuild.IsGlobalScaleIgnored"/>
[Obsolete($"Use {nameof(this.GetFontScaleMode)}")]
[Api10ToDo(Api10ToDoAttribute.DeleteCompatBehavior)]
bool IsGlobalScaleIgnored(ImFontPtr fontPtr) => this.GetFontScaleMode(fontPtr) == FontScaleMode.UndoGlobalScale;
/// <inheritdoc cref="IFontAtlasBuildToolkitPreBuild.GetFontScaleMode"/>
FontScaleMode GetFontScaleMode(ImFontPtr fontPtr);
/// <summary>
/// Stores a texture to be managed with the atlas.