Skip to content
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

Mispositioned diacritic marks #49224

Closed
Teashrock opened this issue May 31, 2021 · 7 comments
Closed

Mispositioned diacritic marks #49224

Teashrock opened this issue May 31, 2021 · 7 comments

Comments

@Teashrock
Copy link
Contributor

Teashrock commented May 31, 2021

Godot version:
3.3.2 Stable Mono Custom build

OS/device including version:
Windows 10 x64 1809

Issue description:
I used RichTextLabel with the custom font named Alegreya Regular for my project and at some moment I decided to change the custom font of it to more fine-looking. The issue is when I changed it, the diacritic marks of words was shifted to the right. So, even if the diacritic mark is above the last letter, it will be literally dangling in the air.
Here's the example word:
image
This is how it looked before changes (the font is Alegreya Regular):
image
This is how it looks after the font change (the font is Lora Regular):
image
One should have in mind that I tried to type the same word with the same font in LibreOffice. It looks like this:
image
So it's definitely not a font bug. It's a bug of something that renders it.

For comparision: I tried to really move the diacritic mark in the word. Results is below.
The text:
image
Same text in LibreOffice:
image
Same text in Godot's RichTextLabel:
image
As you can see on the last screenshot, the diacritic mark is not on it's place.

Steps to reproduce:

  1. Add RichTextLabel.
  2. Set Lora Regular as the custom font of it.
  3. Type some text with diacritics in the "Text" field.
  4. See the bug.

WARNING: for the bug to be reproduced, the diacritic marks should be separate from letters. If you would type a text where each diacritic mark is an inseparable part of the letter, the bug won't show up.
Example:
image
image
image

Minimal reproduction project:
Diacritic Bug Test.zip

@akien-mga
Copy link
Member

CC @bruvzg

@Calinou
Copy link
Member

Calinou commented May 31, 2021

I can confirm this on 3.3.2 on Linux:

image

Therefore, the bug isn't Windows-specific like #23093 is on 3.x.

This is also not exclusive to RichTextLabel. RichTextLabel on the top, Label on the bottom:

image

@Teashrock
Copy link
Contributor Author

Update: It's the same in a simple Label.
image

It's not a bug in RichTextLabel.

@bruvzg
Copy link
Member

bruvzg commented May 31, 2021

It's a Godot font handling limitation, fixed in 4.x by the complex shaping. With the 3.x font implementation, which is drawing each glyph individually it's highly unlikely this can be fixed.

4.x:

Screenshot 2021-05-31 at 16 29 22

@Teashrock
Copy link
Contributor Author

@bruvzg
Can we backport the complex shaping to 3.x?

@bruvzg
Copy link
Member

bruvzg commented Jun 2, 2021

Can we backport the complex shaping to 3.x?

It's part of the huge set of changes, which involves breaking API and binary compatibility with GDNative plugins. Backporting is possible (I have an incomplete and a bit outdated backport here - https://github.com/bruvzg/godot/tree/ts_32), but it won't happen for the official 3.x releases.

@Calinou
Copy link
Member

Calinou commented Nov 6, 2021

Closing, as this is fixed in master and can't be fixed in 3.x without breaking compatibility with existing projects.

@Calinou Calinou closed this as completed Nov 6, 2021
@Calinou Calinou added this to the 4.0 milestone Nov 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants