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;">&shy;</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

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -