RadEditor's default font is not available in Content

2 posts, 0 answers
  1. Sonie
    Sonie avatar
    3 posts
    Member since:
    Jun 2009

    Posted 14 Oct 2013 Link to this post

    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.





  2. Ianko
    Admin
    Ianko avatar
    1940 posts

    Posted 16 Oct 2013 Link to this post

    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.
Back to Top