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: Sun, 10 Sep 2023 15:43:24 +0300 Message-ID: <83bkearyfn.fsf@gnu.org> References: <834jk3v8ux.fsf@gnu.org> <87wmwzbh5z.fsf@yahoo.com> <83pm2rtmvz.fsf@gnu.org> <87o7iac05e.fsf@yahoo.com> <834jk2txe6.fsf@gnu.org> <87fs3mbnem.fsf@yahoo.com> <831qf6twid.fsf@gnu.org> <877coybmho.fsf@yahoo.com> <83y1heseud.fsf@gnu.org> <8734zmbi1z.fsf@yahoo.com> <83msxusbvb.fsf@gnu.org> <87tts2a2cz.fsf@yahoo.com> <83jzsysbh4.fsf@gnu.org> <87pm2qa1s7.fsf@yahoo.com> <83il8isan2.fsf@gnu.org> <87ledea0oy.fsf@yahoo.com> <83h6o2s97x.fsf@gnu.org> <83fs3ms7dx.fsf@gnu.org> <87h6o29sgm.fsf@yahoo.com> <83cyyqs15k.fsf@gnu.org> <87cyyq9qmz.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20299"; 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 Sun Sep 10 14:44:16 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 1qfJnT-00056H-TT for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 10 Sep 2023 14:44:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qfJnE-000665-JF; Sun, 10 Sep 2023 08:44:00 -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 1qfJnC-0005yt-T7 for bug-gnu-emacs@gnu.org; Sun, 10 Sep 2023 08:43:58 -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 1qfJnC-0007ez-L4 for bug-gnu-emacs@gnu.org; Sun, 10 Sep 2023 08:43:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qfJnG-0005jb-13 for bug-gnu-emacs@gnu.org; Sun, 10 Sep 2023 08:44: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: Sun, 10 Sep 2023 12:44:01 +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.169434983522023 (code B ref 65803); Sun, 10 Sep 2023 12:44:01 +0000 Original-Received: (at 65803) by debbugs.gnu.org; 10 Sep 2023 12:43:55 +0000 Original-Received: from localhost ([127.0.0.1]:49217 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfJn9-0005j8-Bh for submit@debbugs.gnu.org; Sun, 10 Sep 2023 08:43:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39252) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfJn7-0005iu-Cu for 65803@debbugs.gnu.org; Sun, 10 Sep 2023 08:43:54 -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 1qfJmy-0007ba-Dt; Sun, 10 Sep 2023 08:43:44 -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=26CjrSMd0M9UQ992rwDyvSds68vWlTeKqmfn6bPlHjo=; b=Ka+85jJyfgrr 2eiUVYDk1XH+ul830DrfuYNq/luZlGcGMNi/S6P3mb6qCtPJK0/XSYNidZUmJ0xx8XuOkZVzq7w86 iziUXpZrCOrC2tWOWQg6ZzCf5PHPiMcWamoiyXF5iraGQpTK3uikqaMv+af/4MkbBX+n0OXgFZIj+ 1gxtbT4Oy0kPlInGMgDW1YsZwf9PCaAbTcEd69EiouXIrCli3rRgQ7vg9/vjonTr+M+HQUZ7SrmD5 5zvBFnV0MCHH1TO2UQMkchMloez1DV3/Fb7ErAPVUFy2XS8FmB8KpSw5R84rls0QMWvUp6eRpZxAn LXEEJlSvVu+iZoAy0z9YXw==; In-Reply-To: <87cyyq9qmz.fsf@yahoo.com> (message from Po Lu on Sun, 10 Sep 2023 20:09:08 +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:269956 Archived-At: > From: Po Lu > Cc: 65803@debbugs.gnu.org, shingo.fg8@gmail.com > Date: Sun, 10 Sep 2023 20:09:08 +0800 > > Eli Zaretskii writes: > > > That's what I tried. The problem is, first time we open the fonts > > (which is when it's important to have the metrics of the default > > face's font), we are called from x-create-frame for the initial frame, > > and the frame's w32-specific attributes are not yet set. The > > window-system for the frame is still "initial", and get_frame_dc > > aborts. > > Can't font initialization be moved to a location slightly later in the > frame initialization process? It is needed for determining the frame geometry, since it provides us with the column width and line height. Maybe something could be done about that, for example using the current approximation initially, then correcting this with another iteration or somesuch. But that requires a better understanding of the fine details of w32font.c and w32uniscribe.c than what I have. For example, there's a cache of metrics there, which would need to be discarded somehow. > xfont_open uses the frame's X display without ill effect. xfont_open gets the font metrics from Xlib calls, and its X display argument is also something returned by Xlib. With w32, I simply don't know what minimum amount of setup is needed to make a frame a capable enough w32 frame that can support get_frame_dc and the calls like SelectObject we need for this particular job. Feel free to experiment, you or someone else; I simply don't have enough time for that, sorry.