-
Notifications
You must be signed in to change notification settings - Fork 4.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
Incorrect text position in menu [ImGUI] #77297
Comments
Only gave it a cursory glance, but it looks like #76529 changed it so the font is set only after the wrap width is calculated. That means it's calculated for the wrong font and thus wrapping in the wrong place. |
A temporary fix is to switch ImGui font to terminus. |
#76513 fixes the wrapping. Fixing the gravestone will be easy enough; we have a monospaced font for just that purpose. |
because ascii art. Also, vertically align the “Last Words:” label in front of the textbox, so that the baselines of the two are lined up. Partially fixes CleverRaven#77297
While I personally dislike the move to ImGui, at the very least it needs a load option to set the font size. It uses the same font size of the standard font for the ImGui font, that in almost all cases produces very blurry and very badly scaled fonts in all ImGui panels. This is especially a mess because the main game takes bitmap fonts that aren't easily converted to truetype fonts. And truetype fonts look terrible without a very precise scaling that matches the bitmap. |
I don’t think that’s true. If it is, file a bug report of your own and show us your configuration, screenshots, etc. |
Scaling issues might be fixed by setting font blending to true in Settings > Graphics > font settings and restart the game. It's set to false by default for some reason. |
I don't think font blending affects ImGui, and I had it disabled anyway. This is a quick test. Take for example an "official" screenshot from here: https://github.com/ocornut/imgui/blob/master/docs/FONTS.md As you can see it's very sharp, and it's loaded at size 13. Since it's monospace and looking fine, I decided to try it on Cataclysm. This is how the same font looks in Cataclysm (name of the font is different, but the source is the same, I just changed the name to switch faster configs): But it's the same even for the currently embedded fonts. This is is using Unifont: And it is indeed crisp. But if you change the size... At size 18 it exhibits some corruption. As I said, truetype fonts will only look fine at certain sizes, there needs to be a way to be able to give them a size different from the main game font, since the two follow different rules. As a confirmation to what I'm saying, this is the same font that looks blurry above, in the same Cataclysm version: The reason why this looks crisp is because this font is built for size 13, if you change it, it becomes a mess. But if I wanted to use it in Cataclysm, I cannot. Because I use a different font size, and there's no way to customize the two to what they need to be to look readable. |
I think that's an issue with the version of unifont shipped with the game (v.12). I get the same bad rendering at 18px even in other applications. I get a better result with (OpenType unifont v16 ). Truetype unifont v12: Opentype unifont v16: |
Two things: file a separate bug report for font stuff, because it has nothing to do with this bug! Secondly, you should not care how unifont looks. The goal of unifont is to have a glyph for every character in Unicode, not for the glyphs to look good. It doesn’t have hinting tables, or ligatures, or shaping tables, or anything. Just one glyph per character. It is only intended as a fallback. You should pick a font that you actually like at your chosen font size. We can add more control over size, hinting, anti–aliasing, and so on at a later date, but fundamentally you just need to pick a nicer font. |
No, it's not related to the font. Different fonts, depending on how they are originally built, look well at their native resolution and poorly when scaled. I made the example using ProggyFont (and as you can see opentype at size 16 already looks blurred, look at those s, l and w, that's hideous). And yes, I COULD pick a font I actually like at the size I need, or just load the font at the size I need, which was the original request that makes the most logical sense. But if you can find a monospace font that is rendered correctly at size 16, then tell me. I spent a few hours without luck. Using a non monospace font for a grid-based UI is not going to work unless you really enjoy having everything misaligned. See the t of throw or r of reload all shoved to the left of that column of shortcuts. You either have a sensible eye to the correctness of good UI design and alignment or not. Some people I guess won't even notice. But I think everyone at a glance will agree that the first example looks a lot better and is easier to read. Beside the second example (default) also taking more screen space for doing a worse job, which will be a very big problem once you do the same treatment to the sidebar and other panels where vertical space is precious. Before you ask, I did try converting and loading the same font. I wasn't quite successful. I hope we can agree this needs a better solution. |
This is simply not true. TrueType fonts are vector fonts, and will look just as good at any size (above a sensible minimum font size; nothing looks good when 2px high). If the font you’re using doesn’t look good at 16px or whatever, then choose a different one.
We’re not doing that. The ASCII art remains monospaced. We can right–align that column of shortcuts if you want, or use monospace for that column. Or we can challenge ourselves to think of an even better UI. |
Before replying to this issue I already had spent a few hours trying to find a solution. I tried more than 20 fonts. I tried converting fonts, I tried editing them in FontForge. As I said, if you have a monospace font that looks good at size 16, then I gladly accepts suggestions. But if I can, I'd rather use the same good looking font everywhere, as long I can load the correct size. |
I can confirm the same issue in the latest CDDA experimental build (2024-11-03-2221); it also affects the rendering of the action bar at the top of the screen, as shown below. Moving the mouse while the action bar is displayed temporarily resolves the issue, but the problem reappears as soon as another action triggers the rendering of the action bar again. I've noticed that the latest build also cuts off the item description, as previously reported. I’m adding the action bar issue here as well, as I believe both may stem from the same underlying problem. I can confirm that setting
The bug appears to have been introduced sometime after experimental build 2024-10-24-0244. When rolling back to this version, the text/menu wraps properly when using other fonts. I hope this helps narrow down the cause. |
As already mentioned, there is already a pull request that fixes the text wrapping. |
Thanks mate, sorry I only noticed the PR after your comment. I do see that the merge got blocked due to checks failing on the Text Changes Analyzer with Error: Process completed with exit code 1. Pretty sure you know about this already, but thought I would mention it. |
because ascii art. Also, vertically align the “Last Words:” label in front of the textbox, so that the baselines of the two are lined up. Partially fixes #77297
Describe the bug
I open item description and text trying to hide for me.
I try to make fully clean game without old saves and config files and have same situation.
Attach save file
N/A
Steps to reproduce
Expected behavior
Can read and text not trying to escape :)
Screenshots
Versions and configuration
Windows 10 24H2
cdda-experemental-2024-10-24-1253 2d90bfe
English, Russian
Default mod configuration
Additional context
No response
The text was updated successfully, but these errors were encountered: