Using custom fonts using CSS?

I’ve seen some new websites that are using custom fonts on their sites (other than the regular Arial, Tahoma, etc.). And they support a nice amount of browsers. How does one do that? While also preventing people from having free access to download the font, if possible. 8 Answers 8

Multiple font-weights, one @font-face query

I have to import the Klavika font and I’ve received it in multiple shapes and sizes: Klavika-Bold-Italic.otf Klavika-Bold.otf Klavika-Light-Italic.otf Klavika-Light.otf Klavika-Medium-Italic.otf Klavika-Medium.otf Klavika-Regular-Italic.otf Klavika-Regular.otf Now I would like to know if it’s possible to import those into CSS with just one @font-face-query, where I’m defining the weight in the query. I want to avoid copy/pasting … Read more

Using fonts with Rails asset pipeline

I have some fonts being configured in my Scss file like so: @font-face { font-family: ‘Icomoon’; src: asset-url(‘icoMoon.eot?#iefix’, font) format(’embedded-opentype’), asset-url(‘icoMoon.woff’, font) format(‘woff’), asset-url(‘icoMoon.ttf’, font) format(‘truetype’), asset-url(‘icoMoon.svg#Icomoon’, font) format(‘svg’); } The actual font file are stored in /app/assets/fonts/ I have added config.assets.paths << Rails.root.join(“app”, “assets”, “fonts”) to my application.rb file and the compile CSS source … Read more

How to add multiple font files for the same font?

I’m looking at the MDC page for the @font-face CSS rule, but I don’t get one thing. I have separate files for bold, italic and bold + italic. How can I embed all three files in one @font-face rule? For example, if I have: @font-face { font-family: “DejaVu Sans”; src: url(“./fonts/DejaVuSans.ttf”) format(“ttf”); } strong { … Read more