From: Eli Zaretskii <eliz@gnu.org>
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Cc: shingo.fg8@gmail.com, 48149@debbugs.gnu.org
Subject: bug#48149: 27.2; Wrong underline width when the line char has a width of 2
Date: Sun, 02 May 2021 19:23:02 +0300 [thread overview]
Message-ID: <83im416r6h.fsf@gnu.org> (raw)
In-Reply-To: <87a6pd86el.fsf@nicolasgoaziou.fr> (message from Nicolas Goaziou on Sun, 02 May 2021 18:08:50 +0200)
> From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
> Date: Sun, 02 May 2021 18:08:50 +0200
> Cc: 48149@debbugs.gnu.org
>
> > In case of 1), it correctly takes account of the case in which the character
> > has a width of 2 in `org-ascii--build-title', by dividing the line width by
> > `(char-width under-char)' (line 700-701), maybe because the character is user
> > configurable and its width in unknown. However, in case of 2) and
> > 3), maybe because the characters is embedded in the code, it looks like only
> > considering the character always has a width of 1. But the reality is
> > character ?─ or ?━ can have a width of 2 in the screen displayed with some
> > fonts (ex. "Noto Sans Mono CJK JP"), and in that case the line width gets
> > doubled of the expected width.
> >
> > Attached one is a potential patch. The basic concepts are:
> >
> > a) Do the same in case of 2) and 3) as in case of 1)
> > (dividing the line width by `(char-width under-char)',
> > assuming `char-width-table' is correctly set)
> >
> > b) Prefer the longer line width if the width is odd, even in case of 1)
> > (adding `(1- (char-width under-char))' to dividend,
> > just because it should be more beautiful ;-) )
>
> Thank you. This looks good. I cannot apply it on "maint" branch,
> however. Also, a proper commit message would be nice. Could you send an
> updated patch?
Please note that using char-width cannot solve the problem of a
character whose width depends on the font, because char-width is
oblivious to fonts, it only knows about the character's codepoint.
next prev parent reply other threads:[~2021-05-02 16:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <87fsz62b1w.wl-shingo.fg8@gmail.com>
2021-05-02 7:17 ` bug#48149: 27.2; Wrong underline width when the line char has a width of 2 Eli Zaretskii
[not found] ` <837dkh8uzi.fsf__22492.4155323365$1619940077$gmane$org@gnu.org>
2021-05-02 8:36 ` Rudolf Schlatte
2021-05-02 9:16 ` Eli Zaretskii
2021-05-02 16:08 ` Nicolas Goaziou
2021-05-02 16:23 ` Eli Zaretskii [this message]
2021-05-09 13:57 ` Shingo Tanaka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83im416r6h.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=48149@debbugs.gnu.org \
--cc=mail@nicolasgoaziou.fr \
--cc=shingo.fg8@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).