import gotham book font with css

1

I'm trying to import the gotham-book font, it's in the fonts / GOTHAM-BOOK.ttf folder, however although I try to import it does not change at all.  How can I do this?

.table td{
    border: 0px !important;
    margin: 0px;
    padding: 0px;
    src: url('fonts/GOTHAM-BOOK.ttf');
    font: 'Gotham Book', Gotham-Book, sans-serif;
    font-size: 10pt;
}
    
asked by anonymous 20.07.2015 / 20:20

1 answer

3

You're trying to import the font the wrong way, first you have to set a font-face in your style sheet, and then use it:

@font-face {
  font-family: 'FontName';
  src: url('../fonts/font-name-webfont.eot?v=4.3.0');
  src: url('../fonts/font-name-webfont.eot?#iefix&v=4.3.0') format('embedded-opentype'), 
        url('../fonts/font-name-webfont.woff2?v=4.3.0') format('woff2'), 
        url('../fonts/font-name-webfont.woff?v=4.3.0') format('woff'), 
        url('../fonts/font-name-webfont.ttf?v=4.3.0') format('truetype');
  font-weight: normal;
  font-style: normal;
}

Then just use it like any other source:

.table td {
    font-family: "FontName", sans-serif;
}

And on this site you can download the Gotham Book for web with style css ready to use.

* Note that "FontName" is just a sample name and you should replace them with your webfont files.     

20.07.2015 / 20:31