[2.0.6] Font Face BBCode

The cleanup is complete. This forum is now read only.

Rating:

Excellent!
16
52%
Very Good
11
35%
Good
3
10%
Fair
0
No votes
Poor
1
3%
 
Total votes: 31

IamHolly
Registered User
Posts: 75
Joined: Fri Dec 31, 2004 12:08 pm

Post by IamHolly » Thu Apr 14, 2005 11:34 am

Is there a way to add a font that others dont have on their PC?? Id like to add fonts of my choice that they can use that they may not have on their computer.


Thanks!


Holly

Herbalite
Registered User
Posts: 205
Joined: Wed Apr 10, 2002 8:11 am
Location: South East Asia

Post by Herbalite » Thu Apr 14, 2005 11:43 pm

IamHolly wrote: Is there a way to add a font that others dont have on their PC?? Id like to add fonts of my choice that they can use that they may not have on their computer.


Thanks!


Holly
Unfortunately there is no standard way to offer fonts for different browsers and OS to automatically download and use.

You could offer fonts for usual downlaod on your website, but you have to watch out for copyright issues and that users of different OS'es can use your fonts.
In the interest of cutting costs, the light at the end of the tunnel has been switched off...

IamHolly
Registered User
Posts: 75
Joined: Fri Dec 31, 2004 12:08 pm

Post by IamHolly » Fri Apr 15, 2005 1:19 pm

Thank you :)

I have added some of my fronts from my Font folder.. I must be doing something wrong because some are not working... Those are in Bold... Can someone help me as to what I am typing in wrong?


$lang['Font_style'] = 'Font Face';
// Add/remove your font-faces for this language here into the array
$lang['font']['black'] = '\'Arial Black\'';
$lang['font']['arial'] = 'Arial, sans-serif';
$lang['font']['comic'] = '\'Comic Sans MS\', sans-serif';
$lang['font']['courier'] = 'Courier, monospace';
$lang['font']['plain'] = 'Georgia';
$lang['font']['bold'] = 'Georgia, Bold';
$lang['font']['italic'] = 'Georgia, Bold Italic';
$lang['font']['italic1'] = 'Georgia, Italic';

$lang['font']['tahoma'] = 'Tahoma, Verdana';
$lang['font']['times'] = 'Times New Roman, serif';
$lang['font']['script'] = 'Script, serif';


Thank you!

Herbalite
Registered User
Posts: 205
Joined: Wed Apr 10, 2002 8:11 am
Location: South East Asia

Post by Herbalite » Fri Apr 15, 2005 2:05 pm

IamHolly wrote: Thank you :)

I have added some of my fronts from my Font folder.. I must be doing something wrong because some are not working... Those are in Bold... Can someone help me as to what I am typing in wrong?

The typing is OK, however browser have a problem with your font names.

If you want Italic, Bold, etc, you need to do that with the appropriate BBCode. The problem in this case are the CSS font definitions and the current MOD. I hope to have an upgrade ready soon, that hopefully makes a few things easier

The exact problem is that if you enter a fontname consisting of several words, we are required to put those names into (single) quotes. E.g 'Times New Roman', serif. However that is not working at the moment as it should, and certain browsers might get confused by it.


So for the moment you need to restrict the chocies a bit.
In the interest of cutting costs, the light at the end of the tunnel has been switched off...

IamHolly
Registered User
Posts: 75
Joined: Fri Dec 31, 2004 12:08 pm

Post by IamHolly » Fri Apr 15, 2005 2:33 pm

Thanks..

I see my problem with the Georgia font is it didnt have the *family* name to it
ITS working now though :) YEAH!

As far as the Script font, Im clueless why its not working.. :)

Either way its a GREAT MOD and I AM LOVING IT!! SO THANK YOU!

IamHolly
Registered User
Posts: 75
Joined: Fri Dec 31, 2004 12:08 pm

Post by IamHolly » Fri Apr 15, 2005 4:45 pm

Just curious... My mind racing with thoughts here about these fonts..

