Skip to content

Commit

Permalink
Add early version of BrowserSystemFontLister
Browse files Browse the repository at this point in the history
  • Loading branch information
BobLd committed Oct 12, 2024
1 parent a258090 commit 74655b4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
16 changes: 16 additions & 0 deletions src/UglyToad.PdfPig.Fonts/SystemFonts/BrowserSystemFontLister.cs
Original file line number Diff line number Diff line change
@@ -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
}
6 changes: 5 additions & 1 deletion src/UglyToad.PdfPig.Fonts/SystemFonts/SystemFontFinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ internal sealed class WindowsSystemFontLister : ISystemFontLister
{
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");
Expand Down

0 comments on commit 74655b4

Please sign in to comment.