From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#39264: 26.3; (frame-char-width) is different from real char width of monospace font 'Noto Sans Mono' Date: Mon, 10 Feb 2020 16:36:26 +0100 Message-ID: <87d0am5u9x.fsf@marxist.se> References: <86sgk4sy35.fsf@gmail.com> <83tv4krhqr.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="38416"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: ynyaaa@gmail.com, 39264-done@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 10 16:37:28 2020 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 1j1B7n-0009rg-Vp for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 10 Feb 2020 16:37:27 +0100 Original-Received: from localhost ([::1]:35168 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1B7n-0006uB-0v for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 10 Feb 2020 10:37:27 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39993) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1B7Q-0006nD-77 for bug-gnu-emacs@gnu.org; Mon, 10 Feb 2020 10:37:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j1B7P-0005g2-6q for bug-gnu-emacs@gnu.org; Mon, 10 Feb 2020 10:37:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49274) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j1B7P-0005ft-3i for bug-gnu-emacs@gnu.org; Mon, 10 Feb 2020 10:37:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j1B7P-0000Fx-1d for bug-gnu-emacs@gnu.org; Mon, 10 Feb 2020 10:37:03 -0500 Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Feb 2020 15:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 39264 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Mail-Followup-To: 39264@debbugs.gnu.org, stefan@marxist.se, ynyaaa@gmail.com Original-Received: via spool by 39264-done@debbugs.gnu.org id=D39264.1581348995936 (code D ref 39264); Mon, 10 Feb 2020 15:37:02 +0000 Original-Received: (at 39264-done) by debbugs.gnu.org; 10 Feb 2020 15:36:35 +0000 Original-Received: from localhost ([127.0.0.1]:55244 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j1B6x-0000F2-GZ for submit@debbugs.gnu.org; Mon, 10 Feb 2020 10:36:35 -0500 Original-Received: from ted.gofardesign.uk ([67.225.143.91]:55102) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j1B6w-0000Ep-3d for 39264-done@debbugs.gnu.org; Mon, 10 Feb 2020 10:36:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=marxist.se; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ftbDgZ2jbR0cVL6d74GOk5SQQx94HqOmSf/nNeb0YW0=; b=efWfmovroL8EJIWjZ5/kvfIG0K 1uIhfCXVwhH7S4TuSTHEGloPuBky1XPb22U32/OxfoIMrov+P7ZxP/Nj43GWH/siQc78uwbn6vdhd w1D4gDL3KF1cvpybMpRHM1G+mz6ObLTDfqgOuRLqR1rKfL+MDYgmwd6zr+oEawMiNi+Lvom3r5VBd hFwl48rdGWPIcEY8qKTnyMTLZ69iqmCig/sVCn7ZA8shVgw1KPjAVNL8dFsvA6hNFFSgD1FQFBohP HPOhHbPGb0rMYJtf5H8Vqxcfm824/vJgR04ymM2j4wNaRXuBQcpXk1DUA1nP8RWqXpaErbtlwZ1ID DD3fei9g==; Original-Received: from h-4-70-69.a785.priv.bahnhof.se ([155.4.70.69]:47058 helo=localhost) by ted.gofardesign.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1j1B6q-000nCC-G9; Mon, 10 Feb 2020 10:36:28 -0500 In-Reply-To: <83tv4krhqr.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 24 Jan 2020 17:34:04 +0200") X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - ted.gofardesign.uk X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - marxist.se X-Get-Message-Sender-Via: ted.gofardesign.uk: authenticated_id: stefan@marxist.se X-Authenticated-Sender: ted.gofardesign.uk: stefan@marxist.se X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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" Xref: news.gmane.io gmane.emacs.bugs:175873 Archived-At: Eli Zaretskii writes: > tags 39264 notabug > thanks > >> From: ynyaaa@gmail.com >> Date: Fri, 24 Jan 2020 23:55:42 +0900 >> >> I installed Noto fonts. >> With setting frame font to "Noto Sans Mono", which is a monospace font, >> (frame-char-width) and the real char width may differ. >> >> For example, using "Noto Sans Mono-13", (frame-char-width) is one pixel larger. >> (progn >> (set-frame-font "Noto Sans Mono-13") >> (list (frame-char-width) (car (window-text-pixel-size nil 1 2)))) >> => (11 10) > > This is not a bug. frame-char-width returns the value of the font's > "average width" attribute, whereas window-text-pixel-size actually > performs the layout of the specified text, simulating its display, and > measures the result. Thus, the values can differ, although for > monospaced fonts they cannot (or should not) differ by too much. > > The upshot of this is that you cannot really perform accurate layout > calculations from Lisp, at least not easily. There's no way around > this basic difficulty. I'm consequently also closing this bug report. Best regards, Stefan Kangas