all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Shingo Tanaka <shingo.fg8@gmail.com>, Po Lu <luangruo@yahoo.com>
Cc: 65803@debbugs.gnu.org
Subject: bug#65803: 29.1; Noto Sans Mono CJK JP has doubled-width on Windows
Date: Fri, 08 Sep 2023 15:18:32 +0300	[thread overview]
Message-ID: <83wmx0x3hj.fsf@gnu.org> (raw)
In-Reply-To: <CAH4H2-wWYfw0Afmw=DxvNfx=hX_J1Rk6_9s96NYwakArjSADkA@mail.gmail.com> (message from Shingo Tanaka on Fri, 8 Sep 2023 07:26:18 +0900)

> From: Shingo Tanaka <shingo.fg8@gmail.com>
> Date: Fri, 8 Sep 2023 07:26:18 +0900
> Cc: 65803@debbugs.gnu.org
> 
> > Please also tell what does (frame-char-width) return with each of the
> > two fonts on Windows.
> 
> Here are the results including the one on Ubuntu.
> Obviously, the 2nd one (Noto on Windows) returns a doubled-width size
> which is unexpected.
> 
> ;; On Windows - No issue
> (progn
>   (set-face-attribute 'default nil :font "MS ゴシック")
>   (frame-char-width))
> 10
> (string-pixel-width "A")
> 10
> (string-pixel-width "あ")
> 20
> 
> ;; On Windows - Wrong frame-char-width
> (progn
>   (set-face-attribute 'default nil :font "Noto Sans Mono CJK JP")
>   (frame-char-width))
> 20
> (string-pixel-width "A")
> 10
> (string-pixel-width "あ")
> 20
> 
> ;; On Ubuntu (w/Cairo) - No issue
> (progn
>   (set-face-attribute 'default nil :font "Noto Sans Mono CJK JP")
>   (frame-char-width))
> 13
> (string-pixel-width "A")
> 13
> (string-pixel-width "あ")
> 26

This is strange.  AFAIU, frame-char-width returns the "average width"
attribute of the font, so why do we get different results on Windows
and on X?  Po Lu, can you help?  Do font backends on X perform some
trickery on the font's average_width attribute that we don't do on
Windows?

> > Is your Ubuntu build with Cairo, btw?
> 
> Yes, the Emacs on Ubuntu is the latest Snap version which is compiled
> with Cairo, as I can double check it by seeing colored Emoji.





  reply	other threads:[~2023-09-08 12:18 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-07 13:38 bug#65803: 29.1; Noto Sans Mono CJK JP has doubled-width on Windows Shingo Tanaka
2023-09-07 13:50 ` Eli Zaretskii
2023-09-07 14:24   ` Shingo Tanaka
2023-09-07 14:40     ` Eli Zaretskii
2023-09-07 14:57       ` Eli Zaretskii
2023-09-07 23:19         ` Shingo Tanaka
2023-09-08  6:25           ` Eli Zaretskii
2023-09-07 22:26             ` Shingo Tanaka
2023-09-08 12:18               ` Eli Zaretskii [this message]
2023-09-08 13:42                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-08 14:49                   ` Werner LEMBERG
2023-09-09 12:51                     ` Eli Zaretskii
2023-09-09 13:42                       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-09 14:45                         ` Eli Zaretskii
2023-09-09 12:17                   ` Eli Zaretskii
2023-09-09 13:38                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-09 14:39                       ` Eli Zaretskii
2023-09-09 14:57                       ` Eli Zaretskii
2023-09-10  1:00                         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-10  5:22                           ` Eli Zaretskii
2023-09-10  5:36                             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-10  5:42                               ` Eli Zaretskii
2023-09-10  5:55                                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-10  6:48                                   ` Eli Zaretskii
2023-09-10  7:31                                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-10  7:53                                       ` Eli Zaretskii
2023-09-10  7:55                                         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-10  8:01                                           ` Eli Zaretskii
2023-09-10  8:08                                             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-10  8:19                                               ` Eli Zaretskii
2023-09-10  8:31                                                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-10  8:50                                                   ` Eli Zaretskii
2023-09-10  9:30                                                     ` Eli Zaretskii
2023-09-10 11:29                                                       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-10 11:44                                                         ` Eli Zaretskii
2023-09-10 12:09                                                           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-10 12:43                                                             ` Eli Zaretskii
2023-09-10 12:39                                               ` 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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83wmx0x3hj.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=65803@debbugs.gnu.org \
    --cc=luangruo@yahoo.com \
    --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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.