TinyMCE 4 default font-size

user1105430 picture user1105430 · May 29, 2013 · Viewed 11.3k times · Source

In TinyMCE 3 you can change the editor's default font-size by using this code in the settings:

setup : function(ed)
{
    ed.onInit.add(function(ed)
        {
            ed.getDoc().body.style.fontSize = '14px';
        });
}

In version 4, I tried using the same method but get this error:

TypeError: ed.onInit is undefined

I also tried using the "content_css" option and set the body to 14px font size, but that works only when on preview. http://www.tinymce.com/wiki.php/Configuration:content_css

Has anyone found another way to set the editor's default font size? I couldn't find any documents, even in their forum.

Answer

user1105430 picture user1105430 · Jun 2, 2013
setup : function(ed)
{
    ed.on('init', function() 
    {
        this.getDoc().body.style.fontSize = '14px';
    });
}