Skip to content

Commit 2735749

Browse files
author
ArthurHub
committed
WPF - handle custom fonts
1 parent 9b77145 commit 2735749

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

Source/Demo/WPF/DemoWindow.xaml.cs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,13 @@ public DemoWindow()
5252
/// </summary>
5353
private void LoadCustomFonts()
5454
{
55-
// TODO:a load custom fonts
56-
// // load custom font font into private fonts collection
57-
// var file = Path.GetTempFileName();
58-
// File.WriteAllBytes(file, Resources.CustomFont);
59-
// _privateFont.AddFontFile(file);
60-
//
61-
// // add the fonts to renderer
62-
// foreach (var fontFamily in _privateFont.Families)
63-
// HtmlRender.AddFontFamily(fontFamily);
55+
// load custom font font into private fonts collection
56+
var file = Path.GetTempFileName();
57+
File.WriteAllBytes(file, Common.Resources.CustomFont);
58+
var customFont = new FontFamily(file);
59+
60+
// add the fonts to renderer
61+
HtmlRender.AddFontFamily(customFont);
6462
}
6563

6664
/// <summary>

0 commit comments

Comments
 (0)