Files

72 lines
1.7 KiB
Markdown
Raw Permalink Normal View History

2014-11-18 12:58:51 -08:00
This is a README for the font compression reference code. There are several
compression related modules in this repository.
brotli/ contains reference code for the Brotli byte-level compression
2016-02-24 16:00:43 +09:00
algorithm. Note that it is licensed under the MIT license.
2014-11-18 12:58:51 -08:00
2014-11-22 16:22:49 +02:00
src/ contains the C++ code for compressing and decompressing fonts.
2014-11-18 12:58:51 -08:00
2014-11-18 13:01:06 -08:00
# Build & Run
2014-11-18 12:58:51 -08:00
This document documents how to run the compression reference code. At this
writing, the code, while it is intended to produce a bytestream that can be
reconstructed into a working font, the reference decompression code is not
done, and the exact format of that bytestream is subject to change.
2015-02-25 11:08:15 -05:00
The build process depends on the g++ compiler.
2014-11-18 13:01:06 -08:00
## Build
2014-11-18 12:58:51 -08:00
On a standard Unix-style environment:
```
git clone --recursive https://github.com/google/woff2.git
2014-11-18 12:58:51 -08:00
cd woff2
make clean all
```
2017-10-04 12:16:22 +02:00
Alternatively, if Brotli is already installed on your system you can use CMake
to build executables and libraries:
```
git clone https://github.com/google/woff2.git
cd woff2
mkdir out
cd out
cmake ..
make
make install
```
By default, shared libraries are built. To use static linkage, do:
```
cd woff2
mkdir out-static
cmake -DBUILD_SHARED_LIBS=OFF ..
make
make install
```
2014-11-18 13:01:06 -08:00
## Run
2014-11-18 12:58:51 -08:00
2015-02-25 11:08:15 -05:00
Ensure the binaries from the build process are in your $PATH, then:
2014-11-18 12:58:51 -08:00
```
woff2_compress myfont.ttf
woff2_decompress myfont.woff2
```
2014-11-18 13:01:06 -08:00
# References
2014-11-18 12:58:51 -08:00
http://www.w3.org/TR/WOFF2/
http://www.w3.org/Submission/MTX/
Also please refer to documents (currently Google Docs):
WOFF Ultra Condensed file format: proposals and discussion of wire format
issues (PDF is in docs/ directory)
WIFF Ultra Condensed: more discussion of results and compression techniques.
This tool was used to prepare the data in that document.