I'm using two #font-face in CSSreset.css exactly like each other, and just one of them works!
This is the style code:
#font-face {
font-family: 'B Mitra';
src: url('./fonts/B Mitra.eot');
src: url('./fonts/B Mitra.eot?#iefix') format('embedded-opentype'),
url('./fonts/B Mitra.woff') format('woff'),
url('./fonts/B Mitra.ttf') format('truetype'),
url('./fonts/B Mitra.svg#webfont') format('svg');
}
#font-face {
font-family: 'BBCNassim';
src: url('./fonts/BBCNassim.eot');
src: url('./fonts/BBCNassim.eot?#iefix') format('embedded-opentype'),
url('./fonts/BBCNassim.woff') format('woff'),
url('./fonts/BBCNassim.ttf') format('truetype'),
url('./fonts/BBCNassim.svg#webfont') format('svg');
}
The second #font-face not working well. this is how I use them in my stylesheet:
#Download > a {
font-family: 'BBCNassim';
}
This is not working and shows "tahoma" font. the wierd part is, if the "BBCNassim" font not load correctly, the default browser font shows.
So, when I use font-family: 'BBCNassim';, the font will be tahoma.
This is the "B Mitra" font witch shows and load correctly:
#Map_Eshterak {
font-family: 'B Mitra';
}
SCREENSHOT: http://i.imgur.com/UXmSOmJ.jpg
The problem is not from the font; because if i copy "B Mitra" fonts, and change the name to "BBC Nassim", the same thing will happen.
this is my directory : http://i.imgur.com/xV6R8lw.png
Could it be the CSS selectors you're using? Does it work if you change your code to:
#Map_Eshterak {
font-family: 'BBCNassim';
}
And as a side-note, once you get this working you may want to give a font stack, in case your #font-face fonts don't load properly. (For example, font-family: 'BBCNassim', Helvetica, sans-serif; will show Helvetica is BBCNassim isn't available)
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 wanna make a website with a font named SutonnyMJ.TTF (in Bangla). I tried many resources, but i failed to do this.
i use #font-face { font-family: SutonnyMJ; src: url('../fonts/SutonnyMJ.TTF'); }
#font-face {
font-family: 'SutonnyMJ';
src: url('../fonts/SutonnyMJ-webfont.eot');
src: url('../fonts/SutonnyMJ-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/SutonnyMJ-webfont.woff') format('woff'),
url('../fonts/SutonnyMJ-webfont.ttf') format('truetype'),
url('../fonts/SutonnyMJ-webfont.svg#BebasNeueRegular') format('svg');
font-weight: normal;
font-style: normal;
}
but they does not work that i want.
Is there anyone to help me please, How can i solve this?
you can probably remove a couplke lines from there and remove legacy support your site will probably work fine with just this
#font-face {
font-family: 'SutonnyMJ';
src: url('../fonts/SutonnyMJ-webfont.woff') format('woff'),
url('../fonts/SutonnyMJ-webfont.ttf') format('truetype');
}
With #font-face you loaded in a custom font but you aren't using it yet
You still have to apply it to your website
body {
font-family: 'SutonnyMJ', sans-serif;
}
I coded a website on my mac, and i used a custom font. I defined the custom font with this font-face rule:
#font-face
{
font-family: gnuolane;
src: url('../fonts/gnuolane.otf'),
}
The problem is that the font is not loaded on any windows version of any browser. On my mac, on Safari/Chrome/FF is working perfect.
This is the website.
And this is how it is supposed to look like, when font-face is working correctly:
Thanks
LE:
I generated this code and all those files from fontsquirrel.com. Still not working. I tried with both '../fonts/gnuolane....' and '/fonts/gnuolane....'
#font-face {
font-family: 'gnuolane';
src: url('../fonts/gnuolane_rg-webfont.eot');
src: url('../fonts/gnuolane_rg-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/gnuolane_rg-webfont.woff') format('woff'),
url('../fonts/gnuolane_rg-webfont.ttf') format('truetype'),
url('../fonts/gnuolane_rg-webfont.svg#gnuolane_rgregular') format('svg');
font-weight: normal;
font-style: normal;
}
Still not working tho'..
Move all your font files (the actual fonts I mean) to the same folder as your CSS file...
Then use this block of CSS. Tell me if it works. I sense it's a path issue...
#font-face {
font-family: 'gnuolane';
src: url('gnuolane_rg-webfont.eot');
src: url('gnuolane_rg-webfont.eot?#iefix') format('embedded-opentype'),
url('gnuolane_rg-webfont.woff') format('woff'),
url('gnuolane_rg-webfont.ttf') format('truetype'),
url('gnuolane_rg-webfont.svg#gnuolane_rgregular') format('svg');
font-weight: normal;
font-style: normal;
}
try this
#font-face {
src: local('gnuolane'), url('/path_to/gnuolane.otf') format('truetype');
}
I'm trying to use the #fontface syntax for using extra fonts on my webpage. The thing is that while fonts appear as they should in dreamweaver, when I preview the page in Firefox or IE fonts do not render.
Here is the syntax I use:
#font-face {
font-family: 'KomikaTextRegular';
src: url('/fonts/KOMTXT__-webfont.eot');
src: url('/fonts/KOMTXT__-webfont.eot?#iefix') format('embedded-opentype'),
url('/fonts/KOMTXT__-webfont.woff') format('woff'),
url('/fonts/KOMTXT__-webfont.ttf') format('truetype'),
url('/fonts/KOMTXT__-webfont.svg#KomikaTextRegular') format('svg');
font-weight: normal;
font-style: normal;
}
body {
margin: 0;
min-width: 1024px;
font-family: 'KomikaTextRegular', DeliciousRoman, Helvetica, Arial, sans-serif;
}
Have you tried to use the full url , with the servername too?
#font-face {
font-family: 'KomikaTextRegular';
src: url('Http://servername/fonts/KOMTXT__-webfont.eot');
src: url('Http://servername/fonts/KOMTXT__-webfont.eot?#iefix') format('embedded-opentype'),
url('Http://servername/fonts/KOMTXT__-webfont.woff') format('woff'),
url('Http://servername/fonts/KOMTXT__-webfont.ttf') format('truetype'),
url('Http://servername/fonts/KOMTXT__-webfont.svg#KomikaTextRegular') format('svg');
font-weight: normal;
font-style: normal;
}
Or without ''?
body { margin:0;
min-width:1024px;
font-family: KomikaTextRegular, DeliciousRoman, Helvetica, Arial, sans-serif;
}
Also it's it a good article about using of the font-face.
If your full path is /www/demo.site.com/fonts/
and you use /fonts it may jump back to look for it in /www/fonts/ rather than the folder you want. Depends on what the root folder is set to really. Try base href maybe?
What if you take the first / off, does that work?
Try inspect it in firebug and find out where the path is to the css files.