Setting default font in RadHtmlField

4 posts, 1 answers
  1. AlexAngas
    AlexAngas avatar
    4 posts
    Member since:
    Jun 2009

    Posted 04 Jun 2009 Link to this post

    Hello,

    I'm attempting to change the default font from Times New Roman to Verdana in the RadHtmlField. I'm using the JavaScript technique in http://www.telerik.com/community/forums/sharepoint-2003/controls/change-default-font-for-moss-rad-editor.aspx and http://www.telerik.com/help/aspnet/editor/settingdefaultfont.html. I don't want the change to apply across all web applications on my server so I'm using the ConfigFile property of RadHtmlField. My config file is living in /_layouts/1033.

    This doesn't appear to work at all. I'm not even sure if my config file is being read.

    Any thoughts?

    Thanks, Alex.
  2. Stanimir
    Admin
    Stanimir avatar
    1653 posts

    Posted 05 Jun 2009 Link to this post

    Hi Alex,

    You can add your custom styles in the following location:

    /Program Files/Common Files/Microsoft Shared/web server extensions/wpresources/RadEditorSharePoint/4.5.6.0__1f131a624888eeed/RadControls/Editor/CssEditor.css

    This file is not created by default when you install RadEditor for MOSS. However, if it is present, the editor will automatically load it. Note that the folder name depends on the editor version (in this case it is 4.5.6.0). Also do not forget to back up the CssEditor.css file when you uninstall/upgrade the editor.

    The CssEditor.css file will also be automatically loaded in presentation mode (i.e. when the editor is not visible) in the Web Part and Publishing field (WCM) scenarios. The file will not be loaded in presentation mode when the editor is used in a list (e.g. wiki). This is because we cannot modify the page and add it when the editor is invisible. To workaround this problem you can include this file manually to the master page (using SharePoint Designer) or add it in the MOSS core CSS styles. Either way it will be automatically loaded in presentation as well as authoring (editing) mode. For example, to add the CssEditor.css file in the default MOSS styles, open the file

    /Program Files/Common Files/Microsoft Shared/web server extensions/12/Template/Layouts/1033/Styles/CORE.CSS

    and add the following line:

    @import url("/_wpresources/RadEditorSharePoint/4.5.6.0__1f131a624888eeed/RadControls/Editor/CssEditor.css");



    Sincerely yours,
    Stanimir
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.

  3. AlexAngas
    AlexAngas avatar
    4 posts
    Member since:
    Jun 2009

    Posted 05 Jun 2009 Link to this post

    Hello Stanimir,

    I don't want to add custom styles (I've seen the documentation about that). I want to change the default editing font in a RadHtmlField. Could you please help with that?

    Thank you,

    Alex.
  4. Answer
    Stanimir
    Admin
    Stanimir avatar
    1653 posts

    Posted 08 Jun 2009 Link to this post

    Hello Alex,

    In order to change the default editing font in a RadHtmlField you need to import the following custom style in the RadEditor's content area.
    Example with Verdana font:
    body 
        font-familyVerdana

    In order to do this you need to create the CssEditor.css file, place it in the mentioned in the article folder and add the body style in it .

    I hope this helps.

    Greetings,
    Stanimir
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top