Search code examples
cssgoogle-chrometruetype

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.


Solution

  • 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.