diff --git a/src/UglyToad.PdfPig.Fonts/SystemFonts/BrowserSystemFontLister.cs b/src/UglyToad.PdfPig.Fonts/SystemFonts/BrowserSystemFontLister.cs new file mode 100644 index 000000000..b0cf6849d --- /dev/null +++ b/src/UglyToad.PdfPig.Fonts/SystemFonts/BrowserSystemFontLister.cs @@ -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 GetAllFonts() + { + yield break; + } + } +#endif +} diff --git a/src/UglyToad.PdfPig.Fonts/SystemFonts/SystemFontFinder.cs b/src/UglyToad.PdfPig.Fonts/SystemFonts/SystemFontFinder.cs index 8482ef798..0bbc1e65f 100644 --- a/src/UglyToad.PdfPig.Fonts/SystemFonts/SystemFontFinder.cs +++ b/src/UglyToad.PdfPig.Fonts/SystemFonts/SystemFontFinder.cs @@ -92,7 +92,11 @@ static SystemFontFinder() #if NET else if (OperatingSystem.IsAndroid()) { - lister = new AndroidSystemFontLister(); + lister = new AndroidSystemFontLister(); + } + else if (OperatingSystem.IsBrowser()) + { + lister = new BrowserSystemFontLister(); } #endif else diff --git a/src/UglyToad.PdfPig.Fonts/SystemFonts/WindowsSystemFontLister.cs b/src/UglyToad.PdfPig.Fonts/SystemFonts/WindowsSystemFontLister.cs index a8dc6b8ca..ef6fe5c47 100644 --- a/src/UglyToad.PdfPig.Fonts/SystemFonts/WindowsSystemFontLister.cs +++ b/src/UglyToad.PdfPig.Fonts/SystemFonts/WindowsSystemFontLister.cs @@ -8,8 +8,6 @@ internal sealed class WindowsSystemFontLister : ISystemFontLister { public IEnumerable GetAllFonts() { - // TODO: Could use System.Drawing InstalledFontCollection to do this? - var winDir = Environment.GetFolderPath(Environment.SpecialFolder.Windows); var fonts = Path.Combine(winDir, "Fonts");