woff2 (with Brotli)
| woff2 | Brotli | |
|---|---|---|
| Version | 1.0.2 | 1.2.1 |
| Source | https://github.com/google/woff2/archive/refs/tags/v1.0.2.tar.gz | https://github.com/google/brotli/archive/refs/tags/v1.2.1.tar.gz |
| SHA-256 of the archive | add272bb09e6384a4833ffca4896350fdb16e0ca22df68c0384773c67a175594 |
98d35d11a78dc453aebb7d10c3748f3f73ff78c8267c0dc697b8631f67bf7e8f |
| Project | https://github.com/google/woff2 | https://github.com/google/brotli |
| License | MIT | MIT |
| Copyright | Copyright (c) 2013-2017 by the WOFF2 Authors. | Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors. |
Both archives are the source snapshots GitHub generates for the release tags. Neither project publishes a separate
checksum file: the SHA-256 values above are those of the files downloaded on 2026-11-21 and are what build.sh
enforces from then on.
Why it is bundled
WOFF2 is Brotli compression plus a font-specific transformation of the glyf / loca tables. Apple's frameworks
decode WOFF2 (Core Text opens such files) but offer no encoder and no way to get the decoded sfnt bytes back.
google/woff2 is the reference implementation, used by browsers and by fonttools.
woff2 1.0.2 (2017) is the project's last tagged release. Its decoder is the code the engine exposes to untrusted files: the engine bounds its output (512 MB), never trusts the announced size, and the test suite runs it on 400 mutated WOFF2 files and on truncated ones without a crash — which is evidence, not proof, for a C++ parser of that age.
How it is built and linked
build.sh downloads the two archives and checks their SHA-256. Brotli is built with its CMake project (Release,
static, tools and tests off). The ten library sources of woff2 (font, glyph, normalize, table_tags,
transform, variable_length, woff2_common, woff2_dec, woff2_enc, woff2_out; none of the command-line
tools) are compiled directly with clang++ -std=c++14 -O2 -arch arm64 -mmacosx-version-min=15.0, because the CMake
project of 1.0.2 predates current CMake policies and adds nothing for a static library. Everything is merged into
libCWOFF2.a and wrapped with the three public C++ headers (woff2/decode.h, encode.h, output.h) into
CWOFF2.xcframework — headers only, no module map.
Packages/EngineFont consumes it as a SwiftPM binaryTarget and wraps it in its own small C target
(Sources/CWOFF2Shim), so that Swift only sees five C functions and no C++ exception can cross the boundary. The
code is statically linked into the application (plus the system's libc++); nothing is loaded at run time.
Build-time tools: cmake (Homebrew, already present on the build machine), make, clang++, libtool,
xcodebuild. Size of the product: libCWOFF2.a 1 052 616 bytes, CWOFF2.xcframework 1.0 MB.
The sources are not modified. src/, work/, prefix/ and CWOFF2.xcframework/ are build products and are not
committed.
Obligations
MIT, for both: the copyright notice and the permission notice must be included in all copies or substantial portions of the software. The application's acknowledgements must therefore include the two texts below.
woff2
Copyright (c) 2013-2017 by the WOFF2 Authors.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.Brotli
Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.