From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#65803: 29.1; Noto Sans Mono CJK JP has doubled-width on Windows Date: Sat, 09 Sep 2023 15:17:42 +0300 Message-ID: <834jk3v8ux.fsf@gnu.org> References: <83bkeeytwf.fsf@gnu.org> <838r9iyrky.fsf@gnu.org> <835y4myqtb.fsf@gnu.org> <83jzt1xju6.fsf@gnu.org> <83wmx0x3hj.fsf@gnu.org> <87wmx0dbn6.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19215"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 65803@debbugs.gnu.org, shingo.fg8@gmail.com To: Po Lu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 09 14:18:20 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qewup-0004mK-Ia for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 09 Sep 2023 14:18:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qewuX-00036C-FO; Sat, 09 Sep 2023 08:18:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qewuW-000362-GU for bug-gnu-emacs@gnu.org; Sat, 09 Sep 2023 08:18:00 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qewuW-0001VS-8t for bug-gnu-emacs@gnu.org; Sat, 09 Sep 2023 08:18:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qewuY-00004y-JI for bug-gnu-emacs@gnu.org; Sat, 09 Sep 2023 08:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 Sep 2023 12:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65803 X-GNU-PR-Package: emacs Original-Received: via spool by 65803-submit@debbugs.gnu.org id=B65803.1694261882302 (code B ref 65803); Sat, 09 Sep 2023 12:18:02 +0000 Original-Received: (at 65803) by debbugs.gnu.org; 9 Sep 2023 12:18:02 +0000 Original-Received: from localhost ([127.0.0.1]:46343 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qewuX-0008WP-Js for submit@debbugs.gnu.org; Sat, 09 Sep 2023 08:18:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40054) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qewuT-0008WA-T2 for 65803@debbugs.gnu.org; Sat, 09 Sep 2023 08:17:59 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qewuL-0001TB-50; Sat, 09 Sep 2023 08:17:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=5ToAK8xq7gkZLsNuTv1bQ+ywG743sOmiLi16UHbEbd8=; b=JeWFWGjly8CN bCMEhx3ft2fAR9lk+8d37zE/NtJ9z+wv7KNn1ybz5OkfcMZfNnK7/ncHKUpCBucAHab1/VcMWKbQY bI1CzHD/LmlZIbWBm4N+tEVLypzMS3g69UVDe00JpF2Kls3sLoivv0/dO7QQGWcL66NbMzaHtbsd9 /qKaaBQVp+zN2Aj8AHZwpij6jXc1Cw0tmEy+byUKDo4F3MfLZXey/cjs7PO8RnjlmfLXr6eDoY/I5 X0yni85s0dYQNm02vXq5G9+dO6TJRX4P22If39wXngtFOgKQLvHDGPb+JLqth0jmjeROhKQnidAAf tG6ph9UhU/6NOBJuqz5HyQ==; In-Reply-To: <87wmx0dbn6.fsf@yahoo.com> (message from Po Lu on Fri, 08 Sep 2023 21:42:37 +0800) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:269856 Archived-At: > From: Po Lu > Cc: Shingo Tanaka , 65803@debbugs.gnu.org > Date: Fri, 08 Sep 2023 21:42:37 +0800 > > For a nominally monospace font, the ft*font backends infer the average > from the width of the space glyph, instead of giving undue credence to > its reported ``average width''. CJK fonts customarily contain tens of > thousands of glyphs, of which only a small subset represent ASCII > ``monospace'' characters relevant to Emacs, but the `tmAveCharWidth' > field, which is derived from the font's OS/2 table: > > https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6OS2.html > > represents the average width of all the glyphs within the font, and is > ergo naturally biased towards the large number of CJK glyphs > incorporated within the font. The W32 backend should either infer the > average width itself, or ground it upon on the width of the space glyph. > Refer to this code in ftfont_open: > > font->min_width = font->average_width = font->space_width = 0; > for (i = 32, n = 0; i < 127; i++) > if (FT_Load_Char (ft_face, i, FT_LOAD_DEFAULT) == 0) > { > int this_width = ft_face->glyph->metrics.horiAdvance >> 6; > > if (this_width > 0 > && (! font->min_width || font->min_width > this_width)) > font->min_width = this_width; > if (i == 32) > font->space_width = this_width; > font->average_width += this_width; > n++; > } > if (n > 0) > font->average_width /= n; Thanks, but the above snippet in ftfont.c is only done for proportional fonts, not for fixed-pitch fonts. Is the font in question, Noto Sans Mono CJK JP, a proportional font? That is, does it not set the fixed-pitch attribute?