epinter / tqrespec

TQRespec - The respec tool for Titan Quest game
https://steamcommunity.com/sharedfiles/filedetails/?id=1262483108
GNU General Public License v3.0
106 stars 10 forks source link

Font with cyrillic support and/or language setting #53

Closed gievepix closed 2 months ago

gievepix commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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

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

gievepix commented 3 months ago

I can confirm, this build works for me too.

epinter commented 3 months ago

I can confirm, this build works for me too.

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