by Player701 » Sat Apr 13, 2019 7:48 am
Well, if this gets added, it will allow me to get rid of the hack where I break the string down to invidual characters and print them separately. This part of code is HUD-related, so I can't use DrawText for that (since all other code there uses HUDFont and its parameters, so I would have to break the abstraction really badly). It seems that at least it is possible to change the type of the corresponding argument in HUDFont.Create from bool to EMonospacing and it won't break any existing code, because falsy values will translate to 0 (Mono_Off) and truthy values will translate to 1 (Mono_CellLeft).
Upd: So I've
made a PR to implement the necessary changes. Everything seems to work fine, here's an updated test WAD and screenshot as proof:
The top 3 rows are rendered with Screen.DrawText, the bottom 3 with DrawString using different monospacing modes. The result is the same.
- Attachments
-
- hud_test.wad
- (1.28 KiB) Downloaded 39 times
Well, if this gets added, it will allow me to get rid of the hack where I break the string down to invidual characters and print them separately. This part of code is HUD-related, so I can't use DrawText for that (since all other code there uses HUDFont and its parameters, so I would have to break the abstraction really badly). It seems that at least it is possible to change the type of the corresponding argument in HUDFont.Create from bool to EMonospacing and it won't break any existing code, because falsy values will translate to 0 (Mono_Off) and truthy values will translate to 1 (Mono_CellLeft).
[b]Upd:[/b] So I've [url=https://github.com/coelckers/gzdoom/pull/810]made a PR[/url] to implement the necessary changes. Everything seems to work fine, here's an updated test WAD and screenshot as proof:
[imgur]https://imgur.com/ccV4OE9[/imgur]
The top 3 rows are rendered with Screen.DrawText, the bottom 3 with DrawString using different monospacing modes. The result is the same.