0

I only want to use a font (and have the browser download it) if the OS the browser is on doesn't have that font built in. Is this possible?

Currently, I define the font with @font-face but this causes the broswer to download the font automatically. I only want that to happen if that font is not already on the system.

Ry-
  • 218,210
  • 55
  • 464
  • 476
Don Rhummy
  • 24,730
  • 42
  • 175
  • 330

1 Answers1

2

In the @font-face, specify a local source, e.g.

@font-face {
    font-family: Open Sans;
    src: local('Open Sans'), url('../fonts/open-sans.woff') format('woff');
}

Note that users may have broken local fonts.

Ry-
  • 218,210
  • 55
  • 464
  • 476
  • what do you mean by broken local fonts? is this common? any way to detect it? – Don Rhummy Apr 10 '15 at 14:42
  • @DonRhummy: It’s not too common, but it has happened to me once (with Google Fonts’s Fira Sans). There’s no way to detect it. – Ry- Apr 10 '15 at 14:47