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

Font with cyrillic support and/or language setting #53

Open
gievepix opened this issue Jun 22, 2024 · 13 comments
Open

Font with cyrillic support and/or language setting #53

gievepix opened this issue Jun 22, 2024 · 13 comments

Comments

@gievepix
Copy link

After reinstalling windows I realized that TQRespec now picks language automatically from system settings, so it's russian now (been using english as system language before). Can't say I'm a fan of replacement font it uses for cyrillic symbols:
image
Would it be possible to get version of Albertus font with cyrillic support? Or, better, but not mutually exclusive, add an option to change app language in settings?

@epinter
Copy link
Owner

epinter commented Jun 22, 2024

Something happened with the font in recent update, I didn't test Russian... I will see what I can do. The application language is read from game language configuration. If you change your game to English (options.txt, language setting), TQRespec with open in english. Thanks for reporting.

@gievepix
Copy link
Author

Weird, because I play TQ in english... Even more weird is that language setting in options.txt was empty. Changed language in game settings to russian and then back to english, now it says "English", but TQRespect still runs in russian.

@epinter
Copy link
Owner

epinter commented Jun 22, 2024

This build should help. I won't publish yet because I need to fix a small issue with window resizing/scaling, but I won't change anything more regarding to the fonts. This build tries to load fonts from game files and use "Albertus MT" font. If the game is not available, fallback fonts are used. For Russian and some other languages, system sans-serif is always used.

https://1drv.ms/u/s!AqbcmbBetf3hgw07HIUTn4lFFLQV?e=AgWC4c

@gievepix
Copy link
Author

Well, I don't know if there was anything done about how application chooses the language, but this build still uses russian with super wide fallback font, disregarding game settings. And only after I changed system language to english, TQRespec finally started using it too.

Hm, I had version of Albertus with cyrillic support, but it's "medium", so numbers are a bit wider than MT, while text is virtually the same. Still, I wonder if it would help to improve readability for russain text?

@epinter
Copy link
Owner

epinter commented Jun 29, 2024

Russian language is not using albertus, and the language is not read from system, it's read from game options.txt. If the game language is not available, then english is used, I don't use system language. This is what I get when I change options.txt to Russian.

image

EDIT: When the Russian language is set in options.txt, TQRespec uses the font family"sans-serif", the font is chosen by Java Virtual Machine, it uses a font from the system. When English or any other language supported by latin charsets, then Albertus-MT is used from game. If Albertus-MT can't be loaded, then the fallback is used, a font called Marcellus. When you first reported, I was getting the super wide font in Russian language, now I'm unable to reproduce anymore. But I can try to replace the font for Russian language and see if it works for you, but I will need you to test.

@gievepix
Copy link
Author

I just did another test on build above, and now when system language is set to english, TQRespec indeed uses language from options.txt, and while russian fallback font isn't exactly the same as on your screenshot, it's very close and indeed readable. Well, I should've checked this before commenting.

So this is something about OS itself (Windows 10, if it matters) and language pack? If setting its language to russian somehow makes TQRespec also use it regardless of game settings, and with wrong fallback font.

And sure, if you come up with something, I can test it.

@epinter
Copy link
Owner

epinter commented Jun 29, 2024

I just did another test on build above, and now when system language is set to english, TQRespec indeed uses language from options.txt, and while russian fallback font isn't exactly the same as on your screenshot, it's very close and indeed readable. Well, I should've checked this before commenting.

So this is something about OS itself (Windows 10, if it matters) and language pack? If setting its language to russian somehow makes TQRespec also use it regardless of game settings, and with wrong fallback font.

And sure, if you come up with something, I can test it.

I think the font chosen by Java VM it's not good for Russian... I will search for a open/free font with support and try to build with it.

@epinter
Copy link
Owner

epinter commented Jun 29, 2024

Try this build. If it still looks weird, send me the tqrespec.log found in your user appdata %TEMP% directory.

https://1drv.ms/u/s!AqbcmbBetf3hgw6lGRh28ULrSR9D?e=0gMnOX

@gievepix
Copy link
Author

Changed system language back to russian. So, TQRespec finally somehow reacts to change in language setting in options.txt, but only works properly if game language is set to russian (i.e. finally proper font everywhere, no sign of Albertus). With game language set to english UI is still in russian, but tries to use Albertus again, with wide fallback font.

Log for the latter:
tqrespec.log

@epinter
Copy link
Owner

epinter commented Jun 29, 2024

This is weird. Looking the log there's no sign of Russian language being used (look the "Application language set to 'en'", I show this line when English is detected in options.txt). The Albertus MT font is being selected because the application language is set to english based on options.txt, but somehow the JVM is considering Russian language, it shouldn't because I never use system locale. I will look if there's something that changed in newer JDK, as far as I remember, older versions didn't have this behavior. Thanks very much for you help and patience, I will try to reproduce myself and investigate.

@epinter
Copy link
Owner

epinter commented Jun 29, 2024

I was able to reproduce and fix the problem, this build worked for me:

https://1drv.ms/u/s!AqbcmbBetf3hgw8gQv9sWOlWtNvN?e=uRKyka

@gievepix
Copy link
Author

I can confirm, this build works for me too.

@epinter
Copy link
Owner

epinter commented Jun 30, 2024

I can confirm, this build works for me too.

Thank you very much for reporting and helping with testing !! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants