Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-21-2011, 11:13 PM   PM User | #1
Kingcripple
New Coder

 
Join Date: Nov 2011
Posts: 12
Thanks: 1
Thanked 0 Times in 0 Posts
Kingcripple is an unknown quantity at this point
@font-face issues

I'm not a web designer by any stretch of the imagination, but I operate a horror-themed website as a hobby. I've managed to a lot of minor alteration on my own, but I'm having difficulty with one particular area: a custom font. I have the font on my server, but when I try to implement it on my site, specifically with my menu and title of content, I can't seem to get it to work.

I've placed this code within my default.CSS. I've verified that the destination is accurate yet I can't use the font on my website. Any help would be greatly appreciated.

Code:
@font-face { 
 font-family: feastofflesh; 
 src: url ('http://kingcripple.com/degradationofmorality/fonts/feastofflesh.eot'); 
}
Kingcripple is offline   Reply With Quote
Old 11-22-2011, 12:05 AM   PM User | #2
Frankie
Regular Coder

 
Join Date: Sep 2011
Posts: 286
Thanks: 3
Thanked 33 Times in 33 Posts
Frankie is an unknown quantity at this point
That can have several causes. If you would have the lot online, that would make it much easier to diagnose.
__________________
Frank

How to: Target IE in, Position in, Center in, Create a Fixed ('Sticky') Footer with, and Create a Drop-Down/Fly-Out Menu with CSS: Website Laten Maken Amsterdam.
Frankie is offline   Reply With Quote
Old 11-22-2011, 07:44 AM   PM User | #3
RNorskov
New Coder

 
Join Date: Nov 2011
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
RNorskov is an unknown quantity at this point
Ud the code you write is the ondt change you have done, you will also need change the font where you want it to be. But a little more detail and it will be much easier to help you
RNorskov is offline   Reply With Quote
Old 11-22-2011, 08:46 PM   PM User | #4
resdog
Regular Coder

 
Join Date: Aug 2011
Location: U.S.A.
Posts: 233
Thanks: 2
Thanked 48 Times in 48 Posts
resdog is on a distinguished road
try putting feastofflesh in quotes.
__________________
WordPress Designer and theme developer. KlongDesigns - helping bloggers and non-technical folks claim their space on the internet.
resdog is offline   Reply With Quote
Old 11-22-2011, 08:55 PM   PM User | #5
Kingcripple
New Coder

 
Join Date: Nov 2011
Posts: 12
Thanks: 1
Thanked 0 Times in 0 Posts
Kingcripple is an unknown quantity at this point
Here's my website – it's currently a work in progress: www.kingcripple.com

I've tried to utilize my custom font, feastofflesh, at the following locations on my website. I've used the code below, but it still doesn't work. I'm not sure what additional information would be helpful in order to solve this problem – I'll provide whatever anyone requests.

Code:
.home-title { 
 font-family: 'feastofflesh'; 
}
#nav .sf-menu a { 
 font-family: 'feastofflesh'; 
}

Last edited by Kingcripple; 11-23-2011 at 06:39 PM..
Kingcripple is offline   Reply With Quote
Old 11-23-2011, 01:33 PM   PM User | #6
resdog
Regular Coder

 
Join Date: Aug 2011
Location: U.S.A.
Posts: 233
Thanks: 2
Thanked 48 Times in 48 Posts
resdog is on a distinguished road
The eot version of the font only works on Internet Explorer:

Internet Explorer only supports EOT
Mozilla browsers support OTF and TTF
Safari and Opera support OTF, TTF and SVG
Chrome supports TTF and SVG.

What browser are you looking at it on? The website you gave did not have the font family applied, so it's difficult to see the problem. since you're using wordpress, can you create a templated page that pulls a different header linked to a different CSS using the font so we can see what code you have?

