Setting font for editor textarea

Last post 07-17-2008, 6:26 PM by ralc001. 3 replies.
Sort Posts: Previous Next
  •  07-15-2008, 5:14 PM 42239

    Setting font for editor textarea

    I am trying to set the default font for the editor textarea programatically - i.e. based on the selection by a user on a "login" page.
     
    The way I decided to go about this is to have several css stylesheets, each with a different font specified for the textarea of the editor.  Then when the page with the editor loads, I set the EditorWysiwigModeCss to the required stylesheet.
     
    The problem I have is that changing the stylesheet doesnt seem to change the default font?  By default the dropdown still has verdana selected.  To make sure, I typed in some text in the editor window and compared it to ms word and the fonts are different.  If I then highlight the text in the editor and select the proper font in the dropdown then it changes font.  But the point is I need several fonts to be "default" based on user selection.
     
    Verdana works (see css code for the textarea below) but not arial or times new roman?  I note that for verdana, more than one font is specified.  Do I need to specify serveral fonts for the others as well? 
     
    Verdana works:
     
    TEXTAREA
    {
     font-size: 10pt;
     color: black;
     font-family: Verdana, Tahoma, Arial;
    }
     
     
    Arial doesnt?
     
    TEXTAREA
    {
     font-size: 10pt;
     color: black;
     font-family: Arial;
    }
     
     
     
    If I need to specify several fonts as per the verdana example, then what do I have to specify for the following fonts?  Is there documentation somewhere that specifies what font family has to be specified for other fonts we might consider in the future?
     
    Arial
    Arial Black
    Arial Narrow
    Comic Sans MS
    Courrier New
    system
    Tahoma
    Times New Roman
    Verdana
    Wing Dings
  •  07-15-2008, 5:16 PM 42240 in reply to 42239

    Re: Setting font for editor textarea

    I also tried specifying an actual font instead of just the font family in the css and it still doesnt work
     
    e.g.
    TEXTAREA
    {
     font-size: 10pt;
     color: black;
     font-family: Arial;
     font:  Arial;
    }
  •  07-17-2008, 4:56 PM 42325 in reply to 42240

    Re: Setting font for editor textarea

    A 'font-family' is a group of fonts that exhibit similar characteristics. The 'font-family' property indicates a prioritized list of specific/generic font family names to use to display text content in the current container. At least one specific or general font family must be given. If the specified font does not exist, or the necessary glyph is not available in the specified font, the next font is tried. This process continues through the prioritized list until no more are available. If no match is made, the browser default font family should be used.
     
    font-family: arial, "lucida console", sans-serif

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  07-17-2008, 6:26 PM 42329 in reply to 42325

    Re: Setting font for editor textarea

    Thanks for the explanation.  However that still doesn't explain why specifying a font of Arial didn't work when trying to set the default font for the editor textarea.
     
    After a bit of experimentation however, I found out that it works if I set the font family for the BODY element in the css instead of the TEXTAREA.
View as RSS news feed in XML