Custom fonts not displayed in Internet Explorer - html

My website uses custom fonts. They work on all browsers, except Internet Explorer (version 11.0.9600).
The CSS code:
#font-face {
font-family: 'almoni-dl';
font-weight: 700; /*(bold)*/
font-style: normal;
src: url('https://assets.mywebsite.com/fonts/almoni-dl-aaa-700.eot?#iefix') format('embedded-opentype'),
url('https://assets.mywebsite.com/fonts/almoni-dl-aaa-700.woff') format('woff'),
url('https://assets.mywebsite.com/fonts/almoni-dl-aaa-700.ttf') format('truetype');
}
html {
font-family: 'almoni-dl','Trebuchet MS',Helvetica,sans-serif;
}
What I've tried so far:
The fonts use an absolute path to a sub-domain. The response for these fonts includes the header Access-Control-Allow-Origin:*. I also tried using a relative path, no luck.
The fonts themselves are downloaded correctly, returning code 200.
Cache was cleared several times.
The fonts' Content-Types are: woff = application/font-woff; ttf = application/octet-stream; eot = application/vnd.ms-fontobject.
Other websites (such as www.newyorker.com) display custom fonts correctly on the same browser.
I also tried the following syntax:
#font-face {
font-family: 'almoni-dl';
font-weight: 700; /*(bold)*/
font-style: normal;
src: url('https://assets.kalir.co.il/fonts/almoni-dl-aaa-700.eot');
src: url('https://assets.kalir.co.il/fonts/almoni-dl-aaa-700.eot?#iefix') format('embedded-opentype'),
url('https://assets.kalir.co.il/fonts/almoni-dl-aaa-700.woff') format('woff'),
url('https://assets.kalir.co.il/fonts/almoni-dl-aaa-700.ttf') format('truetype');
}
What else could be wrong?

In the font-family property in css, try typing the actual full name of the font, if that doesn't work, try using the full filename (minus the extension) as the font-family.
IE has known issues finding the font if the font-family name is different than what it expects!

Related

font-family crash with #font-face src

