|
@@ -5,6 +5,7 @@ using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Linq;
|
|
using Avalonia.Media.Fonts;
|
|
using Avalonia.Media.Fonts;
|
|
|
|
+using Avalonia.Platform;
|
|
|
|
|
|
namespace Avalonia.Media
|
|
namespace Avalonia.Media
|
|
{
|
|
{
|
|
@@ -51,6 +52,12 @@ namespace Avalonia.Media
|
|
/// </summary>
|
|
/// </summary>
|
|
public static FontFamily Default => new FontFamily(String.Empty);
|
|
public static FontFamily Default => new FontFamily(String.Empty);
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// Represents all font families in the system. This can be an expensive call depending on platform implementation.
|
|
|
|
+ /// </summary>
|
|
|
|
+ public static IEnumerable<FontFamily> SystemFontFamilies =>
|
|
|
|
+ AvaloniaLocator.Current.GetService<IPlatformRenderInterface>().InstalledFontNames.Select(name => new FontFamily(name));
|
|
|
|
+
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets the primary family name of the font family.
|
|
/// Gets the primary family name of the font family.
|
|
/// </summary>
|
|
/// </summary>
|