Pages

vineri, 9 februarie 2018

Fonts - WOFF fonts - part 001.

Today I will start a new series of tutorials about fonts.
The main reason was that web development and font are very useful both in transmitting content and in the ergonomics of any website.
I will try to highlight less well-researched issues that come to the aid of any type of developer.
The first step is about WOFF and WOFF2 font files.
A WOFF file is a web font file created in the WOFF (Web Open Font Format) format.
This open format used for delivering webpage fonts on the fly.
It is saved as a compressed container and supports TrueType (.TTF) and OpenType (.OTF) fonts. Another good thing allows information about software licensing.

Some benefits of using WOFF:

  • web sites using WOFF will use less bandwidth and will load faster than if they used equivalent fonts; 
  • many font vendors that are unwilling to license like TrueType OpenType;
  • the free-software browser vendors like the WOFF format becoming a truly universal, interoperable font format for the web;
  • WOFF files are referenced within CSS files using the @font-face rule;
  • WOFF files were replaced with .WOFF2 files;
  • the WOFF 2.0 format that features improved compression;

One example of use this fonts into CSS - the stylesheet area:
@font-face {
  font-family: 'MyFontWebsite';
  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 */
}

This table show the browsers support:
Chrome Safari Firefox Opera IE Android iOS
36+ No 35+ with flag 23+ No 37 No