7 Answers, 1 is accepted
Please take a look at the following forum threads, which discussed the browser issue: https://www.telerik.com/forums/default-font-name-and-font-size-set-not-getting-in-radeditor-font-name-and-size and https://www.telerik.com/forums/radeditor-default-font-style-not-applied-upon-typing.
I need to save the font style to the database. And those solutions are for display the value in the browser.
Is there any way to always save the font style to the database?
It would be very helpful if you explain your scenario in more detail, because the content produced by RadEditor is a just string with HTML markup in it and the font information is part of this string.
If the RealFontSize, or FontSize tools or the HTML mode are enabled, the end user can apply multiple font sizes to different parts of the content.
What I need is that always the content produced by RadEditor contains the font information as part of the string with HTML markup in it. For example, this is the desired result: "<span style="font-family: Arial; font-size: 12px;">test</span>"
Thanks for trying to help and hope this will make more sense now
In such case, it is better to wrap the initial content in a span tag with applied font-size setting:
That solution works, but it's not always consistent if the editor is loaded with a default value. I found a solution for this using the OnClientSubmit event, I wrapped the editor content in a span tag with the font style attribute.
Now, I would like to know if in this event I can get the default and of the editor when it was loaded, to apply it to the span that I'm going to create, this is because we create editors dynamically in the server with different font styles.
The body and the iframe element of RadEditor does not have a default font applied and they are inherited by the page. If the font is applied programmatically as below to the body element of RadEditor you can obtain it with editor.get_contentArea().style.fontSize and editor.get_contentArea().style.fontFamily