Fix custom font line-height with CSS

The issue here is not line height but vertical placement of glyphs, in particular the location of the text baseline. That’s something that the font designer has decided on; the designer draws glyphs and places them in the em square, the conceptual device that has height equal to (or defined to be) the font height. … Read more

Rails 4: Why are fonts not loading in production?

We had this problem last week – the problem is that your assets will be compiled to have MD5 hashes on them, whilst your standard CSS will still be looking for their “standard” names. This is a problem with images & fonts. @font-face { font-family: ‘akagi’; src: asset_url(‘fonts/akagi-th-webfont.eot’); src: asset_url(‘fonts/akagi-th-webfont.eot?#iefix’) format(’embedded-opentype’), asset_url(‘fonts/akagi-th-webfont.woff’) format(‘woff’), asset_url(‘fonts/akagi-th-webfont.ttf’) format(‘truetype’), … Read more

Font-Face Not loaded

You have to have an @font-face declaration for each font: @font-face { font-family: OuachitaWayWbw; src: url(‘fonts/Ouachita Way Wbw.ttf’) format(“truetype”) ; } @font-face { font-family: ChromeYellowNF; src: url(‘fonts/Chrome Yellow NF.ttf’); } The single quotes are not required. If you are wanting to use custom fonts for IE9 you will need to also provide an “.eot” font … Read more

Non-Standard fonts in web?

As Simon pointed out, the CSS @font-face declaration can be used to implement traditionally non-web-safe fonts on your site. If you want to try it yourself, definitely check out Paul Irish’s now famous bulletproof font face implementation, which links to FontSquirrel’s font file generator. It’s now supported cross-browser with the right implementation, although with most … Read more