CUSTOMIZATION - How To Add Default Fonts To The Font BBcode »  Show posts from    to     

Icy Phoenix


Old Support Topics - CUSTOMIZATION - How To Add Default Fonts To The Font BBcode



Yros [ Tue 18 Oct, 2011 18:20 ]
Post subject: CUSTOMIZATION - How To Add Default Fonts To The Font BBcode
Hi Folks,

I was looking at the " Font " BBcode and was wondering: " but why is there so few fonts ? " and then I asked myself: « how can I add new ones ? » so did I found it and I'll explain here how to add new fonts to your forum. Just before, I might warn that I do NOT know if it works for special fonts (those who aren't default for windows/mac). For such fonts, it might not work and you'll probably have to define the font, first, in the common.css with CSS3 Features (@font-faces).

Anyway, here's the tutorial :

OPEN: ./includes/bbcode.php
FIND (it might be below // Font)
Code: [Hide] [Select]
if ($font === 'Arial' ||

AFTER ADD (I advise you to put it by alphabetical order so it might not be " just " after Arial)
Code: [Hide] [Select]
$font === 'Your Font' ||
Obviously, replace Your Font by the exact title of the font you are adding !

OPEN ./includes/bbcb_mg.php
FIND
Code: [Hide] [Select]
'L_FONT_TYPE' => $lang['Font_Type'],

AFTER ADD
Code: [Hide] [Select]
'L_FONT_YOUR_FONT => $lang['Font_Your_Font'],


OPEN ./templates/default/bbcb_mg.tpl
FIND
Code: [Hide] [Select]
<option value="" class="genmed" style="font-family:Verdana;">{L_FONT_TYPE}</option>

AFTER ADD
Code: [Hide] [Select]
<option value="Your Font" class="genmed" style="font-family:'Your Font';">{L_FONT_YOUR_FONT}</option>


OPEN ./languages/lang_english/lang_bbcb_mg.php
FIND
Code: [Hide] [Select]
// Font Type

AFTER ADD
Code: [Hide] [Select]
'Font_Your_Font' => 'Your Font',


Some explanations: the first step define the options of the BBcode options and, then, add yours. That means that only with the first step, you can go on your forum and use the font manually by writing:
Code: [Hide]
  1. [font=Your Font]*Text*[/font] 
and it will work. The steps following are here to define the lang entry in the bbcode box.

Tried with the font Palatino Linotype and works fine. Link of my test with Palatino Linotype. If I find a way to add custom fonts easily, I'll let you know.

Ps: I couldn't post in Documentation & How-To that's why I posted it here ^^'


Informpro [ Wed 19 Oct, 2011 19:39 ]
Post subject: Re: CUSTOMIZATION - How To Add Default Fonts To The Font BBcode
Code: [Hide]
  1. 'L_FONT_YOUR_FONT => $lang['Font_Your_Font'], 
If I remember well, this part is not needed anymore.
Nice tuto anyway, maybe it'd be a good idea to define somewhere an array of fonts.


Yros [ Wed 19 Oct, 2011 20:36 ]
Post subject: Re: CUSTOMIZATION - How To Add Default Fonts To The Font BBcode
The only interrogation left behind this tuto, in fact, is " what's the purpose of the folder 'fonts' in {root}/images/fonts ?". Maybe someone will be able to answer this because I found some custom fonts in it but do they work ?


Informpro [ Wed 19 Oct, 2011 21:11 ]
Post subject: Re: CUSTOMIZATION - How To Add Default Fonts To The Font BBcode
You can use only "global" fonts (browser restriction) but if you create new one (you can do it through Windows's editor, I.E.) then you can use that dir to add them.


spydie [ Wed 19 Oct, 2011 21:51 ]
Post subject: Re: CUSTOMIZATION - How To Add Default Fonts To The Font BBcode
Dont forget the google font server. you can use that font´s directly.




Powered by Icy Phoenix