Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/redis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
CKEditor-设置默认字体系列_Ckeditor_Wysiwyg - Fatal编程技术网

CKEditor-设置默认字体系列

CKEditor-设置默认字体系列,ckeditor,wysiwyg,Ckeditor,Wysiwyg,在CKEditor中有没有设置默认字体的方法 我的意思是,我想强制CKEditor只使用特定的字体,而不使用其他字体 到目前为止,我有以下工作组: CKEDITOR.inline( editable_533, { toolbar: [ ['Bold','Italic','Underline'], ['NumberedList','BulletedList'], ['JustifyLeft','JustifyCenter','JustifyRight'],

在CKEditor中有没有设置默认字体的方法

我的意思是,我想强制CKEditor只使用特定的字体,而不使用其他字体

到目前为止,我有以下工作组:

CKEDITOR.inline( editable_533, {
   toolbar: [
     ['Bold','Italic','Underline'],
     ['NumberedList','BulletedList'],
     ['JustifyLeft','JustifyCenter','JustifyRight'],
     ['Undo','Redo'],
     '/',
     ['TextColor','Font','FontSize']
   ],
   font_names: 'PT Sans/PT Sans',
   font_defaultLabel: 'PT Sans'
}))

在字体下拉列表中,我只有一种字体。默认情况下,CKEditor中有一些文本,但这不是正确的字体(PT Sans)

我不想在css中硬编码,因为有多个CKEditor实例,它们也需要一种字体(PT SAN除外)

谢谢

更新:

我尝试添加以下内容:

      font_style:
      {
          element   : 'span',
          styles    : { 'font-family' : 'PT Sans' },
          overrides : [ { element : 'font', attributes : { 'face' : null } } ]
      },

但是这并不会将字体更改为PT Sans

您是想强制它用于eyecandy还是完全更改编辑器的输出?有两个内联编辑器。一个必须是PT SAN,另一个必须是Arial。但是可以有多个内联编辑器。它们是动态创建的(字体存储在数据库中),因此必须与从数据库中提取的字体匹配。这意味着我无法开始在CSS中硬编码
字体系列
,因为
可编辑字体总是不同的。\u NO
这可能吗?@oleq我已经更新了我的问题