- Home
- Forum
- ASP.NET MVC (Classic)
- RichTextEditor - Fonts - Default & Different
RichTextEditor - Fonts - Default & Different
Hi Chris,
Thanks for contacting Syncfusion forums.
Currently we do not provide support to remove the font names from
font combo box. However, you can set fonts other than TimesNewRoman by using
the following code snippet,
<code>
[Script]
//On load function
$find('RichTextEditor1').IFrame.ExecuteCommand(' fontName', 'Calibri');
</code>
Kindly try the above given solution and let us know if this helps.
Regards,
@Html.Syncfusion().RichTextEditor("description").ShowHtmlSource(false).Width(500)
given a <script> </script> tag, what should I put in there? I've tried:$.find('#description').iframe but that is null...
Thanks
ChrisWe regret for the
delay in getting back to you.
We have updated our
solution for this query in the incident #106477. Kindly refer the above
specified incident for better follow up.
Regards,
Varalakshmi
I also require the entered text to match with the font styles of the application.
I have tried the jquery in the thread and simialr with no success.
It looks like the stylesheet for the "RichTextEditor_IFrame" sets the font-family.
But this is not inherited by the document in the IFrame.
So a different approach is required.
I have tried to set the style of the body of the document in the Iframe using jquery,
but have had no success.
It would be good if in future versions the document "body" in IFrame had an id or a class,
then we could use a style sheet to control the font etc.
Hi Kerry,
Thanks for the update.
We suggest you to use the below given code to achieve the required functionality. The below given code will the Arial font face with size 2 for IFrame contents.
<code>
[script]
//function
var fontsize = $find('sample_FontSize_DropDown'); // here sample is controlid
var fontstyle = $find('sample_FontStyle_DropDown');
fontsize._textBox.value = 2; // fontsize for display purpose.
fontstyle._textBox.value = 'Arial'; // fontname for display purpose.
var rteobj = $find('sample_IFrame');
var str1 = rteobj.get_Text(); // getting the user text
var strhtml= '<div >'+'<font face="Arial" size="2">'+str1+'</font>'+'</div>'; // Div tag to pass the html source
rteobj.set_HtmlString(strhtml); // passing the Html element to RichTextEditor
</code>
Regards,
Varalakshmi
- 6 Replies
- 4 Participants
-
CS Chris Skardon
- Mar 22, 2013 04:10 PM UTC
- Jul 29, 2013 09:13 AM UTC