[hackers] Re: [dmenu][PATCH] make prompt padding symmetric

2017-12-08 Thread Alessandro Caputo
Hello,

In my config.h I simply have

static const char *fonts[] = { "monospace:size=9" };

Which defaults to Source Code Pro.
I also tested many other fonts, namely:
- Other flavours of Source Code Pro (Extralight, Light, Bold, Black)
- Noto Sans, Serif, Mono
- DejaVu Sans, Serif and Sans Mono
- Calibri

All fonts show the same issue with 'O' as prompt. However, as Markus
pointed out, I have to say that the unpatched version looks better with
'O:' as prompt.


Re: [hackers] Re: [dmenu][PATCH] make prompt padding symmetric

2017-12-07 Thread Hiltjo Posthuma
On Thu, Dec 07, 2017 at 10:51:17PM +0100, Alessandro Caputo wrote:
>Sorry, forgot to add some info.
>At least on my two computers and with the fonts I tested, there's a
>problem with the padding of dmenu's prompt.
>I have attached two screenshots with simply an 'O' as prompt, and these
>are the pixel counts on each side of the 'O':
>- original: 18 left, 11 right
>- patched: 18 left, 19 right
>Cheers,
>Alessandro
> 
>On Thu, Dec 7, 2017 at 10:46 PM, Alessandro Caputo
><[1]nonedisponib...@gmail.com> wrote:
> 
>  ---
>   dmenu.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>  diff --git a/dmenu.c b/dmenu.c
>  index eae5685..4173c62 100644
>  --- a/dmenu.c
>  +++ b/dmenu.c
>  @@ -604,7 +604,7 @@ setup(void)
>  y = topbar ? 0 : wa.height - mh;
>  mw = wa.width;
>  }
>  -   promptw = (prompt && *prompt) ? TEXTW(prompt) - lrpad / 4 :
>  0;
>  +   promptw = (prompt && *prompt) ? TEXTW(prompt) : 0;
>  inputw = MIN(inputw, mw/3);
>  match();
>  --
>  2.15.1
> 
> References
> 
>1. mailto:nonedisponib...@gmail.com

Hi,

What is your config.h and the font and fallback fonts you use?
I can also reproduce this.
-- 
Kind regards,
Hiltjo



Re: [hackers] Re: [dmenu][PATCH] make prompt padding symmetric

2017-12-07 Thread Markus Teich
Alessandro Caputo wrote:
> At least on my two computers and with the fonts I tested, there's a problem
> with the padding of dmenu's prompt.
> I have attached two screenshots with simply an 'O' as prompt, and these are
> the pixel counts on each side of the 'O':
> - original: 18 left, 11 right
> - patched: 18 left, 19 right

Heyho Alessandro,

Indeed I can confirm this behavior. I guess the reason for the unsymmetrical
padding is the expectation of prompts ending with ':'. If you try this out, you
will see a balanced prompt. I don't have strong feelings about what the default
should be and would not even mind an additional condition for checking the last
character of the prompt: (prompt[strlen[prompt]-1] == ':' ? lrpad / 4 : 0)

I'll defer to community opinion on what the default should be.

--Markus



[hackers] Re: [dmenu][PATCH] make prompt padding symmetric

2017-12-07 Thread Alessandro Caputo
Sorry, forgot to add some info.

At least on my two computers and with the fonts I tested, there's a problem
with the padding of dmenu's prompt.
I have attached two screenshots with simply an 'O' as prompt, and these are
the pixel counts on each side of the 'O':
- original: 18 left, 11 right
- patched: 18 left, 19 right

Cheers,
Alessandro


On Thu, Dec 7, 2017 at 10:46 PM, Alessandro Caputo <
nonedisponib...@gmail.com> wrote:

> ---
>  dmenu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/dmenu.c b/dmenu.c
> index eae5685..4173c62 100644
> --- a/dmenu.c
> +++ b/dmenu.c
> @@ -604,7 +604,7 @@ setup(void)
> y = topbar ? 0 : wa.height - mh;
> mw = wa.width;
> }
> -   promptw = (prompt && *prompt) ? TEXTW(prompt) - lrpad / 4 : 0;
> +   promptw = (prompt && *prompt) ? TEXTW(prompt) : 0;
> inputw = MIN(inputw, mw/3);
> match();
>
> --
> 2.15.1
>
>