0

I downloaded a font and in my CSS I have :

@font-face {
font-family: "Gotham Medium";
src: url("Gotham/Gotham-Medium.otf");}

When I call say in

 h1 { font-family:'Gotham Medium'}

the font display does not match what Gotham should look like. Nor is it a default font.

Is the problem a matter of something being changed when downloaded in my laptop ? The font is not in the google API so I can't try with an external link.

MonnIca
  • 81
  • 2
  • 8
  • Open developer console and check network tab, make sure you are getting 200 instead of 404 – Robert I Nov 16 '17 at 23:01
  • The page where the css is, gets status ' Finished'. – MonnIca Nov 16 '17 at 23:12
  • inspect your h1 tag, in web debugger and you will see what font is used – Robert I Nov 16 '17 at 23:13
  • That's the thing. It says it uses Gotham Medium font, but it's not the same font as it is on the page. I thought maybe when downloading some encodings get lost or something. Cuz the name of the font is the one I import, but it's not how it's displayed. – MonnIca Nov 16 '17 at 23:18
  • use [**font-squirrel**](https://www.fontsquirrel.com/tools/webfont-generator) to generate web-fonts – dippas Nov 16 '17 at 23:19
  • Thank you. Says the font I'm uploading is blacklisted though – MonnIca Nov 16 '17 at 23:26
  • try using a different font format perhaps otf isnt supported by your particular browser, see here https://stackoverflow.com/questions/3245141/using-otf-fonts-on-web-browsers – Robert I Nov 16 '17 at 23:27
  • Do you own a legitimate license for Gotham? It’s rights are maneaged by Hoefler & Co. It’s not free. – Robert Wade Nov 17 '17 at 04:04

1 Answers1

2

Your Css should be like this :

@font-face {
     font-family: 'MyWebFont';
     src: url('webfont.eot'); /* IE9 Compat Modes */
     src: url('webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
     url('webfont.woff2') format('woff2'), /* Super Modern Browsers */
     url('webfont.woff') format('woff'), /* Pretty Modern Browsers */
     url('webfont.ttf')  format('truetype'), /* Safari, Android, iOS */
     url('webfont.svg#svgFontName') format('svg'); /* Legacy iOS */
}

css Trick

To do this you can use a generator for font-face but you must have the license for the web font

Sfili_81
  • 2,377
  • 8
  • 27
  • 36