PeachDrawing.Text
PeachDrawing.Text.Compression.BrotliDecompression
BrotliDecompression.SetDecompressor(Func<Stream,Stream>) Method
Registers decompressor as the decoder PeachDrawing.Text falls back to when the .NET runtime’s own Brotli support is unavailable. It receives the compressed data as a System.IO.Stream and must return a System.IO.Stream - most simply a System.IO.MemoryStream already holding the whole decompressed result - that yields the decompressed bytes when read; PeachDrawing.Text disposes both the stream it passed in and the one returned. Pass null to go back to the default (BCL-only) behavior, which is also what happens if this is never called: every default’s behavior is unchanged from before this seam existed.
public static void SetDecompressor(System.Func<System.IO.Stream,System.IO.Stream>? decompressor);
Parameters
decompressor System.Func<System.IO.Stream,System.IO.Stream>
Remarks
Thread-safe (the last call anywhere wins), and takes effect immediately for any resource not yet read: PeachDrawing.Text caches each Unicode/hyphenation/dictionary table and each loaded font the first time it is needed and never re-reads it, so call this before the first use of a feature backed by this data - any Unicode-aware line breaking, bidirectional text, hyphenation, Thai/Lao/Khmer/Burmese word segmentation, or loading a WOFF2 font - for it to take effect there. Calling it again later replaces the decoder for anything not yet cached; it never un-caches or reloads data already read under a previous one.