IS there a possible way to create a folder for Fonts? Then to upload your fonts to the folder and tell the drop down menu where to look.. so when users go to the drop down the list of fonts are already there... This way with the fonts being downloaded onto the server they are there for all members to use..

Herbalite
Registered User
Posts: 205
Joined: Wed Apr 10, 2002 8:11 am
Location: South East Asia

Post by Herbalite » Fri Apr 15, 2005 5:31 pm

IamHolly wrote: Just curious... My mind racing with thoughts here about these fonts..

IS there a possible way to create a folder for Fonts? Then to upload your fonts to the folder and tell the drop down menu where to look.. so when users go to the drop down the list of fonts are already there... This way with the fonts being downloaded onto the server they are there for all members to use..

Could be done, but I believe that is a bit too much work for the server, for little reward.

Here is why:
The server would need to read out yet another directory and check all files out. Many fonts do not have matching font names vs. filename. So that means the program needs to read out the font names from within the font files. That might look innocent enough, but some font files have a size of a few megabytes. That's a bit much for the server side.

For the site admin, it may mean to provide instructions on how to install fonts on different OS'es. Well McIntosh (pre X) and Windows are easy enough, but we can't assume every Linux user has root privileges to install fonts, nor the understanding on how to add fonts to their X11. personally, I wouldn't want to take on that burden to educate people.

The proper way to do fonts is described in the CSS2 definition. The caveat though is that not all current browser support it.

Consider the following CSS rule

Code: Select all

 @font-face {
        font-family: "Robson Celtic";
        src: url("http://site/fonts/rob-celt")
      }
It's easy enough to understand. The fonts themselves need to be in a SVG subformat (SVGT or SVGB), so they can be downloaded to any device that uses fonts.

CSS has many neat features. If they just were available on todays browsers.

Here 2 links to the CSS2 and SVG font stuff.

http://www.w3.org/TR/SVGMobile/#sec-fonts
http://www.w3.org/TR/1998/REC-CSS2-19980512/fonts.html
In the interest of cutting costs, the light at the end of the tunnel has been switched off...

IamHolly
Registered User
Posts: 75
Joined: Fri Dec 31, 2004 12:08 pm

Post by IamHolly » Fri Apr 15, 2005 6:26 pm

Wow thank you! Will review it all

Also, can you tell me how I would add a download to a post?

Such as this download for the Font MOD

IF all else fails I can just put a topic for members to download the fonts I am using in the Forum.> If they would like they can download it..
Would I need to install them in a certain place?

Thank you!!!

Herbalite
Registered User
Posts: 205
Joined: Wed Apr 10, 2002 8:11 am
Location: South East Asia

Post by Herbalite » Fri Apr 15, 2005 11:29 pm

IamHolly wrote: Wow thank you! Will review it all

Also, can you tell me how I would add a download to a post?

Such as this download for the Font MOD

IF all else fails I can just put a topic for members to download the fonts I am using in the Forum.> If they would like they can download it..
Would I need to install them in a certain place?

Thank you!!!

The easiest way to handle this would be to install the Attachment MOD.
In the interest of cutting costs, the light at the end of the tunnel has been switched off...

IamHolly
Registered User
Posts: 75
Joined: Fri Dec 31, 2004 12:08 pm

Post by IamHolly » Sat Apr 16, 2005 12:22 am

Great thanks :)

Thanks for all your help actually!! Very much appreciated.. :D

sarah1976
Registered User
Posts: 3
Joined: Fri Jan 28, 2005 7:08 pm

Post by sarah1976 » Mon May 09, 2005 12:37 am

I love this mod!
I finally got it to work, but I have one small issue that I would love to have help with.

In my text drop down box, with the template I have, the text is white, which on a white background is pretty darn hard to see. Is there a way I can get that text to turn black so that I can see whats being highlighted?

Thanks!

Herbalite
Registered User
Posts: 205
Joined: Wed Apr 10, 2002 8:11 am
Location: South East Asia

@sarah1976

Post by Herbalite » Mon May 09, 2005 1:08 pm

