unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 65803@debbugs.gnu.org, shingo.fg8@gmail.com
Subject: bug#65803: 29.1; Noto Sans Mono CJK JP has doubled-width on Windows
Date: Sun, 10 Sep 2023 09:00:45 +0800	[thread overview]
Message-ID: <87o7iac05e.fsf@yahoo.com> (raw)
In-Reply-To: <83pm2rtmvz.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 09 Sep 2023 17:57:36 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Po Lu <luangruo@yahoo.com>
>> Cc: shingo.fg8@gmail.com,  65803@debbugs.gnu.org
>> Date: Sat, 09 Sep 2023 21:38:32 +0800
>> 
>>     font->min_width = font->average_width = font->space_width
>>       = (scalable ? ft_face->max_advance_width * size / upEM + 0.5
>> 	 : ft_face->size->metrics.max_advance >> 6);
>> 
>> That aside, Fontconfig does not judge Noto Sans Mono CJK JP a fixed
>> pitch font on my system.
>
> Basically, calculating our own estimate of the average width means we
> discard the attribute reported by the font, in effect backing up on
> the change made in OpenType spec v3, which deprecated the previous
> requirement to compute the average width based only on ASCII
> characters.  This seems to be justified only because Emacs uses the
> average width of the font for one purpose only: to calculate the
> default column width of a frame.  So this calculation is only relevant
> for when a font is used as the default face's font.  If we ever decide
> to use the average width for anything else, we might be bitten by
> this.
>
> So I think a cleaner solution would be to leave the average width
> attribute as the font reports it, and introduce a new attribute for
> the average width of the ASCII characters.  Not sure how urgent this
> is, but we should at least describe this subtlety in the comments.

However, the only function of the average width property is to provide
the average width of ASCII characters; the W32 font driver is AFAIK the
only exception to this rule.  Moreover, the average width attribute in
older TrueType fonts is that of each ASCII glyph, and several fonts
provide no average width attribute at all (given that an OS/2 table need
not be supplied in fonts that aren't designed to function under
MS-Windows), in which case calculating its value for each glyph at
load-time will prove prohibitively expensive.





  reply	other threads:[~2023-09-10  1:00 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
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 [this message]
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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87o7iac05e.fsf@yahoo.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=65803@debbugs.gnu.org \
    --cc=eliz@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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).