Not logged in. · Lost password · Register
Forum: Customising UNB Modifications and plug-ins RSS
Working with Fonts
A generic guide to tweaking stuff
Avatar
NFG #1
Member since Sep 2006 · 120 posts
Group memberships: Members
Show profile · Link to this post
Subject: Working with Fonts
A while back I created an arcade font machine, and I put it to good use on my UNB forum, displaying usernames in glorious 8x8 pixel fonts.  Recently, with the release of modern browsers like Opera 10 and Firefox 3.5, it became possible to use TTF/OTF/etc fonts in webpages.  So I put those to good use also.  Here is my guide to adding these features to your own UNB installation. 

First, the pixel fonts:

[Image: http://nfgworld.com/grafx/throwaway/new-font-2.png]

  • Simply open /unb_lib/designs/modern/post.html and replace {$post.authorName} with <img src="http://yourserver.com/path-to-NFGscript/arcade.php/y-rf/z-3/dbl-2/x-{$post.authorName}" />

Next, custom truetype fonts, using CSS:

[Image: http://nfgworld.com/grafx/throwaway/new-font-1.png]

  • Just add the following to your user.css.php file:

  1. @font-face {
  2.  font-family: Border;
  3.   src: url(/path-to/fonts/borderheaven.otf);
  4. }
  5.  
  6. .post_username {
  7.     font-family: Border, Arial, sans-serif;
  8.     font-size: 16px;
  9.     color: red;
  10.     }

Finally, remember that if your users are stuck with an older, crappier browser, all they'll see is this:

[Image: http://nfgworld.com/grafx/throwaway/new-font-3.png]

(actually the pixel fonts should work fine, though without the PNG transparency, and the CSS fonts will simply be ignored).
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
This board is powered by the Unclassified NewsBoard software, 20110527-dev, © 2003-2011 by Yves Goergen
Page created in 171.7 ms (84 ms) · 33 database queries in 137.6 ms
Current time: 2012-02-08, 09:11:27 (UTC +01:00)