1. 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?

Discussion in 'Styling and Customization Questions' started by RobParker, Oct 9, 2013.

  1. RobParker

    RobParker Well-Known Member

    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.
  2. RobParker

    RobParker Well-Known Member

    (searching for "fonts" on here returns a lot of posts with no relevance at all, not really sure what's going on there...)
  3. AndyB

    AndyB Well-Known Member

    This might help.

  4. AndyB

    AndyB Well-Known Member

    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.
  5. RobParker

    RobParker Well-Known Member

    Hi Andy,

    I thought it was MessageText that needed changing, not the editor contents.

  6. AndyB

    AndyB Well-Known Member

    According to the little black box, setting just the style for the messages should also apply to the editor contents.
  7. MattW

    MattW Well-Known Member

    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.
  8. AndyB

    AndyB Well-Known Member

    Here you go, Matt. I also removed a few other toolbar buttons.

    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,
           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)
           if (!bC || bC.list)
             buttons.push(['unorderedlist', 'orderedlist'/*, 'outdent', 'indent'*/]);
           else if (bC.indent)
             buttons.push(['outdent', 'indent']);
  9. cclaerhout

    cclaerhout Well-Known Member

    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).
    MattW likes this.
  10. rhs

    rhs Member

    Without addons or edit .js files ... put simply this in your extra.css:

    .redactor_toolbar li a.redactor_btn_fontfamily {
        display: none;
    ge66 likes this.

Share This Page