Comments (10)
the WOFF2Params struct has an allow_transforms
option that is True by default. The caller can set it to False to prevent glyf and loca to be transformed:
Line 20 in a0d0ed7
however, the woff2_compress
command-line utility doesn't expose an option to disable that.
from woff2.
I believe this is a limitation of the current WOFF2 format, in that the "tripled encoding" of point coordinates in TrueType glyf table only retains whether each point is an on- or off-curve point (the most significant bit of the flagStream's bytes); the rest of the bits are used for the variable length encoding of point coordinates.
https://www.w3.org/TR/WOFF2/#triplet_decoding
Basically there is no room to store those OVERLAP_SIMPLE flags in WOFF2.
In fontTools' encoder, I think I am going to add an option so that the user can turn those bits on when generating the WOFF2 font.
from woff2.
In fontTools' encoder, I think I am going to add an option so that the user can turn those bits on when generating the WOFF2 font.
sorry, I contradicted myself. As I said, the flags can't be stored in current WOFF2. An option could be added to the decoder to set the flags when extracting the compresed WOFF2 font, but not to the encoder itself. The spec needs to be changed if we want to allow storing these OVERLAP flags in the transformed woff2 glyf table.
Another option is to leave the glyt table untransformed. I have to check again the spec to confirm whether this is allowed.
from woff2.
Yes -- according to the WOFF2 spec one can pass-through the glyf and loca tables without any transformation applied by setting their version to "3" (in the bit 6-7 of TableDirectoryEntry.flags):
For 'glyf' and 'loca' tables, transformation version 3 indicates the null transform where the original table data was passed directly to the Brotli compressor without applying any pre-processing
from woff2.
Thanks for this. Do you mean that the flag means: treat glyf data just like an arbitrary unstructured binary table? This wil be more than editing a flag in one of the woff2_compress sources, right?
from woff2.
yes -- it means the glyf and loca (always go together) tables are stored intact, without transformations applied. The whole font data stream is then compressed with brotli.
You can't just flip a flag.
from woff2.
Hi @anthrotype I ended up running into the same issue and set allow_transforms
to false
in source but that didn't seem to fix the issue. Is there more that needs to be done on top of doing that?
from woff2.
i'm not sure actually. Maybe @rsheeter knows?
from woff2.
I bumped onto this issue just today, when trying to use the Inter font hosted by Google Fonts.
Seeing that the original font has no issues (rsms/inter#302), I think this is somethin that needs to be addressd from Google's end... Any updates on this?
from woff2.
Relevant filed issue in Google Fonts repo issues: google/fonts#2602
from woff2.
Related Issues (20)
- Build failed on Pop_os HOT 1
- Pre-compiled binaries for Windows? HOT 1
- Yahoo is now HOT 1
- How to I compile Windows x64 binaries either on Windows 10 or Ubuntu WSL2? HOT 4
- Silent woff2_decompress failure? HOT 7
- build a static link executable
- fix README.md for https://github.com/google/woff2/tree/master#build
- make woff2_compress less verbose
- Can't uninstall.
- Compres multiple .ttf HOT 4
- Google cc+
- command not found: woff2_compress HOT 1
- Compress glyf table generically if it fails specifically HOT 1
- Windows binary? HOT 3
- Parsing of the input font failed. HOT 4
- 🔥 Windows Version
- Web version with progress bar support HOT 1
- Daniela's HOT 1
- Compressing a variable TTF to WOFF2 suffixes font name with lightest weight
- OSS-Fuzz issue 65939 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from woff2.