0

Trying to add custom font formats I cant seem to figure out how. I have been able to do other stuff with config files and created a few things already but this one isn't working whatsoever.

originalConfig.toolbar1 = originalConfig.toolbar1 + ' fontselect  '; 

originalConfig.font_formats = 'Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;AkrutiKndPadmini=Akpdmi-n';   

return originalConfig;

Even this way originalConfig.font_formats = originalConfig.font_formats + '';

however it is throwing the error

"Uncaught TypeError: Cannot read property 'indexOf' of undefined"

that is coming from the e.addButton("fontselect", function(){}); tinymce.min.js which handles the default font family formatter in TinyMCE which makes me believe that I am close to succeed. Somehow data is not being passed to the Index in order to populate the listbox containing the different fonts.

this would be fairly simple in TinyMCE but your override system isn't documented.

any help is appreciated.

1 Answers1

0

There are two concepts in TinyMCE: fonts and styles. Not sure which one you are referring to. But in any case I would suggest to go with styles and here is how you can add your own styles: https://www.impresspages.org/docs/tinymce

Mangirdas Skripka
  • 1,647
  • 1
  • 15
  • 14
  • I am trying to use fonts as described in the TinyMCE documentation [font formats](http://www.tinymce.com/wiki.php/Configuration:font_formats) I know how to use custom formats and probably integrate my own code to insert custom fonts, just did not want to re-invent the wheel. – Jacobo López Mar 03 '15 at 05:33