Good day,
I have a css, code is as follow:
#font-face {
font-family: 'dax-regularregular';
src: url('../fonts/daxregular-webfont.eot');
}
body {
font-family: 'dax-regularregular';
}
And, in my html code, I simply code:
<b>this is bold</b> + this is normal
And this is display correctly in chrome, but not in IE (All become normal, not bold).
If I remove the body{} in my css file, then IE will working fine.
If I remove either font-family or src inside #font-face, then IE will working fine.
I do some research on internet, found that .eot file will not support for chrome, that's why chrome wont affected and display correctly. (Not sure my understanding is correct or not)
Kindly advise. And suggest your solution if you have.
** Edit **
#font-face {
font-family: 'dax-regularregular';
src: url('../fonts/daxregular-webfont.eot');
src: url('../fonts/daxregular-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/daxregular-webfont.woff') format('woff'),
url('../fonts/daxregular-webfont.ttf') format('truetype'),
url('../fonts/daxregular-webfont.svg#dax-regularregular') format('svg'),
url('../fonts/daxbold-webfont.eot');
font-weight: normal;
font-style: normal;
}
** Edit version 2 **
This solution can fix IE 9, IE 10, and IE 11 issue. But,
This solution introduce new issue to IE 8, which is , normal word will be bold, and the bold word will become "more bold" ( become fatter ). I saw from internet, IE 8 is not support the #font-face rule with the WOFF format (only support for EOT format). So, i take out those url except eot, but still facing the problem.
I change my css code to as follow, but still same hit issue in IE 8:
#font-face {
font-family: 'dax-regularregular';
src: url('../fonts/daxbold-webfont.eot');
src: url('../fonts/daxbold-webfont.eot?#iefix') format('embedded-opentype');
font-weight: bold;
font-style: normal;
}
As your code shows that you have included only .eot format webfont in body in css. The .eot format will work only on IE.
Now since you have added only url('../fonts/daxregular-webfont.eot') [notice 'regular'], the IE browser showing your text in regular or not-in-bold format. So if you want to display your text in-bold format on IE, you would need to add an additional url('../fonts/daxbold-webfont.eot') [notice 'bold'] definition in your css and also the relevant font in your font folder.
Now, why chrome displays it properly? I doubt if chrome would be showing your text in your desired font i.e. dax or .eot. Since you have not defined .woff font in your css (which chrome normally requires), most probably using some other font defined in some other css on your page.
To display your page consistently across all browsers using for custom font you would need to add all fonts definition in your css including adding the same in your font folder -
`#font-face {
font-family: 'dax-regularregular';
src: url('../fonts/daxregular-webfont.eot');
src: url('../fonts/daxregular-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/daxregular-webfont.woff2') format('woff2'),
url('../fonts/daxregular-webfont.woff') format('woff'),
url('../fonts/daxregular-webfont.ttf') format('truetype'),
url('../fonts/daxregular-webfont.svg#svgFontName') format('svg');
}`
UPDATE:
First, other then font definition mentioned above you'll also have to add other font formats definitions in your css like
for bold,
#font-face {
font-family: 'dax-bold';
src: url('../fonts/daxbold-webfont.eot');
src: url('../fonts/daxbold-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/daxbold-webfont.woff2') format('woff2'),
url('../fonts/daxbold-webfont.woff') format('woff'),
url('../fonts/daxbold-webfont.ttf') format('truetype'),
url('../fonts/daxbold-webfont.svg#svgFontName') format('svg');
}
for semibold,
#font-face {
font-family: 'dax-semibold';
src: url('../fonts/daxsemibold-webfont.eot');
src: url('../fonts/daxsemibold-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/daxsemibold-webfont.woff2') format('woff2'),
url('../fonts/daxsemibold-webfont.woff') format('woff'),
url('../fonts/daxsemibold-webfont.ttf') format('truetype'),
url('../fonts/daxsemibold-webfont.svg#svgFontName') format('svg');
}
and so on including relevant fonts in font folder, whichever you need.
Second, for getting these fonts. Not sure but I think your dax font seems a licensed font and not the free one. If yes, then you can convert all above mentioned formats using the ttf / otf font which would have been installed in your system's 'Font' folder. To convert just copy the 'regular' or 'bold' font from that font folder on your desktop and then convert it using website like 'Font Squirrel'
UPDATE 2
The IE needs .eot version web-font only, having .woff won't affect text in any IE version. So don't fear of .woff.
You need to correct your font definition, which is still incorrect in your last post -
for regular or unbold font,
#font-face {
font-family: 'dax-regularregular';
src: url('../fonts/daxregular-webfont.eot');
src: url('../fonts/daxregular-webfont.eot?#iefix') format('embedded-opentype');
}
for bold format font,
#font-face {
font-family: 'dax-bold';
src: url('../fonts/daxbold-webfont.eot');
src: url('../fonts/daxbold-webfont.eot?#iefix') format('embedded-opentype');
}
Your html should look like this -
<p style="font-family: 'dax-regularregular';"><span style="font-family: 'dax-bold';">bold text lying here</span> unbold text lying here</p>
It should work proper across.
Note: Have shown applying font in inline tag to demonstrate html structure, please use your class for the same.
Try adding different types of fonts and specifying there type as well..
#font-face {
font-family: 'dax-regularregular';
src: url('../fonts/daxregular-webfont.eot'); /* IE9 Compat Modes */
src: url('../fonts/daxregular-webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('../fonts/daxregular-webfont.woff2') format('woff2'), /* Super Modern Browsers */
url('../fonts/daxregular-webfont.woff') format('woff'), /* Pretty Modern Browsers */
url('../fonts/daxregular-webfont.ttf') format('truetype'), /* Safari, Android, iOS */
url('../fonts/daxregular-webfont.svg#svgFontName') format('svg'); /* Legacy iOS */
}
Add more font file like
font-family: 'dax-regularregular';
src: url('dax-regularregular.eot');
src: url('dax-regularregular.eot?#iefix') format('embedded-opentype'),
url('dax-regularregular.woff') format('woff'),
url('dax-regularregular.ttf') format('truetype'),
url('dax-regularregular.svg#open_sansregular') format('svg');
Generate your font blow link
http://www.fontsquirrel.com/tools/webfont-generator

Font loading OK in Safari but not Chrome or Firefox (all on Mac)

OK, I have reached the pulling my hair out stage.
I have created the below simple example. Basically Safari displays both fonts correctly, yet both Chrome and Firefox will not display the Helvetica font. Both fonts reside in the same folder, along with this test HTML. Anyone any ideas? - I have tried Helvetica Heavy Condensed from two sources, both same effect. See images.
<head>
<style>
#font-face
{
font-family: "HelvHvCn";
src: url('HelvHvCn.ttf') format('truetype');
}
#font-face
{
font-family: "BebasNeue";
src: url('BebasNeue-webfont.ttf') format('truetype');
}
h1
{
font-family: HelvHvCn;
}
h2
{
font-family: BebasNeue;
}
</style>
</head>
<body>
<h1>This font only works in Safari</h1>
<h2>This font works in Safari, Chrome and Firefox</h2>
</body>
Webfont implementations are a bit screwy, so you need to use a carefully phrased #font-face declaration to get it rendering reliably xbrowser.
Providing you have the license to use it as a webfont, run the TTF through a service like http://www.fontsquirrel.com/ to generate the eot, woff and svg webfonts, then try this syntax in your CSS...
#font-face {
font-family: 'your-custom-font';
src: url('your-custom-font.eot');
src: url('your-custom-font.eot?#iefix') format('embedded-opentype'),
url('your-custom-font.woff') format('woff'),
url('your-custom-font.ttf') format('truetype'),
url('your-custom-font.svg#your-custom-font') format('svg');
}
body {
font-family: 'your-custom-font', sans-serif;
}
Its probably also worth noting that woff files occasionally look fine on Mac Chrome, and pretty gash on Win Chrome. You may want to mess about with -webkit-font-smoothing: antialiased; and in some edgecases tweak the font order, or even ditch the woff altogether.

Font not rendering?

