Donner 0.5.0
Embeddable browser-grade SVG2 engine
Loading...
Searching...
No Matches
donner::fonts::Woff2Parser Class Reference

Decompress a WOFF2 font file into a raw TTF/OTF byte stream. More...

#include "donner/base/fonts/Woff2Parser.h"

Static Public Member Functions

static ParseResult< std::vector< uint8_t > > Decompress (std::span< const uint8_t > woff2Data)
 Decompress WOFF2 data into a flat TTF/OTF byte stream.

Detailed Description

Decompress a WOFF2 font file into a raw TTF/OTF byte stream.

WOFF2 fonts use Brotli compression and a custom table transform to achieve higher compression ratios than WOFF 1.0. This parser delegates to the Google woff2 library (decode-only) to reconstruct the sfnt byte stream.

See also
https://www.w3.org/TR/WOFF2/ for the WOFF2 specification.

Member Function Documentation

◆ Decompress()

ParseResult< std::vector< uint8_t > > donner::fonts::Woff2Parser::Decompress ( std::span< const uint8_t > woff2Data)
static

Decompress WOFF2 data into a flat TTF/OTF byte stream.

Parameters
woff2DataThe WOFF2 file data as a byte span.
Returns
A ParseResult containing the decompressed sfnt bytes on success, or a ParseDiagnostic on failure.

The documentation for this class was generated from the following files:
  • donner/base/fonts/Woff2Parser.h
  • donner/base/fonts/Woff2Parser.cc