Unplanned
Last Updated: 23 Jun 2020 13:03 by ADMIN
Dimitar
Created on: 23 Jun 2020 12:38
Category: RichTextBox
Type: Bug Report
1
RadRichTextBox: The RtfFormatProvider does not take the fonts from the Font.Manager

The RtfFormatProvider does not take the fonts from the Font.Manager

Workaround: 

Unregister all custom fonts and the use the FontSubstituting event to supply the correct fonts:

private void ImportSettings_FontSubstituting(object sender, Telerik.Windows.Documents.FormatProviders.FontSubstitutingEventArgs e)
{
    var fonts = Wpf.Fonts.Fonts.GetAllAvailableFonts();
    var ff = fonts.Where(x => x.Source == e.OriginalFontName).FirstOrDefault();
    e.SubstitutionFontFamily = ff; 

}

After the import is complete you can register the fonts again.

0 comments