mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-12-22 03:57:22 +08:00
Add early version of BrowserSystemFontLister
This commit is contained in:
@@ -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
|
||||||
|
}
|
||||||
@@ -94,6 +94,10 @@ namespace UglyToad.PdfPig.Fonts.SystemFonts
|
|||||||
{
|
{
|
||||||
lister = new AndroidSystemFontLister();
|
lister = new AndroidSystemFontLister();
|
||||||
}
|
}
|
||||||
|
else if (OperatingSystem.IsBrowser())
|
||||||
|
{
|
||||||
|
lister = new BrowserSystemFontLister();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,8 +8,6 @@
|
|||||||
{
|
{
|
||||||
public IEnumerable<SystemFontRecord> GetAllFonts()
|
public IEnumerable<SystemFontRecord> GetAllFonts()
|
||||||
{
|
{
|
||||||
// TODO: Could use System.Drawing InstalledFontCollection to do this?
|
|
||||||
|
|
||||||
var winDir = Environment.GetFolderPath(Environment.SpecialFolder.Windows);
|
var winDir = Environment.GetFolderPath(Environment.SpecialFolder.Windows);
|
||||||
|
|
||||||
var fonts = Path.Combine(winDir, "Fonts");
|
var fonts = Path.Combine(winDir, "Fonts");
|
||||||
|
|||||||
Reference in New Issue
Block a user