MyBB Community Forums

Full Version: ¿How to add new fonts to the Editor?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

How can I add new fonts to the editor?

Thanks!
¿Any Idea for this?
Last Bump.

¿Anyone knows how can I do that?
The only stuff I can fine is this, line 66 of ./jscripts/editor.js:

// 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";

I don't know if it's as simple as adding the name of the font there, see if it works.
The fonts that are in the editor are fonts normally installed within a computer, factory settings and all, you can delete those but you won't be able to see the internet the same, most people use arial, so if you delete arial the fonts will look like times new roman. Yes you can use other fonts, usually most fonts that are in your computer are in every one elses, but not the ones you download from resources like dafont and so on.
(2009-10-08, 09:27 PM)MattRogowski Wrote: [ -> ]The only stuff I can fine is this, line 66 of ./jscripts/editor.js:

// 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";

I don't know if it's as simple as adding the name of the font there, see if it works.

Thanks Matt, I will try.

(2009-10-08, 09:44 PM)FullMetalBabe Wrote: [ -> ]The fonts that are in the editor are fonts normally installed within a computer, factory settings and all, you can delete those but you won't be able to see the internet the same, most people use arial, so if you delete arial the fonts will look like times new roman. Yes you can use other fonts, usually most fonts that are in your computer are in every one elses, but not the ones you download from resources like dafont and so on.

Ok, but How can I add it and where.

As in example, I add the Font Name on the editor.js with the Matt Suggestion, and the font.ttf file? where I have to upload it?
I don't think you should upload the ttf file though. What I think is that you add the font you want and the browser will recognize it.
Test

It seems to just do this:

<span style="font-family: Trebuchet MS;">Test</span>

So yeah I'm pretty sure you just add the name of it to that list.
All you do is add the insertion code, yes. Whether or not the user will see the selected font depends on if their browser has the font installed or not.
Oh! So this will be easy Smile

I will test it now and comment it Wink
Awesome!!!

It works good!!! Big Grin

Look at this post for a demo: http://www.vidaensupalabra.com.ar/t-prue...s-504.html

Thanks Matt, Scoutie, FullMetalBabe, nyunyu Big Grin