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

Installing new fonts

Discussion in 'XenForo Questions and Support' started by Handyman, Oct 15, 2010.

  1. Handyman

    Handyman Member

    Is it possible to add different fonts than those built in to XF.
     
    Tize likes this.
  2. Lawrence

    Lawrence Well-Known Member

    You can change/add fonts in Style Properties -> General, for various elements.
     
    Tize likes this.
  3. Handyman

    Handyman Member

    Sorry, I meant can more fonts be added to the message editor. (font family)
     
    Tize likes this.
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    I think I found it in this file:

    js/tinymce/themes/xenforo/editor_template.js

    Code:
    				theme_xenforo_fonts : "Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva",
    
     
    McKel, Tize, nukedi and 1 other person like this.
  5. Peggy

    Peggy Well-Known Member

    Just remember tho, that if you add fonts, and your members don't have those same fonts installed on their computers, they won't see them.
     
    Tize and Jake Bunce like this.
  6. Forsaken

    Forsaken Well-Known Member

    The way thats formatted it looks like you can include fallback fonts as well.

    Heres a good resource for font stacks, but you might want to edit out the ones that most people don't use ;p.
    http://articles.sitepoint.com/article/eight-definitive-font-stacks
     
    Tize likes this.
  7. lsxforo

    lsxforo Member

    Well, I found it where to modify, but Dev Team need to add it to be default style option. It's not easy to add custom font.
     
  8. ArnyVee

    ArnyVee Well-Known Member

    Is there anyway that I can add fonts that everyone can view/use?
     
  9. Digital Doctor

    Digital Doctor Well-Known Member

    Would have to be a font that comes with Windows.

    What about removing fonts ?
    or removing the entire dropdown ?
    and stripping out fonts that are cut and pasted ?
     
  10. Kerby

    Kerby Active Member

    I just removed all fonts except Arial and Helvetica out of the code ;)
     
  11. Digital Doctor

    Digital Doctor Well-Known Member

    Great job.
    Post how you did it !
    Someone will want to know how to do it too :)
     
  12. Kerby

    Kerby Active Member

    Sure, here my explanation:

    Remove Fonts

    js/tinymce/themes/xenforo/editor_template.js

    search following part in the file:
    Code:
    theme_xenforo_fonts : "Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva",

    and remove all fonts you don't want. i wanted only Arial and Helvetica (and if one has no Helvetica, switch to Arial, sans-serif, should do it automatically on Windows, but just to be sure ;)) So the part is now:
    Code:
    theme_xenforo_fonts : "Arial=arial,helvetica,sans-serif;Helvetica=helvetica,arial,sans-serif",


    Change Fonttitle
    You can change fonttitle by editing first part of a font-entry like i want to title "Arial" to "Custom Font":
    "Arial=arial,helvetica,sans-serif"
    -> "Custom Font=arial,helvetica,sans-serif"

    After the "=" you can define which fonts should taken in which priority order, like you would do in CSS/HTML.
     
    Tize, Jake Bunce and Digital Doctor like this.
  13. Digital Doctor

    Digital Doctor Well-Known Member

    Please make a new thread with a good title and post this important information there.
    Thanks !
     
    Tize likes this.
  14. Edy

    Edy Member

    How does this work with the new Xenforo?
     
    davidxd33 likes this.
  15. davidxd33

    davidxd33 Member

    For Xenforo 1.4+, I've found the file to be edited:

    /js/xenforo/bbcode_edit.js

     
    Last edited: Oct 26, 2014
  16. Tracy Perry

    Tracy Perry Well-Known Member

    Pretty sure that there is a resource out there (maybe even 2) that detail that... one specifically that is in reference to google fonts.
     

Share This Page