diff -urp editors.orig/ckeditor.inc editors/ckeditor.inc --- editors.orig/ckeditor.inc Mon Jan 17 16:16:08 2011 +++ editors/ckeditor.inc Mon Jan 17 22:32:35 2011 @@ -181,6 +181,10 @@ function wysiwyg_ckeditor_settings($editor, $config, $ } } + if (!empty($config['css_classes'])) { + $settings['stylesSet'] = wysiwyg_ckeditor_get_styles_set($config['css_classes']); + } + if (isset($config['language'])) { $settings['language'] = $config['language']; } @@ -332,3 +336,18 @@ function wysiwyg_ckeditor_plugins($editor) { return $plugins; } +/** + * Return an array for JS of custom Font styles + */ +function wysiwyg_ckeditor_get_styles_set($css_classes) { + $lines = explode("\n", $css_classes); + foreach ($lines as $line) { + $l = explode("=", trim($line)); + $lc = explode(".", $l[1]); + $style['name'] = $l[0]; + $style['element'] = $lc[0]; + $style['attributes']['class'] = $lc[1]; + $css_styles[] = $style; + } + return $css_styles; +} diff -urp editors.orig/js/ckeditor-3.0.js editors/js/ckeditor-3.0.js --- editors.orig/js/ckeditor-3.0.js Mon Jan 17 16:36:29 2011 +++ editors/js/ckeditor-3.0.js Mon Jan 17 22:19:19 2011 @@ -24,6 +24,9 @@ Drupal.wysiwyg.editor.init.ckeditor = function(setting } } } + // Register Font styles. + var wysiwygSettings = Drupal.settings.wysiwyg.configs.ckeditor[format]; + CKEDITOR.stylesSet.add('custom', wysiwygSettings.stylesSet); } };