On the TinyMCE tool bar there is a drop-down list of font sizes where you can select 1 of 7 font-sizes. How can I change the set of font-sizes listed please?

According to the TinyMCE documentation I need to add to my tinyMCE.init() ...

tinyMCE.init({
        ...
        theme_advanced_font_sizes : "10px,12px,14px,16px,24px"
});

I have found tinyMCE.init in sites\all\modules\wysiwyg\editors\js\tinymce-3.js
but here it is called as...
tinyMCE.init(settings[format]);
So I'm not sure hoe to add this in.

Or is there a better way to do it in Drupal?

I'm on Drupal 6, tinyMCE 3.

Comments

RAWDESK’s picture

Issue summary: View changes

This ticket might be as old as my MacBook Pro I'm still using for my D7 kinepolis.com projects, but still relevant to answer with my solution to provide TinyMCE with additional font size choices from within a contrib wysiwyg encapsulation :

function my_module_wysiwyg_editor_settings_alter(&$settings, $context) {
  if ($context['profile']->editor == 'tinymce') {
    $settings['skin'] = 'my-skin';
    $settings['skin_variant'] = 'silver';
    $settings['fontsize_formats'] = '8pt=8pt 9pt=9pt 10pt=10pt 11pt=11pt 12pt=12pt 14pt=14pt 18pt=18pt 24pt=24pt 30pt=30pt 36pt=36pt';
  }
} 

This is compatible with Wysiwyg 7.x-2.5 on a TineMCE 4.x version.

Hint: Take a look inside sites/all/modules/contrib/wysiwyg/editors/js/tinymce-4.js and search for "fontsize_formats".

nicoloye’s picture

Status: Active » Closed (outdated)