PeachDrawing.Text

PeachDrawing.Text.Compression Namespace

Classes  
BrotliCompression A pluggable Brotli encoder, the counterpart of BrotliDecompression. By default PeachDrawing.Text compresses with .NET’s own System.IO.Compression.BrotliEncoder. On a host where that throws System.PlatformNotSupportedException - WebAssembly in a browser, at the time of writing - TryCompress(ReadOnlySpan<byte>, int, byte[]) reports failure (and IsAvailable is false) so a caller can fall back to another compression; call SetCompressor(Func<Stream,int,Stream>) once to supply a managed Brotli encoder instead and recover Brotli output on such a host.
BrotliDecompression A pluggable decoder for the Brotli-compressed data PeachDrawing.Text reads: the Unicode, hyphenation and dictionary data of its PeachDrawing.Text.Data dependency, and WOFF2 font data (Brotli-compressed by the WOFF2 specification itself). By default, PeachDrawing.Text decompresses with .NET’s own System.IO.Compression.BrotliStream. On a host where that throws System.PlatformNotSupportedException - WebAssembly in a browser, at the time of writing - the affected feature quietly degrades instead of the render failing: a Unicode table comes back empty, text lays out unhyphenated, and a WOFF2 font is skipped as if it could not be read. Call SetDecompressor(Func<Stream,Stream>) once, before using PeachDrawing.Text, to supply a managed Brotli implementation instead and recover that data on such a host.