The FreeType Project - Bugs: bug #59026, Multi-weight TTF of font...
You are not allowed to post comments on this tracker with your current authentication level.
bug #59026: Multi-weight TTF of font "Cascadia Code" renders artifacts on some glyphs
Submitter: | Ronan Jouchet <ronjouch> | ||
Submitted: | Fri 28 Aug 2020 12:33:19 AM UTC | ||
Severity: | 3 - Normal | Item Group: | Incorrect behaviour |
Status: | Works For Me | Privacy: | Public |
Assigned to: | None | Open/Closed: | Closed |
Planned Release: | 2.10.3 |
Jump to the original submission
Sat 12 Dec 2020 11:01:48 AM UTC, comment #14: |
Anonymous |
Wed 09 Dec 2020 01:56:51 PM UTC, comment #13: For most people, TrueType is a font format as described by specifications. The 4x4 oversampling or any other kind of anti-aliasing is not described there and people try new algorithms, GPU and CPU optimizations, distance fields, etc. The anti0-aliasing quality today is much more dependent on gamma correction or contrast adjustment.
|
Alexei Podtelezhnikov <podtelez> |
Wed 09 Dec 2020 07:29:52 AM UTC, comment #12:
|
Anonymous |
Tue 08 Dec 2020 02:56:57 PM UTC, comment #11: If you expect bit-identity between GDI and FreeType smooth, first you need to acknowledge that 4x4 produces 16 gray levels while FreeType outputs 256 levels. So at the very least, you should only compare top 4 bits. Then I would permit one-off for occasional rounding, keeping in mind that it is hardly visible to a naked eye.
|
Alexei Podtelezhnikov <podtelez> |
Tue 08 Dec 2020 01:17:29 PM UTC, comment #10:
|
Anonymous |
Mon 07 Dec 2020 02:26:07 PM UTC, comment #9: The 4x4 oversampling costs at least 4x more to render.
|
Alexei Podtelezhnikov <podtelez> |
Mon 07 Dec 2020 11:04:34 AM UTC, comment #8: No, I use four times four oversampling in TD renderer and never have an issue. |
Anonymous |
Sun 06 Dec 2020 03:11:45 PM UTC, comment #7: FreeType now appreciates explicit warning flags OVERLAP_SIMPLE and OVERLAP_COMPOUND flags. Please use them. |
Alexei Podtelezhnikov <podtelez> |
Sun 06 Dec 2020 09:33:09 AM UTC, comment #6: The smooth engine in FreeType should be avoided for many reasons including glitching like this caused by unsupported dropout control and unsupported overlaps. This would never be an issue with the bilevel renderer. Four times four oversampling should do it (as long as gasp allows anti-aliasing and v35 mode is used), and it is up to the FreeType implementor to implement it as it is out of scope for FreeType, because FreeType is mainly a font reading library, and the extra stuff like the bytecode interpreter and rasterizer are not meant to be taken seriously. |
Anonymous |
Sat 26 Sep 2020 06:35:03 PM UTC, comment #5: Please do not implement different methods depending on the glyph data. Having different glyphs render inconsistently leads to text that is uncomfortable to read.
|
Anonymous |
Fri 28 Aug 2020 03:49:39 PM UTC, comment #4:
|
Ronan Jouchet <ronjouch> |
Fri 28 Aug 2020 03:17:12 PM UTC, comment #3: Please read about OVERLAP_SIMPLE and OVERLAP_COMPOUND in OpenType Specifications. On one hand in variable fonts, "use of this flag is not required in OpenType". On the other hand in static fonts, "either set this flag in the derived glyph data, or else should merge contours to remove overlap". Hopefully, the next version of the specs will recommend these flags in variation fonts just to be consistent.
|
Alexei Podtelezhnikov <podtelez> |
Fri 28 Aug 2020 02:31:03 PM UTC, comment #2: Thanks for the fast feedback, Alexei.
|
Ronan Jouchet <ronjouch> |
Fri 28 Aug 2020 01:14:43 PM UTC, comment #1: You correctly identified the issue: overlapping contours can produce pixels with inflated coverage because FreeType normally integrates the coverage. To mitigate the artefacts, oversampling is necessary (increase resolution 4x4 and average the results).
|
Alexei Podtelezhnikov <podtelez> |
Fri 28 Aug 2020 12:33:19 AM UTC, original submission:
This is a followup of Cascadia Code bug "[linux + VariableTTF-specific]
|
Ronan Jouchet <ronjouch> |
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 8 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2020-12-06 | podtelez | Status | Confirmed | Works For Me | |
Open/Closed | Open | Closed | |||
Planned Release | None | 2.10.3 | |||
2020-08-28 | podtelez | Status | None | Confirmed | |
2020-08-28 | ronjouch | Attached File | - | Added cascadiacode-1-bad-multiTtfBundle.png, #49715 | |
Attached File | - | Added cascadiacode-2-ok-singleTtfRegular.png, #49716 | |||
Attached File | - | Added cascadiacode-3-animation.gif, #49717 | |||
Attached File | - | Added cascadiacode-4-glitches-detail.png, #49718 |
Powered by Savane 3.13-02a9.
Corresponding source code
comment #13:
TD renderer already has gamma-correct four times four oversampling. The contrast adjustment is most likely an artificial render distortion (like incorrect gamma is) and depends on the renderer but in DirectWrite should be set to 0 (false) because true values distort the gamma. Classic GDI is always gamma correct. ClearType GDI has a gamma setting with no contrast. Neither oversampling nor gamma is in the scope of FreeType, however, so the FreeType implementor is encouraged to properly implement both to have anti-aliasing.
There is no progress necessary. However, one could progress from most FreeType implementations by ignoring pixels beyond font height boundaries (unsigned Win Ascent and unsigned Win Descent), disabling the subpixel mode, implementing four times four oversampling, etc. .
An example is that I made a smooth filter that preserves sharp edges, yet it won't see practical use in my TrueType rendering process because while better than FreeType box filter in the smooth renderer, it is worse than four times four oversampling. I have concluded that it does not get much better than bilevel renderer and four times four oversampling. It is much more satisfying to have a fully functional and compatible free software renderer than excavating the unknown.