Prevent Anti-Aliasing of Embedded Bitmap Fonts on Linux
Categories
(Core :: Graphics: Text, defect)
Tracking
()
People
(Reporter: zhangboyang.id, Unassigned)
Details
Attachments
(4 files)
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0
Steps to reproduce:
-
Install the 'WenQuanYi Zen Hei Sharp' font. On debian/ubuntu, the commandline is
apt install fonts-wqy-zenhei
-
Please test this page
<pre style="font-family: 'WenQuanYi Zen Hei Sharp'; font-size: 16px">HelloWorld ABCDEFG 1234567 16px</pre>
<pre style="font-family: 'WenQuanYi Zen Hei Sharp'; font-size: 15.5px">HelloWorld ABCDEFG 1234567 15.5px</pre>
<pre style="font-family: 'WenQuanYi Zen Hei Sharp'; font-size: 15px">HelloWorld ABCDEFG 1234567 15px</pre>
Actual results:
The line in the middle (15.5px) is blurry. It seems the bitmap glyph is scaled.
Expected results:
The line in the middle (15.5px) should fallback to nearest font-size and be pixel perfect.
Reporter | ||
Comment 1•2 years ago
|
||
Reporter | ||
Comment 2•2 years ago
|
||
Reporter | ||
Comment 3•2 years ago
|
||
This bug also affects the UI of firefox. The text on UI is blurry, too. This problem doesn't exist in the old gfx.xrender.
The 'WenQuanYi Zen Hei Sharp' is a scalable font with embedded bitmaps. Similar fonts like 'SimSun', 'MS Gothic' is also affected.
Comment 4•2 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Layout: Text and Fonts' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 5•2 years ago
|
||
The severity field is not set for this bug.
:dholbert, could you have a look please?
For more information, please visit auto_nag documentation.
Comment 6•2 years ago
|
||
So, if it's a scalable font, but with embedded bitmaps, disabling embedded bitmaps at system-level may just resolve this.
This confers the advantage of not falling back to nearest sizes (Which I imagine we did, instead of scaling and then anti-aliasing) as well.
Reporter | ||
Comment 7•2 years ago
|
||
(In reply to David Shin[:dshin] from comment #6)
So, if it's a scalable font, but with embedded bitmaps, disabling embedded bitmaps at system-level may just resolve this.
This confers the advantage of not falling back to nearest sizes (Which I imagine we did, instead of scaling and then anti-aliasing) as well.
Thanks for replying. Disabling bitmap fonts can be a workaround to this problem, but there are many people prefer bitmap fonts, especially for East-Asian scripts, because East-Asian characters are complex and bitmap fonts can improve readability greatly. So I think we'd better fix the problem.
I tested the same font on Firefox/Windows, and it doesn't have the problem. Old Firefox/Linux versions using xrender also doesn't have this problem. It seems only Firefox/Linux (with WebRenderer) is affected. (macOS is not tested, though)
On the other hand, Chrome/Linux and Chrome/Windows also don't have this problem.
Comment 8•2 years ago
|
||
[...] especially for East-Asian scripts, because East-Asian characters are complex and bitmap fonts can improve readability greatly. [...]
Haven't thought of that - thanks. Confirmed the rounding behaviour on Windows.
Updated•2 years ago
|
Updated•10 months ago
|
Description
•