GNU bug report logs -
#65803
29.1; Noto Sans Mono CJK JP has doubled-width on Windows
Previous Next
Full log
Message #29 received at 65803 <at> debbugs.gnu.org (full text, mbox):
> From: Shingo Tanaka <shingo.fg8 <at> gmail.com>
> Date: Fri, 8 Sep 2023 07:26:18 +0900
> Cc: 65803 <at> 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.
This bug report was last modified 1 year and 280 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.