MyBB Community Forums

Full Version: [Tutorial] Preview Fonts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
[Image: attachment.php?aid=8]
This tutorials shows you how to preview fonts in the drop-down menu while posting, so you know what they look like.

Open jscripts/editor.js

Find:

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

Replace with:

		this.fonts["Arial"] = "<span style='font-family: Arial;'>Arial</span>";
		this.fonts["Courier"] = "<span style='font-family: Courier;'>Courier</span>";
		this.fonts["Impact"] = "<span style='font-family: Impact;'>Impact</span>";
		this.fonts["Tahoma"] = "<span style='font-family: Tahoma;'>Tahoma</span>";
		this.fonts["Times New Roman"] = "<span style='font-family: Times New Roman;'>Times New Roman</span>";
		this.fonts["Trebuchet MS"] = "<span style='font-family: Trebuchet MS;'>Trebuchet MS</span>";
		this.fonts["Verdana"] = "<span style='font-family: Verdana;'>Verdana</span>";

And you're done!
My dear, this is not the right forum for posting this thread. On the other hand, why do you call it a tutorial? Huh
(2009-05-22, 12:51 PM)maatty Wrote: [ -> ]My dear, this is not the right forum for posting this thread.

Err yes, it is. (read the sticky)

(2009-05-22, 12:51 PM)maatty Wrote: [ -> ]On the other hand, why do you call it a tutorial?

It explains how to do something, therefore, by definition, it is a tutorial.
It just shows the fonts like that see in the frontpage or any other html editor,
Good Tutorial Smile
Good Tutorial
A must feature in 1.6!
waov its really small one but its useful thx
good tutorial and very useful!!

thanks!!!
We also make it for Text size preview.
		// An array of font sizes to be shown.
		this.sizes = new Object();
		
		this.sizes["xx-small"] = "<span style=\"font-size: xx-small;\">XX-Small</span>"; //this.options.lang.size_xx_small;
		this.sizes["x-small"] = "<span style=\"font-size: x-small;\">X-Small</span>"; //this.options.lang.size_x_small;
		this.sizes["small"] = "<span style=\"font-size: small;\">Small</span>"; //this.options.lang.size_small;
		this.sizes["medium"] = "<span style=\"font-size: medium;\">Medium</span>"; //this.options.lang.size_medium;
		this.sizes["large"] = "<span style=\"font-size: large;\">Large</span>"; //this.options.lang.size_large;
		this.sizes["x-large"] = "<span style=\"font-size: x-large;\">X-Large</span>"; //this.options.lang.size_x_large;
		this.sizes["xx-large"] = "<span style=\"font-size: xx-large;\">XX-Large</span>"; //this.options.lang.size_xx_large;
So simple, yet I never thought about it. Thank you very much!
Pages: 1 2