我想将字体添加到CKEditor字体组合框中。这本身就很简单。但是,我想添加的字体是我在@ font -face CSS3属性中使用的自定义字体。我设法做到了这一点,但是编辑器本身不显示自定义字体。如果我只获取CKEditor创建的html并将其显示在页面的div中,自定义字体就会显示得很好。我还想以某种方式将@ font -face属性添加到CKEditor的文本区,这样我的用户就可以在输入时看到自定义字体。
这个是可能的吗?
发布于 2009-09-09 17:35:46
将以下行添加到ckeditor/config.js
config.contentsCss = 'fonts.css';
//the next line add the new font to the combobox in CKEditor
config.font_names = 'fontnametodisplay/yourfontname;' + config.font_names;
其中fonts.css具有@font-face属性:
@font-face {
font-family: "yourfontname";
src: url( ../fonts/font.eot ); /* IE */
src: local("realfontname"), url("../fonts/font.TTF") format("truetype"); /*non-IE*/
}
https://stackoverflow.com/questions/1398342
复制相似问题