Developer forum

Forum » CMS - Standard features » Adding custom font to ckEditor does not reflect its style

Adding custom font to ckEditor does not reflect its style

Fabio Monte
Reply

Hi

We added a new custom font to the ckEditor font dropdown but it's not reflecting its style, like for example, Comis Sans MS does.

Here's a screencast: https://www.screencast.com/t/JDEOjSPIr with the fonts.css with the fontface and the changes made to the current js file being used in the editor.

What step are we missing?

 


Replies

 
Nicolai Pedersen
Reply

Something wrong with your config for loading your custom font.css. It does not load when I look at the network tab in dev tools.

 
Fabio Monte
Reply

Hi Nicolai

We have been trying to find the cause of the custom fonts.css not being loaded in the editor but couldn't yet find the problem.

Setting the absolute path config.contentsCss = 'http://dev-ray.dw-demo.com/Files/System/Editor/ckeditor/fonts.css'; or the relative path: config.contentsCss = '/Files/System/Editor/ckeditor/fonts.css'; does not work.

It seems the default.js file is being called from the ckeditor.js using 'CKEDITOR.config.templates_files=[CKEDITOR.getUrl("plugins/templates/templates/default.js")]'; but this file lives under https://dev-ray.dw-demo.com/Admin/Editor/ckeditor/ckeditor/ckeditor.js and it seems we can't get anything into the AdminEditor/ckeditor folder...that's probably where our fonts.css should live?

We appreciate anyones help 

 

 
Fabio Monte
Reply

We haven't yet found the cause of new fonts not being loaded. This limits customization of the editor.

We tried to change the paths/added the fonts.css to the ckeditor folder withing the Admin folder but it still does not work...not even loading an external font from Google works.

We also tried to set new fonts in RR341 but they still do not load:

Here's a screencast with repro:  https://www.screencast.com/t/7nP6o6iQn1

Can you explore this at your end? Can it be a platform bug?

 
Nicolai Pedersen
Reply

You can try the webfonts plugin: https://ckeditor.com/cke4/addon/ckeditor-gwf-plugin

Or you could try the Tiny editor instead - might be more modern and have better support custom google fonts.

 

You must be logged in to post in the forum