Add early version of IOSSystemFontLister
Some checks failed
Build and test / build (push) Has been cancelled
Build and test [MacOS] / build (push) Has been cancelled
Run Common Crawl Tests / build (push) Has been cancelled
Run Integration Tests / build (push) Has been cancelled

This commit is contained in:
BobLd
2025-09-02 19:35:26 +01:00
parent 0afe021ad3
commit e4ed4d1b39
2 changed files with 21 additions and 1 deletions

View File

@@ -0,0 +1,16 @@
namespace UglyToad.PdfPig.Fonts.SystemFonts
{
#if NET
using System.Collections.Generic;
internal sealed class IOSSystemFontLister : ISystemFontLister
{
// Very early version, intended to help developing support for iOS
public IEnumerable<SystemFontRecord> GetAllFonts()
{
yield break;
}
}
#endif
}

View File

@@ -102,6 +102,10 @@ namespace UglyToad.PdfPig.Fonts.SystemFonts
{
lister = new MacSystemFontLister();
}
else if (OperatingSystem.IsIOS())
{
lister = new IOSSystemFontLister();
}
#endif
else
{
@@ -113,7 +117,7 @@ namespace UglyToad.PdfPig.Fonts.SystemFonts
#error Missing ISystemFontLister for target framework
#endif
AvailableFonts = new Lazy<IReadOnlyList<SystemFontRecord>>(() => lister.GetAllFonts().ToList());
AvailableFonts = new Lazy<IReadOnlyList<SystemFontRecord>>(() => lister.GetAllFonts().ToArray());
}
private readonly ConcurrentDictionary<string, string> nameToFileNameMap = new ConcurrentDictionary<string, string>(StringComparer.OrdinalIgnoreCase);