问题
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