javascriptckeditorfckeditorckeditor4.x

How to edit the font options in CKEditor?


I am using CKEditor 4.6 with the official font size and family plugin. Is it possible to change the font family option?

I am using fonts from Google Fonts and so I have the extra font files needed.


Solution

  • Use the font_names configuration option.

    The list of fonts names to be displayed in the Font combo in the toolbar. Entries are separated by semi-colons (';'), while it's possible to have more than one font for each entry, in the HTML way (separated by comma).

    A display name may be optionally defined by prefixing the entries with the name and the slash character. For example, 'Arial/Arial, Helvetica, sans-serif' will be displayed as 'Arial' in the list, but will be outputted as 'Arial, Helvetica, sans-serif'.

    config.font_names =
        'Arial/Arial, Helvetica, sans-serif;' +
        'Times New Roman/Times New Roman, Times, serif;' +
        'Verdana';
    
    config.font_names = 'Arial;Times New Roman;Verdana';