In the template you are using find the HTML select tag for the fontsize. Check if there are is an HTML attribute starting with style="...". If there is, copy the text entire HTML attribute to the one used for the font face select. See if that select box is now the way you like it is now OK.

You might also need to copy the class="..." attribute the same way as outlined above.

Hope that helps
In the interest of cutting costs, the light at the end of the tunnel has been switched off...

F106
Registered User
Posts: 3
Joined: Fri Aug 05, 2005 2:28 pm
Location: USA

Post by F106 » Fri Aug 05, 2005 2:53 pm

Hi, I'm looking for some help on an issue with the drop down menu for this MOD. All the font codes work for me and I have a drop-down menu. But the menu field is blank. I have read this entire thread trying to figure out the fix. I don't think it is an issue with the the background color because the drop-down is narrow as if were void of letter/words.

My best guess is that the fix is in templates/subSilver/posting_body.tpl in this line of the code

Code: Select all

&nbsp;Font Type:<select name="addbbcodefontface" onchange="bbfontstyle('[font=' + this.form.addbbcodefontface.options[this.form.addbbcodefontface.selectedIndex].value + ']', '[/font]');this.selectedIndex=0;" onmouseover="helpline('n')" accesskey="n"> 
                  <option value="0" class="genmed" selected="selected">{L_FONT_STYLE}</option> 
                  <!-- BEGIN font_styles --> 
                    <option value="{font_styles.L_FONTNAME}" class="genmed" style="font-family:{font_styles.L_FONTNAME};">{font_styles.L_FONTNAME}</option> 
                  <!-- END font_styles --> 
               </select>
more specifically this line

Code: Select all

<option value="{font_styles.L_FONTNAME}" class="genmed" style="font-family:{font_styles.L_FONTNAME};">{font_styles.L_FONTNAME}</option>
The font types I have inserted into language/lang_english/lang_main.php are

Code: Select all

$lang['font']['arial'] = 'Arial, sans-serif';
$lang['font']['courier'] = 'Courier, Courier New, monospace';
$lang['font']['times'] = 'Times New Roman, serif';
$lang['font']['tahoma'] = 'Tahoma, Verdana'; 
$lang['font']['verdana'] = 'Verdana, sans-serif';
$lang['font']['helvetica'] = 'Helvetica, sans-serif';
$lang['font']['century'] = 'Century Gothic, sans-serif';
$lang['font']['georgia'] = 'Georgia, sans-serif';
$lang['font']['comic'] = 'Comic Sans MS, sans-serif';
If I could could just have a how-to example of just one font type inserted into the menu field I know I could plug in the rest.

Thanks in advance for your help!

Herbalite
Registered User
Posts: 205
Joined: Wed Apr 10, 2002 8:11 am
Location: South East Asia

Post by Herbalite » Sat Aug 06, 2005 12:28 am

F106

If I understand you correctly, then there are no entries in the drop-down list. If that is so, then make sure check all the code that goes into posting.php.
In the interest of cutting costs, the light at the end of the tunnel has been switched off...

F106
Registered User
Posts: 3
Joined: Fri Aug 05, 2005 2:28 pm
Location: USA

Post by F106 » Sat Aug 06, 2005 4:04 am

Thanks for responding. As you suggested I checked; the code changes for posting.php file are there...

Code: Select all

	'L_BBCODE_F_HELP' => $lang['bbcode_f_help'],
	'L_BBCODE_N_HELP' => $lang['bbcode_n_help'],
	'L_EMPTY_MESSAGE' => $lang['Empty_message'],

	'L_FONT_STYLE' => $lang['Font_style'],
	'L_FONT_COLOR' => $lang['Font_color'],
and

Code: Select all

'S_HIDDEN_FORM_FIELDS' => $hidden_form_fields)
);

while( list($key, $font) = each($lang['font']) )
{
	$template->assign_block_vars ('font_styles', array(
		'L_FONTNAME' => $font
	));
}
//
// Poll entry switch/output
//
If it makes any difference, the same problem is in private message posting as well; the drop down (select) menu is there but the field is blank.

Post Reply

Return to “[2.0.x] MOD Database Cleanup”