Adding fonts available in CKeditor

ckeditor

I have seen this answer. But I can't seem to get it to work.

In /ckeditor/_source/plugins/font/plugin.js, I have:

CKEDITOR.config.font_names =
  'Arial/Arial, Helvetica, sans-serif;' +
  'Comic Sans MS/Comic Sans MS, cursive;' +
  'Courier New/Courier New, Courier, monospace;' +
  'Georgia/Georgia, serif;' +
  'Lucida Sans Unicode/Lucida Sans Unicode, Lucida Grande, sans-serif;' +
  'Tahoma/Tahoma, Geneva, sans-serif;' +
  'Times New Roman/Times New Roman, Times, serif;' +
  'Trebuchet MS/Trebuchet MS, Helvetica, sans-serif;' +
  'Verdana/Verdana, Geneva, sans-serif';

And I just added a new line:

  'Calibri/Calibri, Verdana, Geneva, sans-serif;' +

I have hard-refreshed the page, but I am not getting the new "Calibri" font in the drop down. Am I supposed to be doing something else?

Thanks!

Best Answer

never change _source files!

use config.js to alter your configuration

eg:

CKEDITOR.editorConfig = function( config )
{
    config.font_names =
            'Arial/Arial, Helvetica, sans-serif;' +
            'Comic Sans MS/Comic Sans MS, cursive;' +
            'Courier New/Courier New, Courier, monospace;' +
            'Georgia/Georgia, serif;' +
            'Lucida Sans Unicode/Lucida Sans Unicode, Lucida Grande, sans-serif;' +
            'Tahoma/Tahoma, Geneva, sans-serif;' +
            'Times New Roman/Times New Roman, Times, serif;' +
            'Trebuchet MS/Trebuchet MS, Helvetica, sans-serif;' +
            'Calibri/Calibri, Verdana, Geneva, sans-serif;' + /* here is your font */
            'Verdana/Verdana, Geneva, sans-serif';

   // here you can add more config.*
};
Related Topic