Re: [hackers] [st][patch] Made underlines and strikethroughs respect `chscale`.

From: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Sat, 12 Mar 2022 17:19:27 +0100

On Sat, Mar 12, 2022 at 03:24:57PM +0000, Zacchary Dempsey-Plante wrote:
> During my submission of the charoffsets customisation patch, I found that the underline and strikethrough rendering didn't take `chscale` into account.
> This meant that when using `chscale < 1.0`, underlines were not visible.
>
> The patch contents are below. Apologies if I've done anything wrong when submitting my mainline improvement patch - this is my first time contributing to a suckless project.
>
> From ffa6ee44e458e5239c2e5ad24f867ee7fd8832ef Mon Sep 17 00:00:00 2001
> From: Zacchary Dempsey-Plante <zacc_AT_ztdp.ca>
> Date: Sat, 12 Mar 2022 09:39:41 -0500
> Subject: [PATCH] Made underlines and strikethroughs respect `chscale`.
>
> ---
> x.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/x.c b/x.c
> index cd96575..2a3bd38 100644
> --- a/x.c
> +++ b/x.c
> _AT_@ -1493,12 +1493,12 @@ xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, i
>
> /* Render underline and strikethrough. */
> if (base.mode & ATTR_UNDERLINE) {
> - XftDrawRect(xw.draw, fg, winx, winy + dc.font.ascent + 1,
> + XftDrawRect(xw.draw, fg, winx, winy + dc.font.ascent * chscale + 1,
> width, 1);
> }
>
> if (base.mode & ATTR_STRUCK) {
> - XftDrawRect(xw.draw, fg, winx, winy + 2 * dc.font.ascent / 3,
> + XftDrawRect(xw.draw, fg, winx, winy + 2 * dc.font.ascent * chscale / 3,
> width, 1);
> }
>
> --
> 2.35.1
>

Please don't submit wiki patches to the hackers mailinglist.

Just push it to the wiki.

-- 
Kind regards,
Hiltjo
Received on Sat Mar 12 2022 - 17:19:27 CET

This archive was generated by hypermail 2.3.0 : Sat Mar 12 2022 - 17:24:37 CET