-
-
Notifications
You must be signed in to change notification settings - Fork 20k
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
Kerning Pairs (monospace image font) can affect the kerning of subsequent characters, off by one pixel #93199
Comments
The issue seems to be how HarfBuzz apply kerning, half is applied to the previous glyph advance, half to the next glyph offset. This works with normal fonts, but with |
@bruvzg thanks for working on such quick fixes for this feature! As someone relatively new to Godot, I really appreciate it! |
@capnm That deletes the kerning pairs, thus removing character specific kerning entirely. This bug report is about the usage of the kerning pairs feature itself. |
Kerning pairs for monospace fonts? This is IMO a bug – you shouldn't use kerning here at all. |
The datatype will probably be renamed to bitmap image fonts or such since this feature allows them to no longer be exclusively monospace. |
I thought you also needed the *.fnt file for kerning the bitmap files? No? |
You can manually specify kernings and custom glyph offsets/advanced in the image import settings, importer should be renamed it was monospace when it was first added, but this is no longer the case. The source image is expected to be uniform character grid (you can't specify arbitrary rect for the character), but the font itself is not monospaced. |
I guess that's then the implemented spec... bmfont -> Block type 5: kerning pairs |
Tested versions
System information
Godot v4.3.beta1 - Windows 10.0.22631 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3050 (NVIDIA; 31.0.15.5176) - AMD Ryzen 7 2700 Eight-Core Processor (16 Threads)
Issue description
When using kerning pairs, the space between two characters can be affected by the character that came before them. It appears there is some kind of rounding layout issue, not sure if this is a bug in kerning or in the rendering pipeline.
In the example, A and B have different kerning offsets when followed by p. The space between u and p then differs between them.
Steps to reproduce
Open the project and the layout issue is visible in the main scene for preview and run.
Note that this affect can be achieved by changing things like character margins as well to generate inconsistent layouts.
Minimal reproduction project (MRP)
kerning_layout_issue.zip
The text was updated successfully, but these errors were encountered: