Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Font Face rare issue
Hi,
I checked this issue in lots of other font-related forums and, once I ran out of solutions, my last guess is that it’s a textpattern issue.
Site: http://www.karactermania.com/web2012/betty
Font Face is not showing font propperly in Firefox 13. Fonts are hosted in the same server, into the same folder, and I even called the CSS from outside the textpattern (into the same folder also).
I also tried the .htaccess trick but it didn’t work. Fonts are in truetype format, woff and eot format.
Any ideas?
Thanks :)
Offline
Re: Font Face rare issue
In CSS you are trying to load fonts from /fonts/*
directory. Being a relative path starting with a forward slash, it translates to:
http://www.karactermania.com/fonts/Ubuntu-C.ttf
But your fonts are not there. You are simply just linking to the wrong location. Your fonts really are in web2012
sub-directory:
http://www.karactermania.com/web2012/fonts/Ubuntu-C.ttf
Outside from fonts, you have other broken paths trying to link to some images and such too.
Some basic guides about paths:
Last edited by Gocom (2012-09-04 15:09:23)
Offline
Re: Font Face rare issue
Thanks for your answer.
I double checked what you mean and it’s true, some paths had a previous slash and some were without, so I corrected them to full paths.
Unfortunately, even corrected, Firefox 15.0 and IE9 doen’t work either.
Offline
Re: Font Face rare issue
The content-type for fonts isn’t correct. All font files you are now linking are served as text/plain.
Since you are now using absolute paths, setting Access-Control-Allow-Origin
wouldn’t be a bad idea, since anyone accessing the site without www.
subdomain will not have access to the fonts due to cross-domain restrictions. I would really recommend using relative paths, not absolute.
Furthermore, you are not supplying any style variation of the font. As you are using the font for body content, you should be supplying bold and italic versions of it, unless you are never going to use bold or italic styles (which you currently are).
Offline
Re: Font Face rare issue
Would you mind to explain this part?
Gocom wrote:
The content-type for fonts isn’t correct. All font files you are now linking are served as text/plain.
Offline
Re: Font Face rare issue
Malize wrote:
Would you mind to explain this part?
Content-type HTTP header. When accessing the font files, the header is sent text/plain. Content-type headers are used to decide what file is what, and what the client does with the file. Since the header is set as text/plain for those files, those fonts are not recognized as fonts, but served as text files and essentially ignored.
Offline
Re: Font Face rare issue
If you’re on Apache, add this in your .htaccess file and the fonts should then use the proper MIME type (from HTML5 Boilerplate):
# Webfonts
AddType application/vnd.ms-fontobject eot
AddType application/x-font-ttf ttf ttc
AddType font/opentype otf
AddType application/x-font-woff woff
Offline
Re: Font Face rare issue
Phil,
Would that interfere with anything for someone using Typekit, FontDeck, or whatever? I’m guessing not, but…
Offline
Re: Font Face rare issue
@Destry
No, as they are served from an external server (so they’d use that servers config) – this would only affect local fonts.
Last edited by philwareham (2012-09-13 07:16:22)
Offline
Re: Font Face rare issue
I tried to add this lines to the .htaccess file and the web just dissapeared. Any other ideas?
philwareham wrote:
If you’re on Apache, add this in your .htaccess file and the fonts should then use the proper MIME type (from HTML5 Boilerplate):
# Webfonts
AddType application/vnd.ms-fontobject eot
AddType application/x-font-ttf ttf ttc
AddType font/opentype otf
AddType application/x-font-woff woff
Offline
Re: Font Face rare issue
Malize wrote:
I tried to add this lines to the .htaccess file and the web just dissapeared. Any other ideas?
Did you get a 500 error?
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Online
Re: Font Face rare issue
Phil’s code requires that you have access to mod_mime module. While part of Apache 2 base package, it’s not part of the core. If the whole website turns blank, changes are, it’s not installed.
Having difficulties, not enough access to set type handler? I would advice contacting your hosting provider’s support staff. It shouldn’t take them more than few secs to set correct type handlers for your font files, or to advice how you can do it.
You could of course also try and see if some other module is installed. Like trying out mod_headers injunction with FilesMatch directive, and so forth.
Offline