Skip to content

Commit 7334549

Browse files
committed
fix(Avalonia): use embedded font collection
What does "Inter is used the same way fonts:Inter#Inter" mean when the source from Avalonia.Fonts.Inter uses new Uri("fonts:Inter", UriKind.Absolute), I have been unable to get any of my embedded fonts to work via a fontCollection (stepping through the code, it seems to register my fonts with the collection, but still does not display them unless installed on the system). This is fixed by using the `fonts:` scheme
1 parent 17f9436 commit 7334549

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

SnapX.Avalonia/Program.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,13 @@ static AppBuilder BuildAvaloniaApp()
1818
builder = builder.WithSystemFontSource(new Uri("fonts:Inter", UriKind.Absolute));
1919
builder = builder.With(new FontManagerOptions
2020
{
21-
DefaultFamilyName = "Inter",
21+
DefaultFamilyName = "fonts:Inter#Inter",
2222
FontFallbacks = new List<FontFallback>
2323
{
24+
new()
25+
{
26+
FontFamily = "Inter"
27+
},
2428
new()
2529
{
2630
FontFamily = "Noto Sans"

0 commit comments

Comments
 (0)