2

Possible Duplicate:
How to use web-fonts legally?
Using a custom (ttf) font in CSS

Just a simple one - wondering if I say, find a nice font to use that the user is probably not going to have installed, is there a way I can use it without it being installed on a users computer? I mean without making it an image?

Community
  • 1
  • 1
Liam Coates
  • 487
  • 6
  • 9
  • 19

4 Answers4

8

You need to use CSS's @font-face

John Conde
  • 217,595
  • 99
  • 455
  • 496
4

Yes, you can use CSS3 @font-face. You'll have to upload font files inside your server in special formats. Be sure that font's licence allows that.

You can find selection of free-to-use fonts on http://www.fontsquirrel.com/, which also provides generator for CSS properties and converts font files to needed formats.

Marius Balčytis
  • 2,601
  • 20
  • 22
2

In CSS use the following. You will need to convert your .ttf to a .eot to work with IE properly.

@font-face { 
   font-family: "SFSpeedway"; 
    /* IE */
    src: url(./fonts/fontname.eot');
    /* IE */

    /* Not IE */
    src: local("SF Speedwaystar Condensed"), url(./fonts/fontname.ttf');
    format("truetype");
    /* Not IE */
}
WhoaItsAFactorial
  • 3,538
  • 4
  • 28
  • 45
0

you can use css's @font-face if the font is available that way - keep in mind that using it affects your page loading time and this could also affect performances on slow (mobile) connections.

otherwise it's safer to have fallback fonts:

font-family: helvetica neue, arial, serif;

you could also look at cufon but I personally don't like it

Luca
  • 9,259
  • 5
  • 46
  • 59