This is a migrated thread and some comments may be shown as answers.

RadEditor's default font is not available in Content

1 Answer 58 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Sonie
Top achievements
Rank 1
Sonie asked on 14 Oct 2013, 04:35 PM
Hi

We are using RadEdior control with following markup
<telerik:RadEditor ID="reNotes" runat="server" ClientIDMode="Static" 
                Language="en-US"
                TabIndex="72"
                EditModes="Design" 
                Height="150px" 
                Width="100%" 
                ToolsFile="~/EditorTools.xml"
                CssClass="defaultText" >
 </telerik:RadEditor>

.defaultText
{
  padding-top: 0px;
text-align:left;
}

Default text on the page is Arial 11px. When User set font style to Arial, "radeditor.content" property does not include font -family name into the style. Please see the attached document. 
We would like to get the default font-family name too from "radeditor.content". Can you please suggest how can I achieve this?

Thank you.





1 Answer, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 16 Oct 2013, 12:55 PM
Hi Sonie,

The described behavior is encountered because of the default font-family set to the main page. The additional span elements, which provide information about the text formatting and stylization, comes from browser commands, which are used in the Font Name tool's implementation of the editor.

You could test this by following this online demo. If you type some text and set the font to Arial, you could check that the generated code in the HTML mode is the same text, wrapped with a span element, which is set with the corresponding font-family. This is because the default font for the main document is different from Arial.

The logic is that if the user has not set a specified font, then this stylization depends on the default CSS rules set by the developer or the browser.

At this time I cannot suggest a proper approach that implements the logic to wrap such text lines in span elements and import some predefined rules. Although a possible solution is to further modify the used export functionality to wrap the whole editor's content in a div element, which is set with the desired CSS rules.  

Regards,
Ianko
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Editor
Asked by
Sonie
Top achievements
Rank 1
Answers by
Ianko
Telerik team
Share this question
or