> I agree, but keep in mind drw_text also handles fallback fonts, so it > calculates the width for it if needed.
My point exactly. Unwinding this function is incredibly difficult.
All I've managed so far (aside from fixing other patches) is to simplify
drw_font_getexts. Instead of that, there is now a function that only returns
width in pixels. See attached.
However, this new function still needs to know three things:
1. The font to use
2. The text to be rendered
3. The length in bytes of the utf8 encoded string
No. 2 is easy. No. 1 and 3 are all tangled up in drw_text. So, before calls to
drw_text and TEXTW can be replaced with drw_get_width, those pieces need to be
decoupled somehow.
I'll start working on that, but it may be a while. I'm very new to C.
drw_get_width.patch
Description: Binary data
