Default font in editor

Last post 12-03-2011, 12:47 AM by nrsharma. 2 replies.
Sort Posts: Previous Next
  •  12-01-2011, 10:59 PM 71760

    Default font in editor

    Hi,
     
    I have an urgent requirement in my application. I need to set default  font as "Arial" and font-size as "12 Px". I had discussed this with one of the support team member (not sure but I think he was "Eric" thanks a lot to him for the script) and he suggested me some script i.e.
     
    function CuteEditor_OnInitialized(editor) {
            var editor1 = document.getElementById("<%= EmailCEditor.ClientID  %>");
            editor1.ExecCommand("FontName", "", "Arial");
            editor1.ExecCommand("FontSize", "", "3");        
        }
     
    The  script is working fine and sets the default font as Arial, but the point is when I am writing content in the editor then I found that the font style is not applied to content (as it was set to Arial).
     
    I had notice in this editor where I am writing post right now having some font style but the font drop down having "Default Font" selected.  
     
    Please reply ASAP. 
     
    Thanks, in advance.  
  •  12-02-2011, 6:04 AM 71765 in reply to 71760

    Re: Default font in editor

    Hi nrsharma,
     
    Please try the example below
     
    <%@ Page Language="C#" %>
    <%@ Register Assembly="CuteEditor" Namespace="CuteEditor" TagPrefix="CE" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title>example</title>
    </head>
    <body>
        <form id="form1" runat="server">
            <CE:Editor ID="editor1" runat="server" EditorBodyStyle="font-family:Comic Sans MS;font-size:12px;">
            </CE:Editor>
         <%--   font-family:Arial;--%>
        </form>
    </body>
    </html>
     
    Regards,
     
    Ken 
  •  12-03-2011, 12:47 AM 71772 in reply to 71765

    Re: Default font in editor

    Hi Kenneth,
     
    This is working. Thanks a lot for an early reply. 
View as RSS news feed in XML