Completed
Last Updated: 16 Nov 2017 09:15 by ADMIN
ADMIN
Hristo
Created on: 03 Nov 2017 07:31
Category: RichTextEditor
Type: Feature Request
1
ADD. RadRichTextEditor - provide support for loading custom fonts not installed on the machine
The new functionality should allow the developer to load custom fonts in the memory and then use them in RadRichTextEditor.
1 comment
ADMIN
Ralitsa
Posted on: 16 Nov 2017 09:13
Hello, 

In order to use the new functionality one should load the custom font using the ThemeResolutionService class and register it in RadRichTextEditor:

ThemeResolutionService.LoadFont(File.OpenRead(@"..\..\Fonts\HelveticaLt.ttf"));
Telerik.WinForms.Documents.Layout.FontManager.RegisterFont(new Telerik.WinControls.RichTextEditor.UI.FontFamily("Helvetica-Light"));

If you are using the RichTextEditorRibbonBar in the application, you need to load and register all custom fonts before initializing the ribbon bar. Here is the code snippet how can achieve it : 

public SampleForm()
{
	ThemeResolutionService.LoadFont(File.OpenRead(@"..\..\Fonts\HelveticaLt.ttf"));
	Telerik.WinForms.Documents.Layout.FontManager.RegisterFont(new Telerik.WinControls.RichTextEditor.UI.FontFamily("Helvetica-Light"));

	InitializeComponent();
	this.richTextEditorRibbonBar1.AssociatedRichTextEditor = this.radRichTextEditor1;

	this.radRichTextEditor1.Document = ImportDocx(file);
}

This improvement will be available in our next release - R1 2018, scheduling for January 2018. 

Best regards, 
WinForms team