Reputation: 11
I am trying to import a font using the CSS below, it works in Firefox, and IE, but not in Chrome is not supporting. Can you help me on making it work in Chrome too?
@font-face {
font-family: "Fontin-Bold";
src: url(fonts/Fontin-Bold.ttf);
src: url(fonts/Fontin-Bold.eot);
}
Upvotes: 0
Views: 382
Reputation: 16269
Different browsers have different needs, and fonts are no exception. Here's a full example:
CSS
@font-face {
font-family: 'UbuntuBold';
src: url('ubuntu-bold-webfont.eot');
src: url('ubuntu-bold-webfont.eot?#iefix') format('embedded-opentype'),
url('ubuntu-bold-webfont.woff') format('woff'),
url('ubuntu-bold-webfont.ttf') format('truetype'),
url('ubuntu-bold-webfont.svg#UbuntuBold') format('svg');
font-weight: normal;
font-style: normal;
}
You are better of using a Font-Face Generator like: Font Squirrel
Additionally, you need to set an .htaccess on your fonts folder with the following types:
AddType application/vnd.ms-fontobject .eot
AddType font/ttf .ttf
AddType font/otf .otf
EDITED:
To better explain the different font formats VS different browsers:
Upvotes: 1