Comments (7)
@rsheeter The decision to transform or not transform the hmtx table happens algorithmically. In my opinion it would only make sense to add a flag for disabling the transformation rather than enabling it, since forcing the transformation shouldn't have much of an effect.
On that note, were you able to find any fonts for which woff2 transforms the hmtx table? The comments in the code say something to the effect of "most fonts have transformable hmtx tables," but I haven't been able to find even one.
from woff2.
I may be missing something here but I don't think there is a flag in WOFF2 that is forcing the transform. When it comes to 'hmtx' table, there are two sets of flags that are relevant - the table directory flags that indicate whether the transform has been applied, and what kind of transform [which is relevant only for certain tables], and the flags in the transformed 'hmtx' table data that tells you which array of data needs to be reconstructed.
The woff2 encoder makes all decisions regarding the hmtx transform, and if the transform is both applicable and desired (which means it can be completely disabled in the encoder) - only then the transform is applied. It depends on the actual hmtx data, so even if transform is enabled but the table data cannot be algorithmically reconstructed - the transform won't be applied.
from woff2.
@vlevantovsky yes, that's my understanding as well :)
Now that I think about it a little more however, there might be a use case for forcing the transform, i.e. for debugging purposes. I haven't been able to find a single font (of the thousands I have on my computer) for which woff2 transforms the hmtx table, so I haven't been able to test my ruby implementation against any real-world examples. Forcing the transform could help me in that regard.
from woff2.
I doubt it's even possible to 'force' the transform. You can disable it completely, but enabling the hmtx transform is literally only a permission to apply it - the end result is totally dependent on the font data itself. If the font is created in such a manner that hmtx values cannot be algorithmically reconstructed from other data structures, the transform cannot possibly be applied by force.
from woff2.
@vlevantovsky The testing I'm referring to would be more to validate that my implementation can read the binary packed format of the transformed table rather than checking the table for conformance.
from woff2.
We do have test cases for this.
from woff2.
@vlevantovsky awesome, thanks for the resource!
So, something interesting I noticed today: it looks like the TransformHmtxTable
function is never called? I submitted a PR here: #120
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.