adding @font-face to CKEditor

前端 未结 1 2028
长情又很酷
长情又很酷 2020-12-08 04:57

I would like to add a font to the CKEditor font combo box. This in itself is easy enough. However the font I would like to add is a custom font that I use with the @font-fac

相关标签:
1条回答
  • 2020-12-08 05:49

    add the following line to 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;
    

    where fonts.css has the @font-face attribute:

    @font-face {  
        font-family: "yourfontname";  
        src: url( ../fonts/font.eot ); /* IE */  
        src: local("realfontname"), url("../fonts/font.TTF") format("truetype"); /*non-IE*/  
    }
    
    0 讨论(0)
提交回复
热议问题