Add IFontHandle.Lock and WaitAsync

This commit is contained in:
Soreepeong 2024-01-21 03:10:41 +09:00
parent 620f3999d2
commit d70b430e0d
9 changed files with 543 additions and 86 deletions

View file

@ -1,4 +1,5 @@
using System.Numerics;
using System.Threading.Tasks;
using Dalamud.Interface.ManagedFontAtlas;
using Dalamud.Interface.ManagedFontAtlas.Internals;
@ -28,6 +29,13 @@ public sealed class GameFontHandle : IFontHandle
this.fontAtlasFactory = fontAtlasFactory;
}
/// <inheritdoc />
public event Action<IFontHandle> ImFontChanged
{
add => this.fontHandle.ImFontChanged += value;
remove => this.fontHandle.ImFontChanged -= value;
}
/// <inheritdoc />
public Exception? LoadException => this.fontHandle.LoadException;
@ -55,15 +63,21 @@ public sealed class GameFontHandle : IFontHandle
/// <inheritdoc />
public void Dispose() => this.fontHandle.Dispose();
/// <inheritdoc />
public IFontHandle.ImFontLocked Lock() => this.fontHandle.Lock();
/// <summary>
/// Pushes the font.
/// </summary>
/// <returns>An <see cref="IDisposable"/> that can be used to pop the font on dispose.</returns>
public IDisposable Push() => this.fontHandle.Push();
/// <inheritdoc/>
IFontHandle.FontPopper IFontHandle.Push() => this.fontHandle.Push();
/// <inheritdoc />
public Task<IFontHandle> WaitAsync() => this.fontHandle.WaitAsync();
/// <summary>
/// Creates a new <see cref="GameFontLayoutPlan.Builder"/>.<br />
/// <br />