An odd problem with @font-face and stylesheet location
Permalinkfont: normal 50px TitilliumText22LThin, Arial, Helvetica, sans-serif;
will display as Arial.
I've checked everything about the CSS, and I'm convinced there's nothing wrong with it. But the problem was intractable, so I logged onto Font Squirrel and sought some insight. The answer seems to be this: Firefox will not accept absolute urls. This is what Dan at Font Squirrel was seeing:
src: url(http://www.1stdesignbrigade.com/monroe/themes/Monroe/'fonts/TitilliumText22L004-webfont.eot');
But THIS is the actual CSS in my stylesheet:
src: url(fonts/TitilliumText22L004-webfont.eot);
Here's the problem: I'm uploading my stylesheet to:
http://www.1stdesignbrigade.com/monroe/themes/Monroe/style.css.
But what Dan is seeing, based on Safari's Web Inspector, is this:
http://www.1stdesignbrigade.com/monroe/index.php/tools/css/themes/Monroe/style.css
The upshot of all this is that Firefox is seeing absolute URLs and won't accept them, so the font is defaulting to Arial. But WHY is the stylesheet being pulled from monroe/index.php/tools/css/themes/Monroe instead of simply from monroe/themes/Monroe? And if Concrete is creating a new stylesheet on the fly, why is it inserting absolute URLs?
I tried your code and got this:
Parse error: syntax error, unexpected T_VARIABLE in /home/stdesign/public_html/monroe/themes/Monroe/elements/header.php on line 18
This is what I was using, which works:
<link rel="stylesheet" type="text/css" href="<?=$this->getThemePath()?>/style.css" />
Honestly, the way you link your CSS with $getThemePath is actually how I do it, too. I just have in my notes that the way we do it is okay, but not the official way to link stylesheets. If you look at the default templates that come with C5, you'll see they use this linking method.
But that still doesn't solve the mystery (mystery to me, anyway), which is that the path to the stylesheet includes "index.php/tools/css." I've looked at other sites I designed, which thankfully don't have @font-face issues, and they're the same: there's a second stylesheet, which is apparently what Safari is finding, that is feeding absolute URLs. What gives?
My question is: where is this file coming from, and why? It's not the file that I uploaded, and it's an entirely different path. It's something that Concrete is doing, and I have no idea why, or whether or not I can prevent it.
Thanks for the input.
http://www.natural-talents.co.uk/...
That uses font face, with Titillium.
I notice too that some of the font links are relative and some are absolute, I don't have the ftp details here but will check at work tomorrow see which I use?
If I find an answer for this through Font Squirrel, I'll post it here, since you can probably make use of it too. In the meantime, try J's fix, above.
(I know its on about 8 now but I have it for bug testing)
Are you using a Mac or PC?, we are running on PC
$this->getThemePath
@font-face { font-family: 'TitilliumText22LThin'; src: url('fonts/TitilliumText22L001-webfont.eot'); src: url('fonts/TitilliumText22L001-webfont.eot?#iefix') format('embedded-opentype'), url('fonts/TitilliumText22L001-webfont.woff') format('woff'), url('fonts/TitilliumText22L001-webfont.ttf') format('truetype'), url('fonts/TitilliumText22L001-webfont.svg#TitilliumText22LThin') format('svg'); font-weight: normal; font-style: normal; }
Safari isn't picky, but with Firefox you apparently have to enclose any value in parentheses within quotes.
Oddly enough, it's still not working in Opera.
You know, I don't even bother with Opera. Probably should, but I figure if you're not on IE, Firefox or Safari, you are used to webpages looking messed up. Plus, its only like 5% of the total web audience, less than .1% will probably ever visit my sites.
Obviously, with your own preferred font. I export this through FontSquirrel and this formatting always works perfectly.
And you should link your stylesheet like this: