tags:

views:

41

answers:

4

I was wandering how can I link font-family in css to a font in your folder. Like PHP you can use your font in your folder.
Example Code:

CSS:

font-family: verdana;

This is what I mean:

font-family: foldername/font

Is there a code for that? or I have to use PHP to browse my own font?

A: 

It is not possible do like:

font-family: foldername/font

Fonts are read by the browser from the client machine from a specific location, you can not change it that way.

Sarfraz
+2  A: 
@font-face {
  font-family: "Kimberley";
  src: url(http://www.princexml.com/fonts/larabie/kimberle.ttf) format("truetype");
}

Just found this one on "A List Apart", haven't checked myself but this webbie is one of the most respectful resources for designers online so i guess your best shot is to give it a try.

eugeneK
This will not work as described in Internet Explorer: You'll need a different font format there. This article provides good background info: http://randsco.com/index.php/2009/07/04/p680
Pekka
right, IE expects eot-files
Thariama
A: 

You are misunderstanding this. PHP can use server-side fonts to generate an image. The font itself is never shown to the client, just the rendered results.

To be able to use a non-standard font in the user's browser, you will have to package the font along with the site.

There are various techniques to do this, all with various degrees of browser support. Here's a good article on the various available techniques, their upsides and downsides. Also check out the duplicate link.

Note that only because you paid for a font, this does not mean necessarily that you are allowed to re-distribute it embedded in a web site! Always check your font license.

Pekka
A: 

Jordan, This should help you: Using @font-face

Tomas Beke