How to set a font for the entire html document

1 Answer 39 Views
RichTextEditor
Daniel
Top achievements
Rank 1
Daniel asked on 13 Feb 2025, 08:56 PM

Using the RichTextEditor I am attempting to set a default value for font family using a style but so far have been unable to get it to work.

Here is my attempt.

      StringBuilder _HtmlContent = new StringBuilder();
      _HtmlContent.Append("<html><head><style>body { font-family:verdana;; font-size: 16px; }</style></head><body>");
      _HtmlContent.Append("<p>This is a paragraph with Verdana font.</p>");
      _HtmlContent.Append("</body></html>");

 this.richTextEditor.Source = RichTextSource.FromString(_HtmlContent.ToString());

What am I doing wrong?  Thanks for your help.

 

Daniel

1 Answer, 1 is accepted

Sort by
0
Didi
Telerik team
answered on 14 Feb 2025, 06:48 AM

Hello Daniel,

This option is currently not available. The option is to set front to each html element also if you want to apply any additional styling. 

Cast your vote for the following feature request: https://feedback.telerik.com/maui/1629476-richtexteditor-provide-support-for-html-global-style 

Regards,
Didi
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
RichTextEditor
Asked by
Daniel
Top achievements
Rank 1
Answers by
Didi
Telerik team
Share this question
or