aspose.info
EN

WOFF2 File - Web Open Font Format 2.0 File

Updated

What is a WOFF2 file?

WOFF2 is a font file format that is a more compressed version of the Web Open Font Format (WOFF). It was developed as a way to reduce the file size of web fonts, allowing them to load faster and use less bandwidth. WOFF2 uses a compression algorithm called Brotli to compress the font data, which can result in file sizes that are significantly smaller than equivalent WOFF fonts. This format is supported by most modern web browsers including Chrome, Firefox, Safari, Opera and Edge (version 14 onwards).

WOFF2 File Format - More Information

The internal file structure of a WOFF2 font file is composed of several different parts, including a header, metadata, a table directory, and the font data itself.

  1. The header contains information about the overall format of the file, including the version number and the number of tables that are present in the file.

  2. Metadata section contains information such as font name, copyright, and other font-related information.

  3. The table directory contains information about the different tables that make up the font, including their location in the file and their length.

  4. The font data itself is divided into several different tables, each of which contains specific information about the font, such as its characters and their corresponding glyphs. These tables may include:

  • The ‘glyf’ table contains the actual font outlines, including the shape and size of each character.
  • The ‘head’ table contains general information about the font, such as its version number, design size, and so on.
  • The ‘hmtx’ table contains information about the metrics of the font, including the widths and positions of the characters.
  • Each table is compressed and stored in WOFF2 file format after it completed the process of encoding.

The structure overall is designed to allow for fast parsing and decoding, so that web browsers can quickly and efficiently load and display the font on a website.

WOFF2 Header

The WOFF header comprises of an identifying signature which indicates the the kind of data included in the file. The WOFF header along with its fields is as follow.

TypeField NameDescription
UInt32signature0x774F4632 ‘wOF2’
UInt32flavorThe “sfnt version” of the input font.
UInt32lengthTotal size of the WOFF file.
UInt16numTablesNumber of entries in directory of font tables.
UInt16reservedReserved; set to zero.
UInt32totalSfntSizeTotal size needed for the uncompressed font data, including the sfnt header, directory, and font tables (including padding).
UInt32totalCompressedSize Total length of the compressed data block.
UInt16majorVersionMajor version of the WOFF file.
UInt16minorVersionMinor version of the WOFF file.
UInt32metaOffsetOffset to metadata block, from beginning of WOFF file.
UInt32metaLengthLength of compressed metadata block.
UInt32metaOrigLengthUncompressed size of metadata block.
UInt32privOffsetOffset to private data block, from beginning of WOFF file.
UInt32privLengthLength of private data block.

Where Can You Find WOFF2 Fonts?

You can find WOFF2 fonts in a few key places:

  • Google Fonts (fonts.google.com)
    Offers thousands of free fonts in WOFF2 format, ready for web use.

  • Font Foundries & Marketplaces
    Sites like MyFonts, Fontspring, and Adobe Fonts often include WOFF2 files with web font licenses.

  • Font Conversion Tools
    If you have a font in TTF or OTF format, you can convert it to WOFF2 using tools like:

References