• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.2 Change default font and limit font selection?

RobParker

Well-known member
#1
I'm sure this is something simple but I can't figure out how to change the default font.

In message elements -> message text I have

Georgia, "Times New Roman", Times, serif

But in the editor I still see Arial, Tahoma, etc.
 

AndyB

Well-known member
#4
You also mentioned in the thread title that you would like to limit the font selection. I assume you mean disallow users from selecting any fonts. This can be done with a file hack. Let me know if you need instructions.
 

MattW

Well-known member
#7
I'd also be interested in removing the ability to select other fonts in the editor.

I use self hosted fonts, and have changed the font family in

General --> Body
Message Elements --> Message Text
Button --> Button

So everything is using Open Sans, but people can still pick the "horrible" other fonts and mess up the style of the thread / page.
 

AndyB

Well-known member
#8
Here you go, Matt. I also removed a few other toolbar buttons.

Code:
/js/xenforo/full/bb_code_edit.js

Purpose is to remove some of the buttons in the toolbar. Comment out the following starting on line #64

     getButtonConfig: function()
     {
       var self = this,
         buttons = [ ['switchmode'], ['removeformat']],
         bC = this.options.buttonConfig,
         group;

       if (!bC || bC.basic)
       {
         buttons.push(['bold', 'italic', 'underline'/*, 'deleted'*/]);
       }
       /*if (!bC || bC.extended)
       {
         buttons.push(['fontcolor', 'fontsize', 'fontfamily']);
       }*/
       if (!bC || bC.link)
       {
         buttons.push(['createlink', 'unlink']);
       }
       /*if (!bC || bC.align)
       {
         buttons.push(['alignment']);
       }*/
       if (!bC || bC.list)
       {
         buttons.push(['unorderedlist', 'orderedlist'/*, 'outdent', 'indent'*/]);
       }
       else if (bC.indent)
       {
         buttons.push(['outdent', 'indent']);
       }
 

cclaerhout

Well-known member
#9
I'd also be interested in removing the ability to select other fonts in the editor.

I use self hosted fonts, and have changed the font family in

General --> Body
Message Elements --> Message Text
Button --> Button

So everything is using Open Sans, but people can still pick the "horrible" other fonts and mess up the style of the thread / page.
With this addon, you have the ability to remove the font button and you can especially prevent the Bb Code "font" to parse (two modes: one is to disable the parsing so the font tags will be displayed. The second mode is too parse the Bb Code but returning only the content so that the font tags won't display).