How can I add a new font type to Sugar's tinymce editor? 

In \include\javascript\tiny_mce\themes\advanced\editor_template_src.js

I made some changes to the init function to add Calibri:

t.settings = s = extend({

  [...]

  theme_advanced_fonts : "Calibri=calibri,helvetica,sans-serif; [...] "

  [...]

}, s);

[... and later on ...]

ed.contentCSS.push("http://fonts.googleapis.com/css?family=Calibri:300,400,700");

Obviously, that's not enough.

What's missing ? Or is my whole approach wrong?

Is there any way to do this just by changing \custom\include\tinyMCEDefaultConfig.php?

  • Hello,

    You can try making the change to theme_advanced_fonts in custom/include/tinyMCEDefaultConfig.php, then adding the following line to the top of the file custom/theme/custom.less:

     

    Let me know if that works for you!

     

    -Alan

  • Thank you Alan!

    That is what I was looking for.

    Along with a change in \custom\include\tinyMCEDefaultConfig.php:

    <?php

    $defaultConfig = array(

        'theme_advanced_fonts' =>  "[...]Calibri=Calibri, Candara, Segoe, 'Segoe UI', Optima, Arial, sans-serif;[...]

    );

    it enables Calibri in the editor used to design templates.

    Kind Regards!