mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-10-07 16:04:34 +08:00
Add early version of IOSSystemFontLister
This commit is contained in:
16
src/UglyToad.PdfPig.Fonts/SystemFonts/IOSSystemFontLister.cs
Normal file
16
src/UglyToad.PdfPig.Fonts/SystemFonts/IOSSystemFontLister.cs
Normal 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
|
||||
}
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user