1

I'm using for a website the font Oxygen via GoogleFont. However, for webdesign purpose, I downloaded in my computer the Oxygen font via FontSquirrel.

Apparently it's the same, but it looks different and I have size issues. So I was thinking:

Is there a way to declare "I want to use the GoogleFont font and not the font stored in the computer even if it has the same name"?

Because if someone has a totally different font with the same name, there could be a lot of display problems.

EDIT: What about downloading the font on Google's server and hosting it on my website? (The font is 100% free for commercial use.) But why do a lot of websites use Google Fonts if it could be that simple?

Alan H.
  • 16,219
  • 17
  • 80
  • 113
cyclone200
  • 367
  • 7
  • 22
  • 1
    Possible duplicate of [locally installed TTF overrides Google fonts](http://stackoverflow.com/questions/9420155/locally-installed-ttf-overrides-google-fonts) – Michael Benjamin Mar 03 '16 at 19:19
  • @Michael_B Indeed, the question was the same. However, it doesn't seem to be solved. What about downloading the ttf and hosting it myself? I mean why all of websites use Google Fonts if it could be that simple to host the font? – cyclone200 Mar 03 '16 at 19:24
  • Personally, I just use Google Fonts because of its simplicity. I just have to paste a link and it's good to go. – Everton Lenger Mar 03 '16 at 20:06

1 Answers1

1

If you have the web fonts you could host yourself and give them any name you want in the css and avoid the potential of the local font loading.

For example:

@font-face {
font-family: 'myspecialfont';
src: url('oxygen-webfont.eot');
src: url('oxygen-webfont.eot?#iefix') format('embedded-opentype'),
     url('oxygen-webfont.woff2') format('woff2'),
     url('oxygen-webfont.woff') format('woff'),
     url('oxygen-webfont.ttf') format('truetype'),
     url('oxygen-webfont.svg#oxygenregular') format('svg');
font-weight: normal;
font-style: normal;
}
h1 {font-family: "myspecialfont", sans-serif;}

Just make sure you're pointing the CSS to the correct path for those files (e.g. if you put them in a fonts folder it'd could be "../fonts/oxygen-webfont")

The main reason people use google is they've optimized it for serving fonts, it takes load off your server, and potentially people have the font cached from google making it load faster. If it's an uncommon font and your server is decent these may negligible.