PDA

View Full Version : css - file for font



Moh
03-08-2008, 03:05 PM
How do you use a custom font for for your style for a page?
So the font is:
FontFile.ttf

L?KE
03-08-2008, 03:35 PM
Didn't think you could, unless the viewer has that font.

PHP GD?

iTech
03-08-2008, 03:41 PM
GD is for images I do believe.
Jack you can't, I don't think?

Moh
03-08-2008, 04:11 PM
Didn't think you could, unless the viewer has that font.

PHP GD?


GD is for images I do believe.
Jack you can't, I don't think?
The reason im doing this is because GD was playing up xD

Oh well, ill just use Verdana. Its as good as any.

Blob
03-08-2008, 04:14 PM
CSS3 has this in.

Jahova
03-08-2008, 04:29 PM
Their were many way, most of the known ones are not unsupported.
Your best bet nowadays is GD, which needs to be installed onto your server.

RichardKnox
03-08-2008, 04:43 PM
use sIFR. It's the best solution as it is also SE friendly as opposed to it being images it appears to the search engines as plain text.

L?KE
03-08-2008, 08:41 PM
GD is for images I do believe.
Jack you can't, I don't think?

Yes, it is.
So you'd create a block of text as an image...

iTech
03-08-2008, 08:53 PM
Yes, it is.
So you'd create a block of text as an image...

That's a mistake on my behalf. :)

craigg.
03-08-2008, 10:32 PM
In the space of two seconds to type "css custom font" in google I have found your answer.



Embed a Custom Font in Internet Explorer

To embed a custom font, let me show you the code first, and then explain what you have to do to get the code to work correctly.

I advise you to place this code between the <style type="text/css"> </style> tag set in the head of the document.


@font-face {
font-family: newfontname;
font-style: normal;
src: url(newfontname.eot);
}

You have now defined a new font-face that you can use throughout your CSS document like any other font, but before this takes effect, you must encode and upload the .eot file which stands for Embedded Open Type format. To do this, download Microsoft's Web Embedding Font Tool at http://www.microsoft.com/typography/WEFT.mspx

In your code, you will also need to change "newfontname" to the name of your font, and you can include a path to find the font.

DUB
03-08-2008, 11:54 PM
But then your only limited to it working in IE

Moh
04-08-2008, 08:21 AM
In the space of two seconds to type "css custom font" in google I have found your answer.
And whats a .eot?

craigg.
04-08-2008, 12:38 PM
Embedded Open Type format


It says at the bottom of my post :)
http://www.albinoblacksheep.com/text/font


It may work in firefox, I haven't tried. On that link it also says how to work it for netscape.

Want to hide these adverts? Register an account for free!