NameSilo

Web fonts

Spaceship Spaceship
Watch

Barrucadu

Established Member
Impact
64
I noticed today that the latest Opera (well, 10 beta), Firefox, and Safari all support the @font-face CSS3 construct. As Safari supports it, so too will all Webkit browsers soon enough (if they don't already). Naturally, IE is a pain and doesn't*.

So, who else is excited for this? I fiddled around with my website and, after a bit of trial and error, got it working. Users now see my website in the fonts I chose, regardless of whether they have them installed or not. It's wonderful.

* But I don't care about IE any more. Until IE8 it actually offered to download my personal website rather than display it.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
this is really great!
could you share the code and the steps you need to do for this to the newbie web developers?
 
0
•••
To define a web font:
Code:
@font-face{
font-family: Name;
src: url(/path/to/file);
}

Then just use it as normal. For example, in my fonts.css I have a bit like this:
Code:
@font-face {
    font-family: "Body Text";
    src:          url(/fonts/TrebuchetMS.ttf);
}

body
{
    font-family: Trebuchet MS, "Body Text";
    font-size:   13px;
}
 
1
•••
To define a web font:
Code:
@font-face{
font-family: Name;
src: url(/path/to/file);
}

Then just use it as normal. For example, in my fonts.css I have a bit like this:
Code:
@font-face {
    font-family: "Body Text";
    src:          url(/fonts/TrebuchetMS.ttf);
}

body
{
    font-family: Trebuchet MS, "Body Text";
    font-size:   13px;
}

thanks for this... I will try it a bit later..... REPs+
 
0
•••
Great news mate,
Thanks.

Been waiting for such a thing to hear in compatibility.
Thanks for the code snippet as well, Will try today.
 
0
•••
Dynadot — .com TransferDynadot — .com Transfer

We're social

Domain Recover
DomainEasy — Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back