Custom font

Get help developing custom BBCodes or request one.
Post Reply
User avatar
Going4Quests
Registered User
Posts: 77
Joined: Sat Sep 07, 2013 7:34 am

Custom font

Post by Going4Quests »

Hey,

I would like to use the Kingthings petrock font in a phpbb forum i am making. I only don't know how to get it working! I would like to see it working as a bb-code "[rs=*fontsize*]text with font[/rs]

Can any of you look into this? :D
User avatar
Arty
Former Team Member
Posts: 16654
Joined: Wed Mar 06, 2002 2:36 pm
Name: Vjacheslav Trushkin
Contact:

Re: Custom font

Post by Arty »

Moved to BBCode forum where you can find examples of custom bbcodes that should help you with your issue.

From CSS side you'll need to add that font via @font-face. Otherwise visitors will not see text with that font because they don't have it installed on their computers. Go to page where you can download it, click "Webfont Kit" menu and follow instructions there.
Vjacheslav Trushkin / Arty.
Free phpBB 3.1 styles | New project: Iconify - modern SVG framework
User avatar
Going4Quests
Registered User
Posts: 77
Joined: Sat Sep 07, 2013 7:34 am

Re: Custom font

Post by Going4Quests »

I put the fonts in prosilver/theme/fonts with a new css file "rsfont" which is being included at the stylesheet forum. (the srcs are ofc linking to fonts/*names*) I refreshed everything except the imageset and i purged the cache but sadly it didn't work.

Here is the code of rsfonts.css

Code: Select all

@font-face {
    font-family: 'kingthings_petrockregular';
    src: url('fonts/Kingthings_Petrock-webfont.eot');
    src: url('fonts/Kingthings_Petrock-webfont.eot?#iefix') format('embedded-opentype'),
         url('fonts/Kingthings_Petrock-webfont.woff') format('woff'),
         url('fonts/Kingthings_Petrock-webfont.ttf') format('truetype'),
         url('fonts/Kingthings_Petrock-webfont.svg#kingthings_petrockregular') format('svg');
    font-weight: normal;
    font-style: normal;

}
The stylesheet.css in the same folder:

Code: Select all

/*  phpBB 3.0 Style Sheet
    --------------------------------------------------------------
	Style name:		proSilver
	Based on style:	proSilver (this is the default phpBB 3 style)
	Original author:	subBlue ( http://www.subBlue.com/ )
	Modified by:		
	
	Copyright 2006 phpBB Group ( http://www.phpbb.com/ )
    --------------------------------------------------------------
*/

@import url("common.css");
@import url("links.css");
@import url("content.css");
@import url("buttons.css");
@import url("cp.css");
@import url("forms.css");
@import url("tweaks.css");
@import url("colours.css");
@import url("shoots_boarders.css");
@import url("rsfonts.css");
The files are in a submap next to images in theme at the map fonts.

This is my BBcode:

Code: Select all

[rs]{TEXT}[/rs]

Code: Select all

<span style="font-family: kingthings_petrockregular;">{TEXT}</span>
Can someone help me further with this? :oops:
User avatar
Rahber
Former Team Member
Posts: 2720
Joined: Tue Feb 12, 2008 3:39 pm
Location: Pakistan
Name: Rahber
Contact:

Re: Custom font

Post by Rahber »

Everything looks good except relative paths to fonts. Add {T_THEME_PATH}/ because in prosilver the css is displayed using style.php so with your current code its looking for a font directory in the root phpBB directory,

Code: Select all

@font-face {
    font-family: 'kingthings_petrockregular';
    src: url('{T_THEME_PATH}/fonts/Kingthings_Petrock-webfont.eot');
    src: url('{T_THEME_PATH}/fonts/Kingthings_Petrock-webfont.eot?#iefix') format('embedded-opentype'),
         url('{T_THEME_PATH}/fonts/Kingthings_Petrock-webfont.woff') format('woff'),
         url('{T_THEME_PATH}/fonts/Kingthings_Petrock-webfont.ttf') format('truetype'),
         url('{T_THEME_PATH}/fonts/Kingthings_Petrock-webfont.svg#kingthings_petrockregular') format('svg');
    font-weight: normal;
    font-style: normal;

}
User avatar
Going4Quests
Registered User
Posts: 77
Joined: Sat Sep 07, 2013 7:34 am

Re: Custom font

Post by Going4Quests »

Thanks! It worked :D
Post Reply

Return to “Custom BBCode Development and Requests”