SfRichTextEditor.SetFont doesn't update toolbar font selection

When setting a font programmatically by using SfRichTextEditor.SetFont(name, stream), the toolbar is not updated to show the selected font name.

Arno

3 Replies

DB Dilli Babu Nandha Gopal Syncfusion Team April 15, 2020 06:53 AM UTC

Hi Arno, 
 
Thank you for contacting Syncfusion support. 
 
To include the font in SfRichTextEditor toolbar, we recommend to add the font stream in FontStreamCollection property of FontButtonClickedEventArgs which is explained in the following documentation detailly with a sample. 
 
Rather, SetFont sets font in RichTextEditor and the font will be used only when ApplyFont is invoked with same font name. These methods won’t add the font to the font family option in toolbar. 
 
Regards, 
Dilli babu. 



DA Dr. Arno Pernozzoli April 15, 2020 08:20 AM UTC

Hi,

"To include the font in SfRichTextEditor toolbar, we recommend to add the font stream in FontStreamCollection property of FontButtonClickedEventArgs which is explained in the following documentation detailly with a sample."
 
ok, this is what I did, in addition I provided a user setting to store which font to activate by default.
So I'm using SetFont in addition, this only seems to set the font in the editor without setting the font name within the toolbar.
As a consequence the user is typing, thinking that the font on the toolbar is set, in reality the font was changed programmatically to a different one.

What I'm requiring is that the toolbar synchronizes with the font name set to the editor by SetFont and ApplyFont.

Arno 


DB Dilli Babu Nandha Gopal Syncfusion Team April 16, 2020 06:42 AM UTC

Hi Arno, 
 
As mentioned earlier,  SetFont sets font in RichTextEditor and the font will be used only when ApplyFont is invoked with same font name. These methods won’t add the font to the font family option in toolbar.  
 
To use a font as default in RichTextEditor, we recommended to use SetDefaultFont method which will include the font stream and use it as default font. 
 
Regards, 
Dilli babu. 


Loader.
Up arrow icon