-
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
Cata ImGui can't get font size of zh_CN correctly #78837
Comments
What fonts are configured in your fonts.json config file? |
Also, if you could go the main menu → settings → ImGui Demo Screen, then select the from the Tools menu → the Style Editor. In the Style Editor there is a tab for Fonts. If you expand the first level of details for the two fonts, it will tell you exactly which font files it used for each of them. And if you show the font atlas, you’ll be able to see all of the characters that ImGui can draw without help. A screenshot of that information would be very helpful. |
Totally vanilla and both 4 options in config/fonts.json are same(default) like: "typeface": [
"data/font/Terminus.ttf",
"data/font/unifont.ttf"
], For the screenshot, I am sorry that I'm not at home now and for my mobile phone(Android) seems impossible to use Imgui Demo Screen. I'll send screenshot later when I got home. |
Ok, so your Can you try editing the |
Can you show me more detail? I need to see the font details, the font atlas, and the rendering problems all for the same font at the same time. Show them all in the same screenshot if you can, or just group the screenshots together in a logical way. Try picking a single one of those fonts, then taking a screenshot with the font settings and glyph atlas visible, then another with the bug visible. It would be best if you could show the whole game window rather than cropping it down; I am having trouble reproducing the problem locally and it might just be because I am looking at a different thing than you are. |
I had the font mixing problem as @EliadOArias too, and I think it's caused by configuration in both |
Ok. You still didn’t show the font atlas, and you cropped everything when I asked you not to, but maybe I understand. I think the fonts you’re choosing still don’t have all of the necessary characters. For example, look at the item info in the second screenshot. The name on the first line ends with “(井)”, but that character is larger than most of the others. I think the font you chose doesn’t have that character, and it is falling back to a different font with different metrics. Go to the style editor and look for that character. It’s character number 0x4E95, so expand the font settings until you see the 4E00…4EFF block and see if 4E95 has a glyph there. If not, then we know it is a replacement character. In your last few screenshots you’re using only fonts that have no Chinese characters, so every Chinese character is using the fallback path. So it miscounts the size of every single character. |
Well Chinese characters are way more than a screenshot can show, with over 20000 characters in unicode, there are also simplified and traditional, I don't think the atlas can show all of them, and I don't think any Chinese font will be missing characters like “这”“几”“腿”“盖”...... maybe you can try using the same font as I did in my screenshot which is Dengb.ttf (等线 粗体) so we could compare. |
Yes, it is a lot but computers can count that high.
Can you double check? That is character 8FD9. It’s missing from mine, as you can see: I am hovering over 8FD4 which is the nearest glyph that I do have. On the other hand, this font does have 4E95: |
base typeface( Yell a sentence ):
It seems imgui calculate gui_typeface font in a small way, and when something wrong happen, it use base typeface, which is calculated in a big way. Though they are same font "NotoSansSC-Regular.ttf", they were displayed differently, while base game have big only, imgui mix big and small. To prove all of them is not system font, here is a comparision:
Besides, I check font_loader.cpp and find fontdata.json is actually not working when we have font.json. Here is: |
Describe the bug
Cata ImGui can't get font size of zh_CN correctly, which is one time wider then English font .
Attach save file
N/A
Steps to reproduce
Expected behavior
Works as normal fonts do.
Screenshots
So bad.
Versions and configuration
[dda],
[no_npc_food],
[personal_portal_storms],
[no_fungal_growth]
]
Additional context
No response
The text was updated successfully, but these errors were encountered: