71GA
71GA

Reputation: 1391

font-family not working for true-type fonts

In my CSS file I first include my true type font file like this:

@font-face {font-family: "ss5"; src: url(../fonts/sans_serif/paneuropa-b.ttf);}

And then use it like this:

font-family: ss5;

But for some reason this only works in Linux and on Chrome, while it doesn't work on Windows Chrome... Weird, because my .ttf file is located on my server. Any Idea why this is so? I need this to work on all browsers.

Here is my webpage if anyone would like to check it out.

Upvotes: 0

Views: 1256

Answers (2)

thiagobraga
thiagobraga

Reputation: 1561

I receive a 404 error when I request the font:

http://ziga-lausegger.com/fonts/sans_serif/paneuropa-b.ttf

I've tried to access the folder path in Chrome, and it worked. You should block directory listing in your server configuration. You can check that paneuropa-b.ttf doesn't exist in directory listing.

http://ziga-lausegger.com/fonts/sans_serif/

And like @aldo said, "guess is you have the font installed locally on Linux", because of this only worked on Linux.

Upvotes: 1

Sarower Jahan
Sarower Jahan

Reputation: 1495

This is not valid way to use font face. You have to generate font using ttf, woff,eot,svg to get all browser and OS. Where you used only ttf. Generate your font then use.

You can use these sites below to generate font as ttf,woff,eot and svg.

  1. http://www.fontsquirrel.com
  2. http://www.font2web.com/ etc

Upvotes: 0

Related Questions