On Tue Feb 6 15:01:50 2024 +0000, Santino Mazza wrote:
I tested GdipMeasureString with different strings that require font linking and it behaves correctly. It's strange because I also tested with the exact same string the game uses and with the generic typographic format, but I still can't get the bug to reproduce. Apparently when the game tries to draw that specific string, GdipMeasureString returns a bounding box with width 0, which causes draw_string_callback to not increase the X position, so it overwrites the other word. Again this doesn't happen if I use font_link_get_text_extent_point.
The difference might have to do with scaling? It looks like GdipMeasureString scales the size, and I don't think font_link_get_text_extent_point would.
Come to think of it, it's probably necessary to account for text rotation when in draw_string_callback (an arbitrary affine transform can be applied to the text, although I think at the moment our handling of anything beyond rotation is a bit broken). I think it might be a good idea to add output parameters for dx and dy to draw_driver_string.