Font Style Selector

Any and all modifications I have created for phpBB3 will be listed here and support will be provided.
Locked
DavidIQ
Site Admin
Posts: 605
Joined: Thu Sep 07, 2006 4:31 pm
Location: Earth
Contact:

Font Style Selector

Post by DavidIQ »

To add a Font Style type selector, like I have here, do the following:

Open styles/prosilver/templates/posting_buttons.html

Find:

Code: Select all

	<select name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.form.addbbcode20.selectedIndex = 2;" title="{L_BBCODE_F_HELP}">
		<option value="50">{L_FONT_TINY}</option>
		<option value="85">{L_FONT_SMALL}</option>
		<option value="100" selected="selected">{L_FONT_NORMAL}</option>
		<option value="150">{L_FONT_LARGE}</option>
		<option value="200">{L_FONT_HUGE}</option>
	</select>
Add after:

Code: Select all

	<select name="addbbcode22" onchange="bbfontstyle('[font=' + this.options[this.selectedIndex].value + ']', '[/font]');this.selectedIndex = 0;" title="Font type: [font=Arial]Your Text[/font]">
		<option value="Arial" selected="selected">Arial</option>
		<option value="Times New Roman">Times New Roman</option>
		<option value="Courier">Courier</option>
		<option value="Comic Sans MS">Comic Sans MS</option>
		<option value="Georgia">Georgia</option>
	</select>
Then you need to create a custom BBCode in ACP. Go to the Posting tab and click on "Create a new BBCode".

For BBCode usage enter:

Code: Select all

[font={SIMPLETEXT}]{TEXT}[/font]
For HTML Replacement enter:

Code: Select all

<span style="font-family: {SIMPLETEXT};">{TEXT}</span>
Leave the rest of the options alone and save. This is a quick way to add the drop-down without any provision for languages. You can add other options to the list as well but keep in mind that common fonts in Windows may not necessarily be common on a Mac or other OS and vice-versa in which case the text will be displayed in regular system-designated font. For a quick guide on this subject see:
http://www.ampsoft.net/webdesign-l/WindowsMacFonts.html

Marcin
Posts: 2
Joined: Mon Dec 21, 2009 12:04 pm

Re: Font Style Selector

Post by Marcin »

I guess it is a small mistake. Should be so

Code: Select all

    <select name="addbbcode22" onchange="bbfontstyle('[font=' + this.options[this.selectedIndex].value + ']', '[/font]');this.selectedIndex = 0;" title="Font type: [font=Arial]Your Text[/font]">
      <option value="Font" selected="selected">Font</option>
      <option value="Arial">Arial</option>
      <option value="Times New Roman">Times New Roman</option>
      <option value="Courier">Courier</option>
      <option value="Comic Sans MS">Comic Sans MS</option>
      <option value="Georgia">Georgia</option>
    </select> 
If that:

Code: Select all

<option value="Arial" selected="selected">Arial</option> 
then you can not select Arial, or I am mistaken? :)

DavidIQ
Site Admin
Posts: 605
Joined: Thu Sep 07, 2006 4:31 pm
Location: Earth
Contact:

Re: Font Style Selector

Post by DavidIQ »

That's just the default. ;)

beeboard
Posts: 4
Joined: Sat Apr 30, 2011 1:25 pm

Re: Font Style Selector

Post by beeboard »

Hey guys,

just poking around a little bit tonight, and was interested if there is a way to add fonts to this mod, that could be used universally and not just through my machine. I'm a bit unaware of some compatibility issues, etc...

DavidIQ
Site Admin
Posts: 605
Joined: Thu Sep 07, 2006 4:31 pm
Location: Earth
Contact:

Re: Font Style Selector

Post by DavidIQ »

If you assign a font to text that the machine the page is accessed through does not have the text will be displayed using the machine's default text.

Clair
Posts: 9
Joined: Sat Jun 25, 2011 1:43 am

Re: Font Style Selector

Post by Clair »

DavidIQ wrote:To add a Font Style type selector, like I have here, do the following:

Open styles/prosilver/templates/posting_buttons.html

Find:

Code: Select all

	<select name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.form.addbbcode20.selectedIndex = 2;" title="{L_BBCODE_F_HELP}">
		<option value="50">{L_FONT_TINY}</option>
		<option value="85">{L_FONT_SMALL}</option>
		<option value="100" selected="selected">{L_FONT_NORMAL}</option>
		<option value="150">{L_FONT_LARGE}</option>
		<option value="200">{L_FONT_HUGE}</option>
	</select>
Add after:

Code: Select all

	<select name="addbbcode22" onchange="bbfontstyle('[font=' + this.options[this.selectedIndex].value + ']', '[/font]');this.selectedIndex = 0;" title="Font type: [font=Arial]Your Text[/font]">
		<option value="Arial" selected="selected">Arial</option>
		<option value="Times New Roman">Times New Roman</option>
		<option value="Courier">Courier</option>
		<option value="Comic Sans MS">Comic Sans MS</option>
		<option value="Georgia">Georgia</option>
	</select>
Then you need to create a custom BBCode in ACP. Go to the Posting tab and click on "Create a new BBCode".

For BBCode usage enter:

Code: Select all

[font={SIMPLETEXT}]{TEXT}[/font]
For HTML Replacement enter:

Code: Select all

<span style="font-family: {SIMPLETEXT};">{TEXT}</span>
Leave the rest of the options alone and save. This is a quick way to add the drop-down without any provision for languages. You can add other options to the list as well but keep in mind that common fonts in Windows may not necessarily be common on a Mac or other OS and vice-versa in which case the text will be displayed in regular system-designated font. For a quick guide on this subject see:
http://www.ampsoft.net/webdesign-l/WindowsMacFonts.html
thank u so much u have guts to run this forum david..........

Locked