ValveSoftware / halflife

Half-Life 1 engine based games
Other
3.74k stars 630 forks source link

GoldSrc TTF bug when bitmapfonts set to 0 #944

Closed ghost closed 11 years ago

ghost commented 11 years ago

On Ubuntu: When bitmapfonts variable is set to 0, GoldSrc is unable to draw TrueType fonts on VGUIs.

op4ctf_motd

op4ctf_menu

On Windows: When bitmapfonts variable is set to 0, GoldSrc is able to correctly display characters in Basic Latin range only (with ASCII codes 0x20 ... 0x7F).

Also, on both platforms: When VGUI element is using READ_STRING function and it's text contains character with ASCII code 0xFF, all text starting from this character is missing.

alfred-valve commented 11 years ago

TFC (and all our VGUI1 games) need bitmapfonts set to work, unsetting it is falling into this unsupported code path. For the second issue, if you can provide details on an actual usage case in the game then I can check it out.

ghost commented 11 years ago

No problem, example is MOTD screen in HL:OF / TFC. Of course, text in motd.txt must contain at least one 0xFF character in order to represent this bug. (I searched a way to bypass this a long time ago, and, IIRC, the problem is a comparison of every character's ASCII code with "-1" (EOF) value in READ_STRING() function).

Also, GoldSrc engine uses Windows-1252 codepage to represent messages from titles.txt via Legacy_CreditsFont font in TrackerScheme.res (independent of real operating system ACP or currently selected game language), is it a bug or a feature?

alfred-valve commented 11 years ago

using the english code page is by design for this VGUI1 code. VGUI1 had a very english very of the world. VGUI2 greatly improved our localization support, which is why CS, CZ and DoD have localized name and chat support (and why bringing it to TFC would not be reasonable).

ghost commented 11 years ago

So, there is no way to see Unicode support in HL:OF at least? :(

alfred-valve commented 11 years ago

Nope, not HL:OF.

ghost commented 11 years ago

Okay, one last question. Blue Shift reads titles.txt as UTF-8, how it's possible if it based on VGUI1?

alfred-valve commented 11 years ago

because that is shared code, I did that upgrade for CS 1.6 (way back when we first moved CS to VGUI2).

ghost commented 11 years ago

The funny thing that it still converts text from UTF-8 to Windows-1252 after reading. I found out that it's the cause of bug https://github.com/ValveSoftware/steam-for-linux/issues/2258. OTOH, Half-Life and OF read titles.txt as ANSI. Some street magic :)

alfred-valve commented 11 years ago

Please bring bug ValveSoftware/steam-for-linux#2258 over to this tracker so we can fix it properly (just make a new bug here with the details, and reference and close that other one).

ghost commented 11 years ago

Ok, doing it right now. What about 0xFF character bug, should I make bugreport for that too?

alfred-valve commented 11 years ago

I am not sure we can reasonably fix the 0xFF issue, but having a bug will help.

ghost commented 11 years ago

OK, I will report that too.

johndrinkwater commented 11 years ago

Those bugs reported as https://github.com/ValveSoftware/halflife/issues/948 ( for https://github.com/ValveSoftware/steam-for-linux/issues/2258 ) + https://github.com/ValveSoftware/halflife/issues/950