Drupal 7 Drupal 7 WYSIWYG模块具有最新的ckeditor字体更改

Drupal 7 Drupal 7 WYSIWYG模块具有最新的ckeditor字体更改,drupal-7,ckeditor,drupal-modules,wysiwyg,Drupal 7,Ckeditor,Drupal Modules,Wysiwyg,我想将默认的“Timesnewroman”字体更改为“Verdana”/其他字体。我在config.js中尝试了config.font\u样式和config.font\u名称,但没有成功。是否有任何解决方法可以更改此设置 注意:我正在通过Drupal 7 WYSIWYG模块使用ckeditor插件。您可以在template.php文件中使用钩子 function THEMENAME_wysiwyg_editor_settings_alter(&$settings, $context) {

我想将默认的“Timesnewroman”字体更改为“Verdana”/其他字体。我在config.js中尝试了
config.font\u样式
config.font\u名称
,但没有成功。是否有任何解决方法可以更改此设置


注意:我正在通过Drupal 7 WYSIWYG模块使用ckeditor插件。

您可以在template.php文件中使用钩子

function THEMENAME_wysiwyg_editor_settings_alter(&$settings, $context) {
    if ($context['profile']->editor == 'ckeditor') {
        $settings['font_names'] = 'Arial/Arial, Helvetica, sans-serif; Times New Roman/Times New Roman, Times, serif;Verdana';
        $settings['font_defaultLabel'] = 'Verdana';
    }
}

您还可以为CKEditor添加其他设置。最后,控制字体的是CSS或HTML
style
属性。请查看由CKEditor生成的源代码,以了解如何处理字体。如果是css类,您可以在css中重写它们。如果它作为HTML样式嵌入,您需要手动或通过脚本来更改它们。如果我是你,我会制定和ACF规则来禁止样式,阻止用户选择字体,并且只使用CSS。(如果在drupal中有可能……我不知道,所以这只是一个注释:))