Subject: Re: bug#31588: 26.1; format counts some Unicode characters as two

From: Noam Postavsky <[email-masked]>
Date: Sun, 03 Jun 2018 12:29:20 -0400

close 31588
quit

Eli Zaretskii <[email-masked]> writes:

>> From: Noam Postavsky <[email-masked]>
>> Date: Thu, 24 May 2018 20:50:45 -0400
>> Cc: [email-masked]
>> 
>> > As far as I can tell, something is off about the styled_format and how
>> > it counts characters- I suspect something about counting
>> > multibyte characters, but it's a little beyond me.
>> 
>> I think it's intended, ➖ and ❌ are wide characters:
>> 
>>     (mapcar #'char-width '(?➖ ?❌ ?▶ ?✚ ?▷ ?◼))
>>     ;=> (2 2 1 1 1 1)
>
> Yes, that's the reason.
>
>> Although in my current font the width seems to be more like 1.8 or
>> something.
>
> Unfortunately, the actual width depends on the font, and what's more,
> sometimes varies significantly between different fonts.  Maybe we
> should have a variant of char-width that actually looks at the font
> (of course, such a variant will need a window or frame as one of its
> arguments).

Well, I don't know if format could do anything useful with a non-integer
width anyway.

> But with the current state of our support for wide characters, this is
> not a bug.

Okay, I'm closing this report.