Due to specific client requirements, I need to use IE8 as the main browser for a website, for which they require that a custom font of their own be used on the page headings. H1's to be more precise.
The problem I'm having is that on exactly the same page (whatever the page), the heading is sometimes correctly rendered using the custom font, but other times IE8 messes up the text and apparently applies the fallback font.
Bellow are two screenshots, one with the font correctly applied, one with it not being applied:
Good font:
Bad font:
I have the following stylesheet where I define the rules for that custom font. I apologize in advance, but I cannot make the name of the font public (NDA in effect).
#font-face {
font-family: 'secretfont_exbregular';
src: url('../fonts/secretfontexbd-webfont.eot');
src: url('../fonts/secretfontexbd-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/secretfontexbd-webfont.woff') format('woff'),
url('../fonts/secretfontexbd-webfont.ttf') format('truetype'),
url('../fonts/secretfontexbd-webfont.svg#secretfont_exbregular') format('svg');
font-weight: normal;
font-style: normal;
}
#font-face {
font-family: 'secretfont_ltregular';
src: url('../fonts/secretfontlt-webfont.eot');
src: url('../fonts/secretfontlt-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/secretfontlt-webfont.woff') format('woff'),
url('../fonts/secretfontlt-webfont.ttf') format('truetype'),
url('../fonts/secretfontlt-webfont.svg#secretfont_ltregular') format('svg');
font-weight: normal;
font-style: normal;
}
#font-face {
font-family: 'secretfont_rgregular';
src: url('../fonts/secretfontrg-webfont.eot');
src: url('../fonts/secretfontrg-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/secretfontrg-webfont.woff') format('woff'),
url('../fonts/secretfontrg-webfont.ttf') format('truetype'),
url('../fonts/secretfontrg-webfont.svg#secretfont_rgregular') format('svg');
font-weight: normal;
font-style: normal;
}
#font-face {
font-family: 'secretfont_rgbold';
src: url('../fonts/secretfontrgbd-webfont.eot');
src: url('../fonts/secretfontrgbd-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/secretfontrgbd-webfont.woff') format('woff'),
url('../fonts/secretfontrgbd-webfont.ttf') format('truetype'),
url('../fonts/secretfontrgbd-webfont.svg#secretfont_rgbold') format('svg');
font-weight: normal;
font-style: normal;
}
And the stylesheet where I set the font-family for the headings:
h1 {
color: #E60000;
font-family: 'secretfont_ltregular', Arial, Helvetica, sans-serif;
font-size: 36px;
}
I've tried everything I could think of but can't seem to get a consistent behavior out of IE8. What can I do to make it work as it should?
I had a similar issue - all EOT files were being successfully loaded by IE8 but only sporadically applied. After a lot of frustration the only thing that seemed to work is adding the chrome frame meta tag just below the tag:
<meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1" />
Be aware that chrome frame stops being supported January 2014 http://www.chromium.org/developers/how-tos/chrome-frame-getting-started
Related
I'm currently using a custom font on my website. The font looks fine on desktop, however on mobile it looks completely different. I'm also using all the right formats. Here is the code and pictures below:
Also When I remove the font family, it turns into a serif font which means a font is in fact loading, but why it looks completely different I'm not sure.
#font-face {
font-family: 'futura';
src: url('./futura.eot');
src: url('./futura.eot?') format('embedded-opentype'),
url('./futura.woff2') format('woff2'),
url('./futura.woff') format('woff'),
url('./futura.ttf') format('truetype'),
url('./futura.svg') format('svg');
font-weight: normal;
font-style: normal;
}
Solution: I just had to change the font-weight from normal to bold.
i had same problem, i remove font type and just keep ttf,i use media query for limit this change for mobile
#font-face {
font-family: 'futura';
src: url('./futura.ttf');
}
#media(min-width:768px){
#font-face {
font-family: 'futura';
src: url('./futura.eot');
src: url('./futura.eot?') format('embedded-opentype'),
url('./futura.woff2') format('woff2'),
url('./futura.woff') format('woff'),
url('./futura.ttf') format('truetype'),
url('./futura.svg') format('svg');
font-weight: normal;
font-style: normal;
}
}
if this wont work. add this line on top of your css
#font-face {
font-family: 'futura';
src: url('./futura.ttf');
}
I have following fonts in my style.css in my wordpress theme.
#font-face {
font-family: 'latoregular';
src: url('./fonts/lato-regular.eot');
src: url('./fonts/lato-regular.eot?#iefix') format('embedded-opentype'),
url('./fonts/lato-regular.woff2') format('woff2'),
url('./fonts/lato-regular.woff') format('woff'),
url('./fonts/lato-regular.ttf') format('truetype'),
url('./fonts/lato-regular.svg#latoregular') format('svg');
font-weight: normal;
font-style: normal;
}
#font-face {
font-family: 'bebasregular';
src: url('./fonts/bebas___-webfont.eot');
src: url('./fonts/bebas___-webfont.eot?#iefix') format('embedded-opentype'),
url('./fonts/bebas___-webfont.woff2') format('woff2'),
url('./fonts/bebas___-webfont.woff') format('woff'),
url('./fonts/bebas___-webfont.ttf') format('truetype'),
url('./fonts/bebas___-webfont.svg#bebasregular') format('svg');
font-weight: normal;
font-style: normal;
}
#font-face {
font-family: 'coustardregular';
src: url('./fonts/coustard-regular.eot');
src: url('./fonts/coustard-regular.eot?#iefix') format('embedded-opentype'),
url('./fonts/coustard-regular.woff2') format('woff2'),
url('./fonts/coustard-regular.woff') format('woff'),
url('./fonts/coustard-regular.ttf') format('truetype'),
url('./fonts/coustard-regular.svg#coustardregular') format('svg');
font-weight: normal;
font-style: normal;
}
This is the text in h2 element
The h2 element has font-family of coustardregular and font-weight of bold. As you can see in the image the structure of letter T is very strange and so is with letter I. I got this problem only in chrome and nowhere else. I tried this link also but it does not work and I have no idea about it. Can anybody guide me over this.
Where are you getting your font files from? I normally try to stick to using Google fonts rather than using loads of files because you know they'll work as they've been tried and tested whereas a lot of the time when you use the individual files, they've been converted from another file type which is where a lot of problems come from.
Google Fonts has the Coustard font and you can use it simply by adding the following to your css file (at the top):
#import url(https://fonts.googleapis.com/css?family=Coustard);
...or head over to Google to customize - https://www.google.com/fonts/specimen/Coustard
I've updated Google chrome browser recently. I noticed some of the fonts are not rendering correctly. On the other browsers it's seems fine. However this issue only appear in Chrome v32.0.17...76 m.
I've used "Open Sans" & "Novecentowide" Fonts.
The below CSS styles I've used for my HTML heading.
CSS
----
#font-face {
font-family: 'OpenSansSemibold';
src: url('../fonts/fonts_main/open-sans/OpenSans-Semibold-webfont.eot');
src: url('../fonts/fonts_main/open-sans/OpenSans-Semibold-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/fonts_main/open-sans/OpenSans-Semibold-webfont.woff') format('woff'),
url('../fonts/fonts_main/open-sans/OpenSans-Semibold-webfont.ttf') format('truetype'),
url('../fonts/fonts_main/open-sans/OpenSans-Semibold-webfont.svg#OpenSansSemibold') format('svg');
font-weight: 600;
font-style: normal;
}
#font-face {
font-family: 'OpenSansRegular';
src: url('../fonts/fonts_main/open-sans/OpenSans-Regular-webfont.eot');
src: url('../fonts/fonts_main/open-sans/OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/fonts_main/open-sans/OpenSans-Regular-webfont.woff') format('woff'),
url('../fonts/fonts_main/open-sans/OpenSans-Regular-webfont.ttf') format('truetype'),
url('../fonts/fonts_main/open-sans/OpenSans-Regular-webfont.svg#OpenSansRegular') format('svg');
font-weight: normal;
font-style: normal;
}
#font-face {
font-family: 'novecentowide-medium-webfont';
src: url('../fonts/fonts_main/Novecentowide-m/Novecentowide-Medium-webfont.eot');
src: url('../fonts/fonts_main/Novecentowide-m/Novecentowide-Medium-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/fonts_main/Novecentowide-m/Novecentowide-Medium-webfont.woff') format('woff'),
url('../fonts/fonts_main/Novecentowide-m/Novecentowide-Medium-webfont.ttf') format('truetype'),
url('../fonts/fonts_main/Novecentowide-m/Novecentowide-Medium-webfont.svg#novecentowide-medium-webfont') format('svg');
font-weight: 500;
font-style: normal;
}
#font-face {
font-family: 'novecentowide-normal-webfont';
src: url('../fonts/fonts_main/Novecentowide-n/Novecentowide-Normal-webfont.eot');
src: url('../fonts/fonts_main/Novecentowide-n/Novecentowide-Normal-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/fonts_main/Novecentowide-n/Novecentowide-Normal-webfont.woff') format('woff'),
url('../fonts/fonts_main/Novecentowide-n/Novecentowide-Normal-webfont.ttf') format('truetype'),
url('../fonts/fonts_main/Novecentowide-n/Novecentowide-Normal-webfont.svg#novecentowide-normal-webfont') format('svg');
font-weight: normal;
font-style: normal;
}
h1 { font-family: 'OpenSansRegular'; }
HTML
---------
<h1> Test on CHrome </h1>
However still fonts are not rendering correctly on new version of Chrome Browser. Please help me to solve this issue.
Edit:
On Chrome
On fire fox
On Chrome
-----------Next Method-------------------------------------------
HTML
<h6 class="title1">This is opensans Regular</h6>
<h6 class="title2">This is opensans semibold</h6>
CSS
#font-face {
font-family: 'OpenSansRegular';
src: url('/fonts/fonts_main/open-sans/OpenSans-Regular-webfont.eot');
src: url('/fonts/fonts_main/open-sans/OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'),
url('/fonts/fonts_main/open-sans/OpenSans-Regular-webfont.woff') format('woff'),
url('/fonts/fonts_main/open-sans/OpenSans-Regular-webfont.ttf') format('truetype'),
url('/fonts/fonts_main/open-sans/OpenSans-Regular-webfont.svg#OpenSansRegular') format('svg');
font-style: normal;
}
#font-face {
font-family: 'OpenSansSemibold';
src: url('/fonts/fonts_main/open-sans/OpenSans-Semibold-webfont.eot');
src: url('/fonts/fonts_main/open-sans/OpenSans-Semibold-webfont.eot?#iefix') format('embedded-opentype'),
url('/fonts/fonts_main/open-sans/OpenSans-Semibold-webfont.woff') format('woff'),
url('/fonts/fonts_main/open-sans/OpenSans-Semibold-webfont.ttf') format('truetype'),
url('/fonts/fonts_main/open-sans/OpenSans-Semibold-webfont.svg#OpenSansSemibold') format('svg');
font-style: normal;
}
h6.title1 {
font-family: 'OpenSansRegular';
font-weight: normal;
}
h6.title2 {
font-family: 'OpenSansSemibold';;
font-weight: 600;
}
h6.title1, h6.title2 { color: #54403C; font-size: 1.3em; }
body { font-size: 10px; }
Chrome
Fire Fox
So Chrome is rendering in normal font-weight, and Firefox is bold?
The font you're specifying only has a normal weight. So Chrome is correctly rendering the font, and Firefox has applied a faux bold effect to a non-bold typeface, as its default style for an h1 is to apply "boldness".
If you want them both normal:
h1 {
font-family: 'OpenSansRegular';
font-weight: normal; /* tell all browsers not to apply faux bold */
}
Or, if you want them both bold, specify the semi-bold face you have:
h1 {
font-family: 'OpenSansSemibold';
font-weight: 600;
}
This is a common pitfall when working with web fonts - always specify a font-weight on elements using them to avoid this.
EDIT
Adding text-rendering: optimizeLegibility; to the heading styles may help to normalise the rendering between browsers. I'm not sure if it addresses actual character rendering or just uses a different kerning algorithm, but worth a shot. It's difficult for me to test this as I don't have the same issue with this font on Chrome here.
The webpage where I'm trying to get the custom font "Duke-Fill" to display is http://www.hamlinforcongress.com/helpout.php
I'm using:
#font-face {
font-family: 'header_font';
src: url('Duke-Fill.eot?#iefix') format('embedded-opentype'),
url('Duke-Fill.woff') format('woff'),
url('Duke-Fill.ttf') format('truetype'),
url('Duke-Fill.svg#svgFontName') format('svg');
}
.header_font{
font-family: header_font;
}
I've tried every other suggestion I can find on the Internet, but nothing can make the custom font display in Internet Explorer. It works perfectly in every other conceivable browser, but not IE (surprise surprise). Help?
#font-face {
font-family: 'NimbusSanConD-Lig';
src: url('fonts/228BFB_1_0.eot');
src: url('fonts/228BFB_1_0.eot?#iefix') format('embedded-opentype'),
url('fonts/228BFB_0_0.woff') format('woff'),
url('fonts/228BFB_0_0.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
This code works in IE. It was generated using Font Squirrel
I just pulled up a project I'm working on to make some modifications, and noticed that declaration font-weight: lighter which is being served via #font-face and it is no longer working on the site (see image - top chrome, bottom ff). Nothing has changed on my system (Windows) since last night, bar being upgraded to Chrome 19.0.1084.46 today, which I presume is the problem, but I am wondering if anyone else has noticed this or if there is a fix?
Thanks.
Try using a number instead the relative term lighter.
For example: font-weight:100 will be the lightest.
There's a handy article about relative and absolute font-weights here:
http://webdesign.about.com/od/fonts/qt/aa031807.htm
If you are using a font-face font that has multiple styles (as you should) make sure that each variant is specifically tied to a font-weight, that way each variation has its own explicit file. Otherwise it's kinda up to the browser to make up what it wants to do. I have found that the automatically generated code from font-squirrel does not do this (though perhaps they've updated they're packaging)
Notice in the following code how each file has font-weight and font-style set explicitly. This leaves no room for guessing.
#font-face {
font-family: 'CaviarDreams';
src: url('fonts/CaviarDreamsItalic-webfont.eot');
src: url('fonts/CaviarDreamsItalic-webfont.eot?#iefix') format('embedded-opentype'),
url('fonts/CaviarDreamsItalic-webfont.woff') format('woff'),
url('fonts/CaviarDreamsItalic-webfont.ttf') format('truetype'),
url('fonts/CaviarDreamsItalic-webfont.svg#CaviarDreamsItalic') format('svg');
font-weight: normal;
font-style: italic;
}
#font-face {
font-family: 'CaviarDreams';
src: url('fonts/CaviarDreams_BoldItalic-webfont.eot');
src: url('fonts/CaviarDreams_BoldItalic-webfont.eot?#iefix') format('embedded-opentype'),
url('fonts/CaviarDreams_BoldItalic-webfont.woff') format('woff'),
url('fonts/CaviarDreams_BoldItalic-webfont.ttf') format('truetype'),
url('fonts/CaviarDreams_BoldItalic-webfont.svg#CaviarDreamsBoldItalic') format('svg');
font-weight: bold;
font-style: italic;
}
#font-face {
font-family: 'CaviarDreams';
src: url('fonts/CaviarDreams-webfont.eot');
src: url('fonts/CaviarDreams-webfont.eot?#iefix') format('embedded-opentype'),
url('fonts/CaviarDreams-webfont.woff') format('woff'),
url('fonts/CaviarDreams-webfont.ttf') format('truetype'),
url('fonts/CaviarDreams-webfont.svg#CaviarDreamsRegular') format('svg');
font-weight: normal;
font-style: normal;
}
#font-face {
font-family: 'CaviarDreams';
src: url('fonts/CaviarDreams_Bold-webfont.eot');
src: url('fonts/CaviarDreams_Bold-webfont.eot?#iefix') format('embedded-opentype'),
url('fonts/CaviarDreams_Bold-webfont.woff') format('woff'),
url('fonts/CaviarDreams_Bold-webfont.ttf') format('truetype'),
url('fonts/CaviarDreams_Bold-webfont.svg#CaviarDreamsBold') format('svg');
font-weight: bold;
font-style: normal;
}