Normally when you use @font-face, you need to include all the different variations in order for all browsers to render it correctly.
__________________
WordPress Designer and theme developer. KlongDesigns - helping bloggers and non-technical folks claim their space on the internet.
resdog is offline   Reply With Quote
Old 11-23-2011, 05:17 PM   PM User | #7
Kingcripple
New Coder

 
Join Date: Nov 2011
Posts: 12
Thanks: 1
Thanked 0 Times in 0 Posts
Kingcripple is an unknown quantity at this point
Quote:
Originally Posted by resdog View Post
try putting feastofflesh in quotes.
I tried this but it didn't help.

Quote:
Originally Posted by resdog View Post
The eot version of the font only works on Internet Explorer:

Internet Explorer only supports EOT
Mozilla browsers support OTF and TTF
Safari and Opera support OTF, TTF and SVG
Chrome supports TTF and SVG.

What browser are you looking at it on? The website you gave did not have the font family applied, so it's difficult to see the problem. since you're using wordpress, can you create a templated page that pulls a different header linked to a different CSS using the font so we can see what code you have?

Normally when you use @font-face, you need to include all the different variations in order for all browsers to render it correctly.
I'm aware that the current font will only work on IE. I would like to get it to work on at least one browser before I move on to the other browsers. I apologize for not having the font applied when you took a look at my website. I took it down to try and work on something else for a little while, and I suspect you looked at my website during this period of time. I haven't applied now and will leave it applied until the problem is resolved.

Thank you everyone for graciously taking a look at my problem. It's highly appreciated!
Kingcripple is offline   Reply With Quote
Old 11-23-2011, 05:46 PM   PM User | #8
SB65
Senior Coder

 
Join Date: Feb 2009
Location: West Yorkshire
Posts: 2,817
Thanks: 9
Thanked 681 Times in 675 Posts
SB65 will become famous soon enoughSB65 will become famous soon enough
I cannot see the @font-face declaration in default.css.
SB65 is offline   Reply With Quote
Old 11-23-2011, 06:29 PM   PM User | #9
claire_t
Regular Coder

 
Join Date: Apr 2010
Location: Somerset,UK
Posts: 137
Thanks: 10
Thanked 1 Time in 1 Post
claire_t is an unknown quantity at this point
Interesting thread! Am having similar trouble, so I hope you don't mind me jumping in......

Am using the font minya nouvelle.ttf which shows up fine in browsers except for in IE. What is the best way around this? I can't find a .eot version of this font and obviously can't change the extension. I have tried some font converters online to convert the .ttf to .eot but the .eot version never seems to work.

I have tried using the <!--[if IE]> IE only stuff here <![endif]--> fix, with using an image for IE but can't get this to work either (am prob doing it wrong but I don't know)

Any clues as to what is the best fix for the @font-face not working on a certain browser?

My site ishttp://www.joho-designs.co.uk/

Thanks
__________________
Hmmmm......scratchy head time......

Last edited by claire_t; 11-23-2011 at 06:52 PM..
claire_t is offline   Reply With Quote
Old 11-23-2011, 06:56 PM   PM User | #10
Kingcripple
New Coder

 
Join Date: Nov 2011
Posts: 12
Thanks: 1
Thanked 0 Times in 0 Posts
Kingcripple is an unknown quantity at this point
Quote:
Originally Posted by SB65 View Post
I cannot see the @font-face declaration in default.css.
I apologize, I had the wrong URL. Take a look at: www.kingcripple.com

