Search code examples
jquerytinymcerte

tiny MCE add font dropdown list


Can someone please tell me how to add font dropdown list to TinyMCE?

I referred the example in this fiddle : http://jsfiddle.net/g51nrhhf/26/

I tried the below code by adding font-family, but didnt work:

 toolbar: "InsertTecDocLink | insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link  image | font-family "

Please suggest!

Thanks in advance!


Solution

  • This example contains the init settings you need:

    https://www.tinymce.com/docs/demo/classic/

    In particular you need to add fontselect to a toolbar to get what you want. The init in your fiddle would then become:

    tinymce.init({
      selector: 'textarea',
      toolbar: 'fontsizeselect | fontselect',
      fontsize_formats: "8px 10px 12px 14px 18px 24px 36px",
      font_formats: 'Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;'
    });