Is it currently safe to use font-face instead of Cufon and the like?

Asked

Viewed 214 times

5

I am working on a website and I need to use fonts that the user may not have on his machine. Nowadays the most used browsers already support @font-face? From which versions? It is already possible to give up alternatives like cufon?

  • 1

    If you are working with html 5 and css3, I believe the best option is the font-face because it is already native to CSS3. Otherwise, and still using css2, I advise you to use Cufon.

1 answer

4

Use font-face making one import from the source in your code:

/* latin-ext */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  src: local('Lato Regular'), local('Lato-Regular'), url(http://fonts.gstatic.com/s/lato/v10/ayfRv9GMahGqd-q6YxHjSg.woff2) format('woff2');
  unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  src: local('Lato Regular'), local('Lato-Regular'), url(http://fonts.gstatic.com/s/lato/v10/1YwB1sO8YE1Lyjf12WNiUA.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}

And applying the font to your css

font-family: 'Lato', sans-serif;

Who whichever browser run your source smoothly. Including the IE(ca)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.