-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid character spacing #7765
Comments
This looks like a duplicate of #4483, partially related to #7747 and #6871 as well. font = ImageFont.truetype(noto, 12, layout_engine=ImageFont.Layout.BASIC) To explain a bit: Pillow can use different methods to compute the positions of glyphs used when rendering text. BASIC layout simply converts character values directly to corresponding glyphs and sums their offsets. RAQM layout uses the libraqm library (which supports more advanced text layout and is recommended for all non-English text) to compute glyph mappings and positions. While BASIC layout rounds the current offset to an exact pixel after each glyph, RAQM layout doesn't seem to do this and IIRC libraqm did not support this at all when I tried it in the past. However, I would not call this a bug, just a different approach to the same problem -- making sure glyphs are rendered at exact pixel coordinates to avoid artifacts. |
Yes, thanks a lot! The following line reproduces the 9.1.1 behavior. This is not related to the issue, but can you tell me if there is a solution to the problem of subpixel rendering of shapes such as |
See #5577 (comment) |
What did you do?
Switched project development from openSUSE global Python environment to a virtual environment.
What did you expect to happen?
No changes in font rendering.
What actually happened?
Wrong font spacing appears. This results in uneven letter spacing and uneven alignment. Seems quite similar to #3977
I checked with different TrueType fonts, the problem persists.
There is confirmation that others in the virtual environment have the same render. And the problem has persisted for more than a year.
No bug on 9.1.1 and earlier ones.
On 9.2, the bug behaves a little different: rounding seems to be changed to the other side, and the effect sometimes disappears.
What are your OS, Python and Pillow versions?
Comparison of the bagged and not-bagged test results:
The impact of this bug on the project looks like this:
The text was updated successfully, but these errors were encountered: