javascript - CKEditor 4 - How to set default font? -
i use ckeditor 4 , want set default font. added "font_defaultlabel" font choice doesn't work ...
i found solution on internet it's trick me , not true solution :
ckeditor.on( 'instanceready', function( ev ) { ev.editor.setdata('<span style="font-family:arial, verdana, sans-serif;">­</span>'); });
can me?
epokk
you can use ckeditor's dataprocessor modify (for example) paragraphs choice font-size, font-family, affect paragraph entered ckeditor pasted, written or changed in source; this:
ckeditor.on('instanceready', function( ev ) { ev.editor.dataprocessor.htmlfilter.addrules({ elements: { p: function (e) { e.attributes.style = 'font-size:' + fontsizevariable + 'px; font-family:' + fontfamilyvariable + ';'; } } }); });
same dataprocessor.datafilter
but if intend view html created outside of environment, these rules might make real mess
Comments
Post a Comment