Hindi fonts are not working in CKEditor?

2020-05-06 10:29发布

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?

标签: ckeditor
1条回答
你好瞎i
2楼-- · 2020-05-06 10:56

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';
        }
    }
} );
查看更多
登录 后发表回答