WerWolv / ImHex

🔍 A Hex Editor for Reverse Engineers, Programmers and people who value their retinas when working at 3 AM.
https://imhex.werwolv.net
GNU General Public License v2.0
45.23k stars 1.97k forks source link

[Bug] Using Pixel-Perfect default font breaks Russian letters #1961

Open Lemon4ksan opened 6 days ago

Lemon4ksan commented 6 days ago

Operating System

Windows

What's the issue you encountered?

When using Pixel-Perfect default font, Russian characters are much larger than other ones. image

How can the issue be reproduced?

I've discovered this issue when I tried to translate the app, but it can also be reproduced by typing any Russian characters in search field or by opening files with Russian names on stable version 1.35.4. Letters display correctly if "Pixel-Perfect default font" option in Fonts settings menu is disabled. This option is on by default, so it's surely unintended. image

ImHex Version

1.36.0.WIP, 6d14b3f6bdeec09894d10401536f8f0232d68c17

ImHex Build Type

Installation type

Msys64 build

Additional context?

No response

paxcut commented 2 days ago

When using Pixel-Perfect default font, Russian characters are much larger than other ones.

The default font (a pixel perfect font called Proggy Clean) only defines ASCII Latin letters. For the rest of the letters ImHex uses a different font called Unifont. What you are seeing is the well known fact that at the same font size both fonts appear different in size. The difference is not restricted to Russian (Cyrillic) letters only, but to every non-Latin letter. This cannot be fixed in the sense that font makers have complete control on the design of their products and the fonts cannot be scaled to have similar size without them becoming blurry.

This bug can be solved by disabling "Pixel-Perfect default font" option in Fonts settings menu. This option is on by default, so it's surely unintended.

When you disable the "Pixel-Perfect default font" option, you are switching the font ImHex uses from the default font to another mono-spaced font called Firacode which defines Latin and non-Latin letters, so there are no size differences between Latin and non-Latin letters. The Firacode font doesn't look as good as the default font for Latin letters so it is not a good choice as default font.

The underlying problem is un-fixable and unavoidable. ImHex is based on Dear ImGui which lacks features for font rendering that makes the text look ugly even if you use your favorite font, so the choices for default fonts are limited.

Lemon4ksan commented 2 days ago

Thanks for the explanation. I think there should be at least a warning about it. It took me quite some time to figure out why it is like that.