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

How to change fonts used to display content in HTML tab

1 Answer 61 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Joseph Alfano
Top achievements
Rank 1
Joseph Alfano asked on 30 Sep 2010, 09:21 PM
Hi,

We are using RadEditor v. 2010.1.519.35.  We have changed the background and default font for the Design tab by setting a value for the Editor Css file as follows
<telerik:radeditor runat="server" SkinId="PerfOptimizedRadEditor" NewLineBr="false" ToolsFile="~/XMLConfigFiles/RadEditorToolsFile.xml" EditModes="Design,Html,Preview" 
    StripFormattingOnPaste="None" StripFormattingOptions="None" ToolbarMode="Default" Skin="WebBlue" 
    SpellCheckSettings-SpellCheckProvider="EditDistanceProvider" SpellCheckSettings-EditDistance="1" 
    SpellCheckSettings-AllowAddCustom="false"  SpellCheckSettings-DictionaryPath="~/MSFS/Content/RadSpellDictionaries"
    ContentFilters = "RemoveScripts,FixUlBoldItalic,FixEnclosingP,IECleanAnchors,MozEmStrong,ConvertFontToSpan,ConvertToXhtml,IndentHTMLContent"  >
    <CssFiles>
        <telerik:EditorCssFile Value="~/Stylesheets/RadEditorApplyStylesSelector.css" />
    </CssFiles>
</telerik:radeditor>

and then in the stylesheet (in this case named RadEditorApplyStylesSelector.css), setting the following style for the body:
body
{
    font-size: 9pt;
    font-family:Verdana,serif;
    font-weight: normal;
    background-color:#FFFFE4;
}

This works great and the display of the content in the Design tab is modifed to reflect the css style.  However, the display of the content in the HTML tab does not change.  It is still displayed using the default css styles.

How do we change the display of the RadEditor content that appears in the HTML tab?

Thanks for the help!

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 04 Oct 2010, 01:02 PM
Hello Joseph Alfano,

You can change the appearance of Html mode using the following js code:

<script type="text/javascript">
    function OnClientLoad(editor) {
        var HtmlMode = editor.get_textArea().style;
        HtmlMode.backgroundColor = "Black";
        HtmlMode.color = "Red";
        HtmlMode.fontFamily = "Tahoma";
    }
</script>
<telerik:RadEditor ID="RadEditor1" OnClientLoad="OnClientLoad"  runat="server">


All the best,
Rumen
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Editor
Asked by
Joseph Alfano
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or