如何在CKEditor中自定义字体?

kid*_*tal 8 fckeditor rich-text-editor ckeditor

有谁知道如何在CKEditor 3.x系列中自定义(添加或删除)字体?我看了一遍,我无法弄清楚如何.据说有一个/ plugin/fonts文件夹,但它不存在于3.5+的CKEditor中.

mu *_*ort 16

字体菜单中的字体使用以下配置CKEDITOR.config.font_names:

<static> {String} CKEDITOR.config.font_names

要在工具栏的"字体"组合中显示的字体名称列表.[...]

因此,您需要做的就是font_names在配置中设置所需的字体名称,例如:

config.font_names =
    'Arial/Arial, Helvetica, sans-serif;' +
    'Times New Roman/Times New Roman, Times, serif;' +
    'Verdana';
Run Code Online (Sandbox Code Playgroud)

会在菜单中给你这些字体名称:

  • 宋体
  • 英语字体格式一种
  • 宋体

  • 谢谢.另外我添加了CKEDITOR.config.font_names所以我得到了所有这些,例如.config.font_names = CKEDITOR.config.font_names +"NewFont" (4认同)