Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Text rendering error under CJK system locale #7511
Version of OpenTTD
All version above 1.9.0-beta1
(Did't tested Win10 RTM ~ RS1 due to not supported by MS anymore)
Steps to reproduce
Execute OpenTTD 1.9.1 on Korean version of Windows(below Win10 RS5)
All systems above used config file from Here, which bundles NanumGothic font file. By default, config file will set OpenTTD font to ./font/NanumGothic.ttf and that is causing problem.
I tried to debug that, but vs debug build simply refuses to load ttf file.
OpenTTD switch to Microsoft's Uniscribe for text layout with the 1.9 release, as the layout component of the previously used ICU library is deprecated and has random crashes.
Font rendering is still done using FreeType and not GDI. FreeType will happily try to eat any font it is given, but Uniscribe, being a system components, relies on data provided by Windows, and seems to fail on uninstalled fonts. #6980 would fix that dissonance, but I'd assume Windows would automatically still select an installed font and not the one you want.
It turns out the language data is being loaded correctly, and conversions from internal UTF-8 to the UTF-16 required by Uniscribe is correct. The problem seems to be somewhere in the shaping process, and it seems that it's (somehow) adding 3 to the value of each glyph number, or something similar to that.