Many thanks once again!
Kingcripple is offline   Reply With Quote
Old 11-23-2011, 07:44 PM   PM User | #11
resdog
Regular Coder

 
Join Date: Aug 2011
Location: U.S.A.
Posts: 233
Thanks: 2
Thanked 48 Times in 48 Posts
resdog is on a distinguished road
try removing the space between url and (:

Code:
@font-face { font-family: 'feastofflesh'; src: url('http://kingcripple.com/degradationofmorality/fonts/feastofflesh.eot'); }
__________________
WordPress Designer and theme developer. KlongDesigns - helping bloggers and non-technical folks claim their space on the internet.
resdog is offline   Reply With Quote
Old 11-23-2011, 08:03 PM   PM User | #12
Kingcripple
New Coder

 
Join Date: Nov 2011
Posts: 12
Thanks: 1
Thanked 0 Times in 0 Posts
Kingcripple is an unknown quantity at this point
Quote:
Originally Posted by resdog View Post
try removing the space between url and (:

Code:
@font-face { font-family: 'feastofflesh'; src: url('http://kingcripple.com/degradationofmorality/fonts/feastofflesh.eot'); }
I removed the space between but it still didn't work.
Kingcripple is offline   Reply With Quote
Old 11-23-2011, 08:59 PM   PM User | #13
resdog
Regular Coder

 
Join Date: Aug 2011
Location: U.S.A.
Posts: 233
Thanks: 2
Thanked 48 Times in 48 Posts
resdog is on a distinguished road
Oh, it looks like it's an IE 9 issue, as the font renders perfectly in IE 8 and below. Add this to your css:

Code:
src: url('http://kingcripple.com/degradationofmorality/fonts/feastofflesh.eot'); /* IE9 Compat Modes */
	src: url('http://kingcripple.com/degradationofmorality/fonts/feastofflesh.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
Not sure if that will fix it, but at least now you know it's an issue specific with IE9. If you use the font-face generator http://www.fontsquirrel.com/fontface/generator
to generate all the fonts, you shouldn't have any problems.
__________________
WordPress Designer and theme developer. KlongDesigns - helping bloggers and non-technical folks claim their space on the internet.
resdog is offline   Reply With Quote
Old 11-23-2011, 10:16 PM   PM User | #14
Kingcripple
New Coder

 
Join Date: Nov 2011
Posts: 12
Thanks: 1
Thanked 0 Times in 0 Posts
Kingcripple is an unknown quantity at this point
Okay, it didn't seem to fix the issue, but when I was looking on font squirrel, which I'm familiar with, I believe it says WOFF is compatible starting with IE9. So, I downloaded the kit based on my font, and I've uploaded all of the additional font types. My problem, however, is I don't know what to make of the CSS font squirrel includes in the kit.

Code:
@font-face {
    font-family: 'FeastofFleshBBItalic';
    src: url('feasfbi_-webfont.eot');
    src: url('feasfbi_-webfont.eot?#iefix') format('embedded-opentype'),
         url('feasfbi_-webfont.woff') format('woff'),
         url('feasfbi_-webfont.ttf') format('truetype'),
         url('feasfbi_-webfont.svg#FeastofFleshBBItalic') format('svg');
    font-weight: normal;
    font-style: normal;
}
It's my understanding I can change the "font-family" to whatever I want, in this case, feastofflesh, which is in line with the rest of my CSS specifications. I also assume I have to identify the URLs to the four font files. Is my understanding right? If so, I've added the following to my CSS with no change:
Code:
@font-face {
    font-family: 'feastofflesh';
    src: url('http://kingcripple.com/degradationofmorality/fonts/feastbi_-webfont.eot');
    src: url('http://kingcripple.com/degradationofmorality/fonts/feasfbi_-webfont.eot?#iefix') format('embedded-opentype'),
         url('http://kingcripple.com/degradationofmorality/fonts/feasfbi_-webfont.woff') format('woff'),
         url('http://kingcripple.com/degradationofmorality/fonts/feasfbi_-webfont.ttf') format('truetype'),
         url('http://kingcripple.com/degradationofmorality/fonts/feasfbi_-webfont.svg#FeastofFleshBBItalic') format('svg');
    font-weight: normal;
    font-style: normal;
}
As always, many thanks to those who read and reply.
Kingcripple is offline   Reply With Quote
Old 11-24-2011, 11:42 AM   PM User | #15
Frankie
Regular Coder

 
Join Date: Sep 2011
Posts: 286
Thanks: 3
Thanked 33 Times in 33 Posts
Frankie is an unknown quantity at this point
Beats me. I checked the path and the presence of the font files, and they are OK. And the only thing I see wrong in your code is the 'FeastofFleshBBItalic' in the svg line, which should be 'feastofflesh'. But the rest seems OK.
Frankie is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 07:31 PM.


Advertisement
Log in to turn off these ads.