I have the following CSS (generated byn SASS):
#font-face {
font-family: "locust";
src: url(/assets/LOCUST.TTF) format("truetype");
src: url(/assets/LOCUST.svg) format("svg"); }
The path seems accessible - I'm on localhost:3000 and if I can download/see the fonts by typing localhost:3000/assets/LOCUST.TTF, for instance.
Yet Firefox don't render the font:
<h1 style="font-family: locust;">Test</h1>
I'm using Rails, but I don't think the problem is related, since the HTML and CSS generated seems correct to me, and the fonts are accessible. If I knew what I need to generate, most likely I would know how to fix.
Asset URL
Here is code we use:
#app/assets/stylesheets/fonts.css.scss
#font-face {
font-family: 'Lato';
src: asset_url('layout/fonts/lato/lato-hairline-webfont.eot');
src: asset_url('layout/fonts/lato/lato-hairline-webfont.eot?#iefix') format('embedded-opentype'),
asset_url('layout/fonts/lato/lato-hairline-webfont.woff') format('woff'),
asset_url('layout/fonts/lato/lato-hairline-webfont.ttf') format('truetype'),
asset_url('layout/fonts/lato/lato-hairline-webfont.svg#latohairline') format('svg');
font-weight: 100;
font-style: normal;
}
Notice asset_url is used -- this provides a CSS-compatible path to the url (hence why you're not able to access the path)
WebFonts
If you have full rights to use the font, you'd be better using the WebFont generator here: http://www.fontsquirrel.com/tools/webfont-generator
This creates cross-browser webfont files in .tff, .woff, .svg and .eot formats

fonts.googleapis is showing different CSS files based on the browser type

insdie my CSS files i am referencing fonts suc as :-
http://fonts.googleapis.com/css?family=Droid+Sans:regular&subset=latin
But now i need to download these CSS and add them to my host, instead of downloading them from google. but the problem i am facing is that when i try to download the related CSS files by access the above link from my IE it downlaod the following :-
#font-face {
font-family: 'Droid Sans';
font-style: normal;
font-weight: 400;
src: url(http://themes.googleusercontent.com/static/fonts/droidsans/v4/s-BiyweUPV0v-yRb-cjciFQlYEbsez9cZjKsNMjLOwM.eot);
src: local('Droid Sans'), local('DroidSans'), url(http://themes.googleusercontent.com/static/fonts/droidsans/v4/s-BiyweUPV0v-yRb-cjciFQlYEbsez9cZjKsNMjLOwM.eot) format('embedded-opentype'), url(http://themes.googleusercontent.com/static/fonts/droidsans/v4/s-BiyweUPV0v-yRb-cjciBsxEYwM7FgeyaSgU71cLG0.woff) format('woff');
}
While on firefox it shows the following :-
#font-face {
font-family: 'Droid Sans';
font-style: normal;
font-weight: 400;
src: local('Droid Sans'), local('DroidSans'), url(http://themes.googleusercontent.com/static/fonts/droidsans/v4/s-BiyweUPV0v-yRb-cjciBsxEYwM7FgeyaSgU71cLG0.woff) format('woff');
}
So i got lost on which url() i should download ? the woff or the tff ?? or both ?
EDIT
I have replaced this
#import url(https://fonts.googleapis.com/css?family=Karla|Ubuntu);
with
/*#import url(https://fonts.googleapis.com/css?family=Karla|Ubuntu);*/
#font-face {
font-family: 'Karla';
font-style: normal;
font-weight: 400;
src: url('~/Content/fonts/8gO-GQO6h3meAtqRrd890A.eot');
src: local('Karla'), local('Karla-Regular'), url('~/Content/fonts/8gO-GQO6h3meAtqRrd890A.eot') format('embedded-opentype'), url('~/Content/fonts/azR40LUJrT4HaWK28zHmVA.woff') format('woff');
}
#font-face {
font-family: 'Ubuntu';
font-style: normal;
font-weight: 400;
src: url('~/Content/fonts/_tMhxyW6i8lbI7YsUdFlGA.eot');
src: local('Ubuntu'), url('~/Content/fonts/_tMhxyW6i8lbI7YsUdFlGA.eot') format('embedded-opentype'), url('~/Content/fonts/_xyN3apAT_yRRDeqB3sPRg.woff') format('woff');
}
But the fonts effect did not work ? although when using the #import i can see the fonts effect, while when i reference them locally they stopped working.
Thanks
If you do need to use the fonts locally (rather than linking to Google's hosted versions), then they provide a download link on each font's page (in the top right)1.
The download link offers the option to 'Download the font families in your Collection as a .zip file'. If you do that, you'll get all the different versions (.ttf/.eot etc) that are needed for cross-browser #font-face support2.
You should have a good reason for doing so however: linking to the hosted version is simpler, and you'll automatically be using the latest version of each font.
Different browsers require different formats (the multiple src's in your CSS). Again though, if you're not familiar with what's required just stick with linking to Google's hosted files.

Custom Fonts not working on webkit browsers

can someone help me with this problem:
I have this font:
#font-face {
font-family: 'Museo500Regular';
src: url('MuseoSans_500-webfont.eot');
src: local('?'),
url('MuseoSans_500-webfont.woff') format('woff'),
url('MuseoSans_500-webfont.ttf') format('truetype'),
url('MuseoSans_500-webfont.svg#webfontr3rD8cn7') format('svg');
font-weight: normal;
font-style: normal;
}
that is not working on webkit browser and I don't understand why...
O other browsers like, firefox or IE it works just fine but only on webkit is not rendering well.
here you have an example on a test page with a drop down menu, just look at the font on other browsers and google chrome for example.
http://mainpage.ueuo.com/
Thank's.
I have downloaded your MuseoSans_500-webfont.ttf.. looks like its not a valid font... or not uploaded properly on the server... Do upload it again...
Or go to the following link and generate ur font-face css...
http://www.fontsquirrel.com/fontface/generator
#font-face {
font-family: 'Museo500Regular';
src: url('museosans_500-webfont-webfont.eot');
src: url('museosans_500-webfont-webfont.eot?#iefix') format('embedded-opentype'),
url('museosans_500-webfont-webfont.woff') format('woff'),
url('museosans_500-webfont-webfont.ttf') format('truetype'),
url('museosans_500-webfont-webfont.svg#_.regular') format('svg');
font-weight: normal;
font-style: normal;
}
Your CSS definition for #font-face has a wild } on line 11 (see default.css). This is likely causing you some problems.
Also, please, please, please don't use a table for your layout!
Remove single quotes in font name, do not need for single font, it needs only multiple fonts
font-family: Museo500Regular;