How to call a font in CSS from font uploaded to web server?

Primary tabs

4 posts / 0 new
Last post
damian's picture
Offline
Joined: 13 Oct 2013 - 1:44am
How to call a font in CSS from font uploaded to web server?
0

I've got this In my CSS.

@font-face {
font-family: '20th Century Font';
src: url(ftp://www.mysite.com/forum/fonts/20THBOLD.TTF);
}

Have tried calling it with all different names, but it refuses to show. How do I find the name I need to call in CSS. NexusFont tells me the postscriptname is 20thCenturyFontBold, but that doesn't work. I've tried many combinations...

Do I need to add something to the header as well to force the remote computer to download it?

damian's picture
Offline
Joined: 13 Oct 2013 - 1:44am
0

sorry. It's http, not ftp. Still doesn't work. Any ideas?

damian's picture
Offline
Joined: 13 Oct 2013 - 1:44am
0

hmmm.. It's working now. Not sure what the deal was. Thanks

Found out the problem. I was missing www in front of the .ttf file link.

TG's picture
TG
Offline
Joined: 8 May 2003 - 2:39pm
0

You should use relative links instead of absolute ones. Otherwise some browsers might not show the font.
Also, the internal font name is irrelevant. What you put after "font-family:" is totally up to you. It's just a reference to the linked file.