Setting a Default Font

Re: Setting a Default Font

by Purnendu Dash -
Number of replies: 0
Picture of Plugin developers

Hi Ken,

There are a number of options to modify your font. You can select the font size from the "font-size, font-family" drop down in TinyMce editor. If you want to set a default font size or font, you may do this with appropriate coding.

Write the following code in TinyMce's config file.

setup : function(ed)

{

ed.onInit.add(function(ed)

{

ed.getDoc().body.style.fontSize = '8px';

ed.getDoc().body.style.fontFamily="cabin";

});

},

There is another way to do this. You may add your own custom styles into your CSS file by defining TinyMce id.

#tinymce .mceContentBody p {

font-family: your_font_name !important;

font-size:100%;

}

#tinymce .mceContentBody body {

font-family: your_font_name !important;

font-size:100%;

}

Please let me know if this works for you.

Have a good day.

Thanks and Regards,

Purnendu (developer)

DualCube