Add early version of BrowserSystemFontLister
Some checks failed
Build and test / build (push) Has been cancelled
Run Integration Tests / build (push) Has been cancelled

This commit is contained in:
BobLd 2024-10-12 15:33:07 +01:00
parent a258090e1c
commit f40545b0a5
3 changed files with 21 additions and 3 deletions

View File

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

View File

@ -92,7 +92,11 @@ namespace UglyToad.PdfPig.Fonts.SystemFonts
#if NET
else if (OperatingSystem.IsAndroid())
{
lister = new AndroidSystemFontLister();
lister = new AndroidSystemFontLister();
}
else if (OperatingSystem.IsBrowser())
{
lister = new BrowserSystemFontLister();
}
#endif
else

View File

@ -8,8 +8,6 @@
{
public IEnumerable<SystemFontRecord> GetAllFonts()
{
// TODO: Could use System.Drawing InstalledFontCollection to do this?
var winDir = Environment.GetFolderPath(Environment.SpecialFolder.Windows);
var fonts = Path.Combine(winDir, "Fonts");