Adding Custom Fonts to the WPF HTML Editor Font Dropdown

    The WPF HTML Editor's WpfHtmlEditor populates its font dropdown with every TrueType font installed on the local PC, which is fine until your app ships with a corporate brand font, a licensed webfont, or another custom typeface baked into your installer rather than the Windows font list. Custom or branded fonts that ship with your application as .otf files referenced through CSS web-font URLs are not installed on the machine, so they won't appear in that list automatically, and users are left applying whatever generic font happens to be installed. This page shows how to replace or extend the font dropdown with your own font names and make the editor actually render them.

    WPF HTML Editor's font picker dropdown filtered down to only three approved branded fonts after the default system font list was replaced.
    WPF HTML Editor's font picker dropdown filtered down to only three approved branded fonts after the default system font list was replaced.

    The font combo is populated from System.Drawing.FontFamily.Families and reachable via editor.ToolbarItemOverrider.ToolbarItems.FontName - a plain WPF ComboBox with no dedicated "AddFont" API. Clear it and add your own font names on the Loaded event, after the combo has been populated, to replace the system list.

    Selecting an added font calls FormattingService.ChangeFontName("Larken"), writing font-family: Larken into the document's inline style. That only controls selection; add a matching @font-face rule to the document header too, or the WYSIWYG surface falls back to a substitute font.

    private void ArticleEditor_OnLoaded(object sender, RoutedEventArgs e) {     ComboBox fontCombo = ArticleEditor.ToolbarItemOverrider.ToolbarItems.FontName;     fontCombo.Items.Clear();     fontCombo.Items.Add("Larken");     fontCombo.Items.Add("Larken Display");     fontCombo.Items.Add("Cardinal Fruit"); }
    Private Sub ArticleEditor_OnLoaded(sender As Object, e As RoutedEventArgs)     Dim fontCombo As ComboBox = ArticleEditor.ToolbarItemOverrider.ToolbarItems.FontName     fontCombo.Items.Clear()     fontCombo.Items.Add("Larken")     fontCombo.Items.Add("Larken Display")     fontCombo.Items.Add("Cardinal Fruit") End Sub
    ArticleEditor.HeaderStyleContent = ""      + "@font-face { font-family: 'Larken'; "      +              "src: url('https://cdn.publisher.example/fonts/Larken.otf'); }"      + "@font-face { font-family: 'Larken Display'; "      +              "src: url('https://cdn.publisher.example/fonts/LarkenDisplay.otf'); }"      + "@font-face { font-family: 'Cardinal Fruit'; "      +              "src: url('https://cdn.publisher.example/fonts/CardinalFruit.otf'); }";
    WPF HTML Editor rendering an article body in the Larken serif typeface loaded via @font-face, proving custom fonts work in the editing surface.
    WPF HTML Editor rendering an article body in the Larken serif typeface loaded via @font-face, proving custom fonts work in the editing surface.

    To add fonts on top of the system list instead of replacing it, skip Items.Clear() and append the names - both approaches work. To add another font later, add one line to the ArticleEditor_OnLoaded handler and one @font-face entry; it appears in the dropdown on the next launch.

    • The font combo is the standard WPF ComboBox reachable via ToolbarItemOverrider.ToolbarItems.FontName.
    • Add strings to fontCombo.Items (or Clear() first to replace the list entirely).
    • Pair non-system fonts with an @font-face rule pushed through editor.HeaderStyleContent so the editor renders them.

    Last updated on May 15, 2026

    Put this into practice.

    WPF HTML Editor Control ships with free C# and VB.NET sample projects and a 14-day evaluation.

    Prefer a guided look? Book a free live demo with our engineers - live on Zoom or Teams, never a chatbot.