Re: [hackers] [libsl|dmenu][PATCH v2] Fix truncation issues and improve performance

2022-03-29 Thread Stein Gunnar Bakkeby
For 0002 how about leaving the ellipsis_width as 0 and do this? if (!ellipsis_width && render) ellipsis_width = drw_fontset_getwidth(drw, ellipsis); Moving the "..." to a static(?) const variable named ellipsis would make it easier to replace this with something else (like the ellipsis

Re: [hackers] [libsl|dmenu][PATCH v2] Fix truncation issues and improve performance

2022-03-29 Thread NRK
On Tue, Mar 29, 2022 at 07:33:27PM +0200, Quentin Rameau wrote: > > @@ -283,7 +284,10 @@ drw_text(Drw *drw, int x, int y, unsigned int w, > > unsigned int h, unsigned int lp > > } > > > > usedfont = drw->fonts; > > - drw_font_getexts(usedfont, "...", 3, _width, NULL); > > + if

Re: [hackers] [libsl|dmenu][PATCH v2] Fix truncation issues and improve performance

2022-03-29 Thread Quentin Rameau
> On Mon, Mar 28, 2022 at 05:57:48PM +0600, NRK wrote: > > And on the topic of ellipsis_width, we currently don't account for > > fallback font: > > > > usedfont = drw->fonts; > > drw_font_getexts(usedfont, "...", 3, _width, NULL); > > > > The assumption here was that every font should

Re: [hackers] [libsl|dmenu][PATCH v2] Fix truncation issues and improve performance

2022-03-29 Thread NRK
On Mon, Mar 28, 2022 at 05:57:48PM +0600, NRK wrote: > And on the topic of ellipsis_width, we currently don't account for > fallback font: > > usedfont = drw->fonts; > drw_font_getexts(usedfont, "...", 3, _width, NULL); > > The assumption here was that every font should have '.' but