Jump to content

Custom Fonts in Font Selector in Editor?


Nat Devine

Recommended Posts

Posted

Hi all,

I currently add some custom fonts to our board using the custom css file in the theme manager. It works brilliantly, but the only issue is that to use these fonts users need to have HTML enabled so that they can refer to the custom font-family via code. Eg:

<p style="font-family: 'CustomFont';">Some text</p>

For security reasons I'd like to cut down on the number of users who can see/post in HTML - so I was wondering if there is a way to add this "CustomFont" in to the Font selector in the editor as shown below?

image.thumb.png.b9a61c7fda43e198b2c61d4275314d0f.png

 

I don't mind diving in to the PHP files if that is the only way to change this list, so please let me know if it is possible

Cheers

Posted

Hello,

Default fonts

applications\core\interface\ckeditor\ckeditor\ckeditor.js

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",

You can add fonts in that file or in the config file \applications\core\interface\ckeditor\ckeditor\config.js

Posted
On 10/21/2019 at 6:26 AM, newbie LAC said:

Hello,

Default fonts

applications\core\interface\ckeditor\ckeditor\ckeditor.js


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",

You can add fonts in that file or in the config file \applications\core\interface\ckeditor\ckeditor\config.js

This worked! Thanks a lot

I've noticed that in "CKEDITOR.config.font_names=", I can place it in to the list and it will allow users to select it and it will look OK inside of the editor, however in the font list it appears in default Arial/Verdana font. Is there a way to make this font display with its custom font/appearance in the font list?

Posted
1 hour ago, newbie LAC said:

Include your fonts in applications\core\interface\ckeditor\ckeditor\contents.css

So, putting it in here didn't seem to change anything really - however placing it in the editor's other .css file...

applications\core\interface\ckeditor\ckeditor\skins\ips\editor.css

... did work!

Thanks for pointing me in the right direction. 😁

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...