Add support for COLRv1 fonts #114
#115 adds a check for COLRv1 fonts, and rejects/skips (i.e. use the next fallback font instead) them. This at least fixes an issue where COLRv1 fonts caused "nothing" to be rendered.
What about addressing this by going all-in with using HarfBuzz, which supports COLRv1 since 13.0? Remove both the nanosvg and librsvg backends and let HarfBuzz handle all color glyphs: COLRv0, COLRv1, SVG, bitmap.
Foot, Fuzzel, and Fnott all aready use HarfBuzz.
@cglogic, why the downvote for solving this with HarfBuzz?
@markstos wrote in #114 (comment):
@cglogic, why the downvote for solving this with HarfBuzz?
First, read project description: A simple library for font loading and glyph rasterization using FontConfig, FreeType and pixman. Do you see HarfBuzz?
Second, HarfBuzz is a huge dependency. In the latest version they even added GPU side rasterization, if I remember correctly.
@cglogic Harfbuzz is already a dependency for fcft when packaged for Arch Linux, Debian and other distros. Are you using fcft in situation where the Harfbuzz features are not enabled?
Harfbuzz is already conditionally used in 29 places in fcft, so accepting it as hard dependency would be a significant simplification and align with the reality that most people are already using fcft build with harfbuzz as a dependency.
I learned some about the COLRv1 spec, and it looks like a huge effort to support it directly in fcft.
Foot, Fuzzel, and Fnott all aready use HarfBuzz.
This is incorrect; none of them have a direct dependency on HarfBuzz. They can use the font shaping capability that comes with a harfbuzz enabled fcft build. But they do not use harfbuzz themselves.
"My" projects aren't the only ones using fcft, and making harfbuzz a required dependency is not something I'm considering.
I would like for fcft to have COLRv1 support without requiring harfbuzz. Worst case, we provide optional COLRv1 support, when built with harfbuzz support enabled. From a quick look at its rasterizer API, it does appear to be possible to use FreeType managed fonts with it (that's good), but the rasterizer still needs us to implement the drawing primitives (at a minimum, lines and cubics).
All in all, we're not gaining that much by using harfbuzz' rasterizer. Right now, I consider it worthwhile to try to support COLRv1 by ourselves, without harfbuzz. That is, continue to, optionally, depend on harfbuzz for its shaping functionality - nothing else.
(at a minimum, lines and cubics).
It appears to be much more than that actually. Those were the draw functions. You also need to implement paint functions. These are, for example, all the gradiants used in COLRv1.
In short, "all" harfbuzz will do for us is parse the COLRv1 tables and translate to mid-level paint operations.
I already have the parsing done in an fcft branch. All that's left is the paint operations. So harfbuzz gives us nothing. Assuming my 5 minute read of the harfbuzz documentation is correct...
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?