如何在CKEditor中自定义字体? [英] How to customize fonts in CKEditor?

查看:122
本文介绍了如何在CKEditor中自定义字体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道如何在CKEditor 3.x系列中自定义(添加或删除)字体吗?我四处张望,不知如何。可能有一个/ plugin / fonts文件夹,但在CKEditor的3.5+版本中不存在。

Does anyone know how to customize (add or remove) fonts in the CKEditor 3.x series? I looked all over and I can't figure out how. Supposedly there is a /plugin/fonts folder but it does not exist in 3.5+ of CKEditor.

推荐答案

字体中的字体使用 CKEDITOR.config.font_names

The fonts in the font menu are configured using CKEDITOR.config.font_names:


< static> {String} CKEDITOR.config.font_names

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

The list of fonts names to be displayed in the Font combo in the toolbar. [...]

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

So all you need to do is set font_names in your configuration to the font names you want, for example:

config.font_names =
    'Arial/Arial, Helvetica, sans-serif;' +
    'Times New Roman/Times New Roman, Times, serif;' +
    'Verdana';

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

Will give you these font names in the menu:


  • Arial

  • Times New Roman

  • Verdana

这篇关于如何在CKEditor中自定义字体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