Hosting fonts and using @font-face
This guide will show you how to add a font to a website/blog so that it can be displayed even without having that font installed on your PC.
1) Download your font from http://www.dafont.com/ and extract the .zip file in a folder
2) Go to http://www.fontsquirrel.com/tools/webfont-generator
3) Check “optimal” and the square box at the bottom
4) Click “upload fonts”, go to the previously extracted files from dafont.com and select the one ending in .otf or .ttf
5) Click “download your kit” and once again extract the .zip file in a folder
6) Go to https://drive.google.com/ and create a new folder. Make sure it’s set to “Public” in the sharing settings.
7) Upload these files downloaded from FontSquirrel: .woff, .woff2, .tff or.otf, .svg, .eot
8) Among the files downloaded from FontSquirrel find the one named sylesheet.css, open it and copy it.
9) Paste the code to your CSS. It should look something like this:
/* Generated by Font Squirrel (http://www.fontsquirrel.com) on November 4, 2015 */
@font-face {
font-family: 'pixelmixregular';
src: url('pixelmix-webfont.eot');
src: url('pixelmix-webfont.eot?#iefix') format('embedded-opentype'),
url('pixelmix-webfont.woff2') format('woff2'),
url('pixelmix-webfont.woff') format('woff'),
url('pixelmix-webfont.ttf') format('truetype'),
url('pixelmix-webfont.svg#pixelmixregular') format('svg');
font-weight: normal;
font-style: normal;
Note: to create this code I’ve used the font pixelmixregular. You should see your font’s name there.
10) Copy this somewhere where you can edit it (Notepad for example):
http://googledrive.com/host/XXXXXXXXX/
11) Now we’re going to replace the XXXXXXXXX part. Go to your Google Drive folder. In the adress bar the link should be similar to this: https://drive.google.com/drive/u/0/folders/XXXXXXXXXXXXXXX. There should be a code instead of the XXX. That’s what you should replace the XXX with in the googledrive link above.
12) Now back to the @font-face CSS. See the bold area in the code? Attach your newly created link BEFORE them, so that it looks like this:
/* Generated by Font Squirrel (http://www.fontsquirrel.com) on November 4, 2015 */
@font-face {
font-family: 'pixelmixregular';
src: url('http://googledrive.com/host/XXXXXXXXX/pixelmix-webfont.eot');
src: url('http://googledrive.com/host/XXXXXXXXX/pixelmix-webfont.eot?#iefix') format('embedded-opentype'),
url('http://googledrive.com/host/XXXXXXXXX/pixelmix-webfont.woff2') format('woff2'),
url('http://googledrive.com/host/XXXXXXXXX/pixelmix-webfont.woff') format('woff'),
url('http://googledrive.com/host/XXXXXXXXX/pixelmix-webfont.ttf') format('truetype'),
url('http://googledrive.com/host/XXXXXXXXX/pixelmix-webfont.svg#pixelmixregular') format('svg');
font-weight: normal;
font-style: normal;
13) And now on to the bold part of the CSS code! Replace it with the exact name of the files in your Google Drive folder. Basically we’ve created a link that leads to the hosted font files. When someone visits your website, they are able to correctly display your font because their browser goes search for it where you have hosted it. Thus they do not need to have the font installed to display it.
For questions and such just drop me a message on my tumblr!