https://www.icyphoenix.com/viewtopic.php?f=35&t=8163
-----------------------------------
Yros
Tue 18 Oct, 2011 18:20

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 ([url=http://www.css3.info/preview/web-fonts-with-font-face/]@font-faces).

Anyway, here's the tutorial :

OPEN: ./includes/[b]bbcode.php[/b]
FIND ([size=10]it might be below [b]// Font[/b][/size])
[codeblock]if ($font === 'Arial' ||[/codeblock]
AFTER ADD ([size=10]I advise you to put it by alphabetical order so it might not be " just " after Arial[/size])
[codeblock]$font === 'Your Font' ||[/codeblock]Obviously, replace Your Font by the exact title of the font you are adding !

OPEN ./includes/[b]bbcb_mg.php[/b]
FIND
[codeblock]'L_FONT_TYPE' => $lang['Font_Type'],[/codeblock]
AFTER ADD
[codeblock]'L_FONT_YOUR_FONT => $lang['Font_Your_Font'],[/codeblock]

OPEN ./templates/default/[b]bbcb_mg.tpl[/b]
FIND
[codeblock]<option value="" class="genmed" style="font-family:Verdana;">{L_FONT_TYPE}</option>[/codeblock]
AFTER ADD
[codeblock]<option value="Your Font" class="genmed" style="font-family:'Your Font';">{L_FONT_YOUR_FONT}</option>[/codeblock]

OPEN ./languages/lang_english/[b]lang_bbcb_mg.php[/b]
FIND
[codeblock]// Font Type[/codeblock]
AFTER ADD
[codeblock]'Font_Your_Font' => 'Your Font',[/codeblock]

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][font=Your Font]*Text*[/font][/code] 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. [url=http://aelyon.eg2.fr/viewtopic.php?f=7&t=3]Link of my test with Palatino Linotype. If I find a way to add custom fonts easily, I'll let you know.

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


-----------------------------------
Informpro
Wed 19 Oct, 2011 19:39

Re: CUSTOMIZATION - How To Add Default Fonts To The Font BBcode
-----------------------------------
[code]'L_FONT_YOUR_FONT => $lang['Font_Your_Font'],[/code]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

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

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

Re: CUSTOMIZATION - How To Add Default Fonts To The Font BBcode
-----------------------------------
Dont forget the google font server. you can use that font´s directly.


