I want to change the default font type (to verdana,geneva,sans-serif) of the editor window which appears while posting any content.

We are currently at CKEditor 3.3.1.5586.

I have gone through the forums and applied the work around suggested on the link below but it was no help at all.

http://drupal.org/node/1086554#comment-4976310

-- updated the fonts in contents.css of ckeditor, used editor default css but no help.
-- Edited the font in theme and selected user theme css. Again no help.

I cleaned the cache and used different browsers to avoid cache issue.

What am i missing ?... Is there really a way to change the default font of editor window ?

Similarly, where can i change the default font of Filtered HTML ?

Sorry I am very new to drupal so I might sound silly technically.

Regards
Vishnu

Comments

twod’s picture

Status: Active » Fixed

Technically, the editor does not use a default font, it merely does not explicitly assign a specific font unless you select one from the drop-down list. Which font is actually used depends on the stylesheets loaded in the editor. By default, that includes the editor's own basic styling rules, which aren't that many but help with editing, as well as the stylesheets from the "current" Drupal theme (usually the admin theme) injected by Wysiwyg module. If no font has been explicitly set for a paragraph, there is no way for the editor to figure out which one is actually being used, since it doesn't parse all the stylesheets like the browser does.

To make a different font the default one used, you need to edit the stylesheet(s) responsible for setting it, which may not be the same ones used when rendering the content for the frontend. You can manually override which stylesheets to inject from Wysiwyg using the "Define CSS" option on the editor configuration page.

To make the editor show a different font name as the "default" one in the Font drop-down, you have to set a config value for CKEditor. Wysiwyg has a hook to override settings which aren't available from the GUI.

/**
 * Implements hook_wysiwyg_editor_settings_alter().
 */
function MYMODULE_wysiwyg_editor_settings_alter(&$settings, $context) {
  if ($context['profile']->editor == 'ckeditor') {
     $settings['font_defaultLabel'] = 'Arial';
  }
}

Note that the font_defaultLabel setting only changes the label shown in the toolbar drop-down. When selecting that you really say "Use no explicit font and leave it up to the stylesheets".

vishnu.kumar7’s picture

Thank you very much for your reply... I will try again based on your suggestions... Amazing module it is...

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.