CUSTOMIZATION - How To Add Default Fonts To The Font BBcode


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: [Download] [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: [Download] [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: [Download] [Hide] [Select]
'L_FONT_TYPE' => $lang['Font_Type'],

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


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

AFTER ADD
Code: [Download] [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: [Download] [Hide] [Select]
// Font Type

AFTER ADD
Code: [Download] [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: [Download] [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 ^^'

Subject: Re: CUSTOMIZATION - How To Add Default Fonts To The Font BBcode
Code: [Download] [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.

Profile PM  
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 ?

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.

Profile PM  
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.


Page 1 of 1


  
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events

   

This is a "Lo-Fi" version of our main content. To view the full version with more information, formatting and images, please click here.

Powered by Icy Phoenix based on phpBB
Generation Time: 0.1814s (PHP: 10% SQL: 90%)
SQL queries: 13 - Debug Off - GZIP Enabled