Free Web Hosting Forum
Go Back   Free Web Hosting Forum > Website Building > Web Design and HTML
Reload this Page How to use @font-face CSS rule pointing to font url?!
Reply
 
Thread Tools Display Modes
(#1 (permalink))
Old
Snooper's Avatar
Junior Member
Snooper is on a distinguished road
 
Posts: 5
Join Date: May 2008
Arrow How to use @font-face CSS rule pointing to font url?! - 10-04-2010, 11:12 PM

Hi guys,
I need a little push with this one...
I'd like to use some non-standard font on my website, but I'm not sure how to do it correctly. It's always possible that something goes wrong when you mess with it. There's couple of things involved in it that I don't know answers, so I need help...

...mostly I'd like to know does my server (server22.000webhost.com) sends EOT and TTF font files as binary files, so they will be clear for all users, and if not how can I add .htaccess file with proper code inside to fix it...

...am I allowed to upload .htaccess file anyway, and way I can't find any on my server any more, I remember some time before, on my prior website, there was such files in the public_html folder?!

That will be enough for this time, I think. Thanks in advance... Bye.

S.


***
We need every single one of you to build a better world. Stay cool my friend!
Reply With Quote
Sponsored Links
(#2 (permalink))
Old
drums's Avatar
Senior Member
drums is on a distinguished road
 
Posts: 579
Join Date: Aug 2010
Location: Oz
Default 10-06-2010, 12:11 AM

Hi Snooper,

First of all, any custom font solution is currently not supported by all browsers, so you will have problems unless all of your users are using a particular browser type.

1) Yes - TTF and EOT should be served as binary files, however you can always force a particular mime-type for those files in htaccess using:

Code:
AddType application/x-font-ttf .ttf
The only problem is not all browsers will necessarily recognise this mimetype and know what to do.

2) Yes you can upload a .htaccess file. It may not be in your public_html directory already. In that case, you can upload one with any FTP client. If you have problems doing that, you can upload ".htaccess.txt" and then rename it to .htaccess using FTP or one of the File Managers in cpanel.

drums
Reply With Quote
(#3 (permalink))
Old
Snooper's Avatar
Junior Member
Snooper is on a distinguished road
 
Posts: 5
Join Date: May 2008
Default 10-06-2010, 08:03 AM

Thanx for advice drums,
I haven't idea of upload anything if not necessary. That's way I've asked does my server sends those font files as binary files. Now I believe it is, so no need to upload .htaccess to the server, right?!

When browsers matters it's supported by:
- IE4+ only .eot fonts,
- FF3.5+ .ttf .ott and woff
- Chrome 4.0 .ttf .otf
- Opera 10 .ttf .otf and svg
- Safari 3.1 .ttf .otf and svg
- Netscape 4 but discontinued by Netscape Navigator 6+

So, the only problem is this last one on the list. When IE matters .eot should be listed as first source file (before .ttf and others) in @font-face rule, and thing will work... also let's be honest, according to statistics 85% of surfers uses Firefox and IE.

thanx a lot,

S.


***
We need every single one of you to build a better world. Stay cool my friend!
Reply With Quote
(#4 (permalink))
Old
drums's Avatar
Senior Member
drums is on a distinguished road
 
Posts: 579
Join Date: Aug 2010
Location: Oz
Default 10-08-2010, 02:52 AM

Hi Snooper,

You're right about the majority of users being FF and IE. Chrome is gaining ground too, but as you say, @font-face works with Chrome using TTF and OTF. If you have problems with IE, you can always use some of the IE CSS kludges to create tags only IE will see.

It might not matter for you, but @font-face will break your CSS compliance and validation.

Good luck!

drums
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.5.2
vBulletin Skin developed by: vBStyles.com