Re: [hackers] [libsl|dmenu][PATCH v2] Fix truncation issues and improve performance
On Mon, Mar 28, 2022 at 10:01:10AM +0200, Stein Gunnar Bakkeby wrote:
> That ellipsis_w guard makes sense to add.
>
> You are right in that it is simpler to call drw_text. If we make another
> call to XftDrawStringUtf8 then we also need to recalculate ty.
You'd also need to call XFillRectangle(...), otherwise the ellipsis will
*overlap* what was previously there instead of *overwriting* it.
And on the topic of ellipsis_width, we currently don't account for
fallback font:
usedfont = drw->fonts;
drw_font_getexts(usedfont, "...", 3, &ellipsis_width, NULL);
The assumption here was that every font should have '.' but if that
turns out to be wrong, then the font width will be incorrect.
I don't think we can call drw_fontset_getwidth() though, since that'll
recurse back into drw_text().
- NRK
Received on Mon Mar 28 2022 - 13:57:48 CEST
This archive was generated by hypermail 2.3.0
: Mon Mar 28 2022 - 14:12:34 CEST