MyBB Community Forums

Full Version: Adding new fonts?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How do I add new fonts to the editor? And for text size, how to turn small, x small, xx small and medium etc into numbers?
In the Style & Templates.
(2009-10-21, 06:38 PM)General-Promotion Wrote: [ -> ]In the Style & Templates.

Where do you do it there...?? Undecided

You need to edit editor.js to add new fonts. From line 66:

// Defines an array of fonts to be shown in the font drop down.
this.fonts = new Object();
this.fonts["Arial"] = "Arial";
this.fonts["Courier"] = "Courier";
this.fonts["Impact"] = "Impact";
this.fonts["Tahoma"] = "Tahoma";
this.fonts["Times New Roman"] = "Times New Roman";
this.fonts["Trebuchet MS"] = "Trebuchet MS";
this.fonts["Verdana"] = "Verdana";

Copy the layout of one of those lines and put the name of the font you want to add.

For the size names, from line 154 of global.lang.php:

$l['editor_size_xx_small'] = "XX Small";
$l['editor_size_x_small'] = "X Small";
$l['editor_size_small'] = "Small";
$l['editor_size_medium'] = "Medium";
$l['editor_size_large'] = "Large";
$l['editor_size_x_large'] = "X Large";
$l['editor_size_xx_large'] = "XX Large";

Edit appropriately.
where to find da glob.lang.php file?
./inc/languages/*language*/global.lang.php
(2009-10-21, 09:05 PM)MattRogowski Wrote: [ -> ]./inc/languages/*language*/global.lang.php

ok thanks, having trouble turning xx small etc into numbers.

I wrote
Quote:$l['editor_size_1'] = "1";

and its shown as undefined.
No only change the actual value, not the variable, otherwise it won't work.

$l['editor_size_xx_small'] = "1";
$l['editor_size_x_small'] = "2";
$l['editor_size_small'] = "3";
$l['editor_size_medium'] = "4";
$l['editor_size_large'] = "5";
$l['editor_size_x_large'] = "6";
$l['editor_size_xx_large'] = "7";

Like that.
thanks it worked...