如何在CKEditor中自定义字体?

时间:2011-06-18 02:04:25

标签: ckeditor fckeditor rich-text-editor

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

1 个答案:

答案 0 :(得分: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';

将在菜单中为您提供这些字体名称:

  • Arial字体
  • Times New Roman
  • 宋体