Hindi fonts are not working in CKEditor?

霸气de小男生 提交于 2019-12-02 18:37:56

问题


I know this type of question are there. but I have read out all answered question regarding ckeditor hindi fonts. and haven't got solution.

I have added following code in contents.css

@font-face {
    font-family: 'kruti_dev_070regular';
    src: url('KrutiDev070/kruti_dev_070-webfont.eot');
    src: url('KrutiDev070/kruti_dev_070-webfont.eot?#iefix') format('embedded-opentype'),
         url('KrutiDev070/kruti_dev_070-webfont.woff') format('woff'),
         url('KrutiDev070/kruti_dev_070-webfont.ttf') format('truetype'),
         url('KrutiDev070/kruti_dev_070-webfont.svg#kruti_dev_070regular') format('svg');
    font-weight: normal;
    font-style: normal;

}

and following code in config.js

config.font_names = 'Hindi/"kruti_dev_070regular";' +config.font_names;

it is displaying in drop down list but when selecting and typing it is not working?

Is there any other configuration setting which i am missing? please can anyone help me?


回答1:


It works for me. Check out the jsFiddle. Perhaps you extend config.font_names when it's not defined yet or use the wrong name of the font.

CKEDITOR.addCss( "@font-face {" +
  "font-family: 'Lobster';" +
  "font-style: normal;" +
  "font-weight: 400;" +
  "src: local('Lobster'), url(http://fonts.gstatic.com/s/lobster/v9/NIaFDq6p6eLpSvtV2DTNDQLUuEpTyoUstqEm5AMlJo4.woff) format('woff');" +
"}" );

CKEDITOR.replace( 'editor', {
    toolbarGroups: [
        { name: 'mode' },
        { name: 'basicstyles' },
        { name: 'styles' }
    ],
    on: {
        configLoaded: function() {
            this.config.font_names += ';Lobster';
        }
    }
} );


来源:https://stackoverflow.com/questions/24545879/hindi-fonts-are-not-working-in-ckeditor

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!