From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 24 09:55:56 2020 Received: (at submit) by debbugs.gnu.org; 24 Jan 2020 14:55:56 +0000 Received: from localhost ([127.0.0.1]:54582 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iv0NH-0003Iy-Tc for submit@debbugs.gnu.org; Fri, 24 Jan 2020 09:55:56 -0500 Received: from lists.gnu.org ([209.51.188.17]:39160) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iv0ND-0003Iq-Iq for submit@debbugs.gnu.org; Fri, 24 Jan 2020 09:55:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48130) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iv0NB-0002jS-OR for bug-gnu-emacs@gnu.org; Fri, 24 Jan 2020 09:55:51 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iv0NA-0006Zx-8F for bug-gnu-emacs@gnu.org; Fri, 24 Jan 2020 09:55:49 -0500 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]:50594) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iv0N9-0006Zj-VX for bug-gnu-emacs@gnu.org; Fri, 24 Jan 2020 09:55:48 -0500 Received: by mail-pj1-x102a.google.com with SMTP id r67so1149409pjb.0 for ; Fri, 24 Jan 2020 06:55:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=aw4D5xaXEXqKbjU2+x7zf9L3fda/f9E7TxlvyaYozHg=; b=EScVATS/tPawqqgQ/Ls7EMTq0rhBt8Mh3CvPFPOdh9YzHY71+1x0YRDgVM5Jj38hb8 ffLarO1iPUS41CQTQ5ieMH5zyHeihG7LMadteYoGwKspZSOET7iFueZHjgAkSe/ogdTN jWUFkzT+5BDOt2/1G/6ng0iYeo3XkEniYwI54WfUkD5nqovr3Q42XoJy4jTGoTGgfgVa b4N+MUjQtfmVc718cRtqHc+Ije/hWu5cpwrIHSxVPjZEr3GZXgSER26FfHLzY3ZOO2EV GimIedfcMaR2+YpGniElCmdHWc4GwqcF3oNDlUSNv9PnMiQD04TVvOlcN9ZmpkkfuBx8 Hneg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=aw4D5xaXEXqKbjU2+x7zf9L3fda/f9E7TxlvyaYozHg=; b=WMWFcpgxf1h8+fxfnkoL7vaerY4fShhGnHOfnLXBnP4xbNvY2ZYcCMNxZ2/b4L6uls OzkrYVa+DkWr4hVDVFOZ3gD9LkVi5KwkbW2rdagHcAqt5GncdWzYNsciM1Mc99iAFrep efottoRDlCJLRbR5ESeguw/xztLZ2292veXvVO1f0hH4lTFRrFS0Q5U5vRTb6gx0VtWv zJCjq9Za681tUhgD/QSGZXBg98MeivddKqTUhttGdHdh9KegV22e4U9iAChnq8xFc2Gj 8ong4BlDvzy/zbzncfkSXNbY6jt7k2/pxSLh6Zd3sBAenFiPdOgtFPnc8HZrHxY+RRug MLcQ== X-Gm-Message-State: APjAAAVHLhNtQwNr/wOwZaOl0kQr0adBs5Dyy+GDV9h6Tlp6tEF7mfZX tbhwpW9M0x19vqPS4tTg3RZnlxuW X-Google-Smtp-Source: APXvYqyYLXefY5P+iRP/reV0e1TsBN+FJzc5P4ZvRmqSNfbNie8xG4aVRgW9AzvcswFfx+hNI2giSQ== X-Received: by 2002:a17:902:aa96:: with SMTP id d22mr3911426plr.204.1579877746328; Fri, 24 Jan 2020 06:55:46 -0800 (PST) Received: from HP (east42-p111.eaccess.hi-ho.ne.jp. [219.121.173.112]) by smtp.gmail.com with ESMTPSA id w8sm6242972pfn.186.2020.01.24.06.55.44 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 24 Jan 2020 06:55:45 -0800 (PST) From: ynyaaa@gmail.com To: bug-gnu-emacs@gnu.org Subject: 26.3; (frame-char-width) is different from real char width of monospace font 'Noto Sans Mono' Date: Fri, 24 Jan 2020 23:55:42 +0900 Message-ID: <86sgk4sy35.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::102a X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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) [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [209.51.188.17 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (ynyaaa[at]gmail.com) 0.0 T_SPF_TEMPERROR SPF: test of record failed (temperror) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 2.0 SPOOFED_FREEMAIL No description available. X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 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) Then the TAB pixel width is 8 pixels wider than 8 SPCs. And the frame with 80-character width is wider than a real 80-character line. Here is a list of problematic combinations of font names and font sizes. The sizes are selected from between 10 and 20. ;;; NOTE: THIS FORM USE #'set-frame-font MANY TIMES (let (last cell ret) (save-window-excursion (with-temp-buffer (switch-to-buffer (current-buffer)) (insert ?\s) (dolist (family (sort (font-family-list) #'string<)) (when (and (not (equal family last)) (string-match "Noto.*Mono" family)) (setq cell (list family) ret (cons cell ret)) (dolist (size (number-sequence 10 20)) (set-frame-font (format "%s-%d" family size)) (unless (= (car (window-text-pixel-size nil 1 2)) (frame-char-width)) (setq cell (nconc cell (list size)))))) (setq last family)))) (nreverse ret)) => (("Noto Mono") ("Noto Sans Mono" 13 14 15 17 18 19 20) ("Noto Sans Mono Blk" 13 14 15 17 18 19 20) ("Noto Sans Mono CJK JP Bold" 10 11 12 13 14 15 16 17 18 19 20) ("Noto Sans Mono CJK JP Regular" 10 11 12 13 14 15 16 17 18 19 20) ("Noto Sans Mono CJK KR Bold" 10 11 12 13 14 15 16 17 18 19 20) ("Noto Sans Mono CJK KR Regular" 10 11 12 13 14 15 16 17 18 19 20) ("Noto Sans Mono CJK SC Bold" 10 11 12 13 14 15 16 17 18 19 20) ("Noto Sans Mono CJK SC Regular" 10 11 12 13 14 15 16 17 18 19 20) ("Noto Sans Mono CJK TC Bold" 10 11 12 13 14 15 16 17 18 19 20) ("Noto Sans Mono CJK TC Regular" 10 11 12 13 14 15 16 17 18 19 20) ("Noto Sans Mono Cond" 12 14 16 17 19 20) ("Noto Sans Mono Cond Blk" 12 14 16 17 19 20) ("Noto Sans Mono Cond ExtBd" 12 14 16 17 19 20) ("Noto Sans Mono Cond ExtLt" 12 14 16 17 19 20) ("Noto Sans Mono Cond Light" 12 14 16 17 19 20) ("Noto Sans Mono Cond Med" 12 14 16 17 19 20) ("Noto Sans Mono Cond SemBd" 12 14 16 17 19 20) ("Noto Sans Mono Cond Thin" 12 14 16 17 19 20) ("Noto Sans Mono ExtBd" 13 14 15 17 18 19 20) ("Noto Sans Mono ExtCond" 15 18) ("Noto Sans Mono ExtCond Blk" 15 18) ("Noto Sans Mono ExtCond ExtBd" 15 18) ("Noto Sans Mono ExtCond ExtLt" 15 18) ("Noto Sans Mono ExtCond Light" 15 18) ("Noto Sans Mono ExtCond Med" 15 18) ("Noto Sans Mono ExtCond SemBd" 15 18) ("Noto Sans Mono ExtCond Thin" 15 18) ("Noto Sans Mono ExtLt" 13 14 15 17 18 19 20) ("Noto Sans Mono Light" 13 14 15 17 18 19 20) ("Noto Sans Mono Med" 13 14 15 17 18 19 20) ("Noto Sans Mono SemBd" 13 14 15 17 18 19 20) ("Noto Sans Mono SemCond" 10 11 15 17 19 20) ("Noto Sans Mono SemCond Blk" 10 11 15 17 19 20) ("Noto Sans Mono SemCond ExtBd" 10 11 15 17 19 20) ("Noto Sans Mono SemCond ExtLt" 10 11 15 17 19 20) ("Noto Sans Mono SemCond Light" 10 11 15 17 19 20) ("Noto Sans Mono SemCond Med" 10 11 15 17 19 20) ("Noto Sans Mono SemCond SemBd" 10 11 15 17 19 20) ("Noto Sans Mono SemCond Thin" 10 11 15 17 19 20) ("Noto Sans Mono Thin" 13 14 15 17 18 19 20)) In GNU Emacs 26.3 (build 1, x86_64-w64-mingw32) of 2019-08-29 built on CIRROCUMULUS Repository revision: 96dd0196c28bc36779584e47fffcca433c9309cd Windowing system distributor 'Microsoft Corp.', version 10.0.18363 Recent messages: Configured using: 'configure --without-dbus --host=x86_64-w64-mingw32 --without-compress-install 'CFLAGS=-O2 -static -g3'' Configured features: XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS THREADS LCMS2 Important settings: value of $LANG: JPN locale-coding-system: cp932 Major mode: Emacs-Lisp Minor modes in effect: diff-auto-refine-mode: t display-time-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (term/bobcat descr-text mailclient browse-url cus-edit cus-start cus-load wid-edit info crm eieio-opt speedbar sb-image ezimage dframe shadow emacsbug network-stream nsm starttls tls gnutls mailalias smtpmail auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs sendmail sort mail-extr message rmc puny dired dired-loaddefs format-spec rfc822 mml mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader compare-w diff-mode easy-mmode find-func cl-extra pp ibuf-ext ibuffer ibuffer-loaddefs seq thingatpt help-fns radix-tree misearch multi-isearch help-mode easymenu cl-print byte-opt gv bytecomp byte-compile cl-loaddefs cl-lib cconv debug time elec-pair time-date mule-util japan-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel dos-w32 ls-lisp disp-table term/w32-win w32-win w32-vars term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads w32notify w32 lcms2 multi-tty make-network-process emacs) Memory information: ((conses 16 238951 47126) (symbols 48 50848 0) (miscs 40 140 601) (strings 32 120075 1414) (string-bytes 1 2925132) (vectors 16 31299) (vector-slots 8 1261645 35200) (floats 8 74 499) (intervals 56 17535 168) (buffers 992 22)) From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 24 10:34:30 2020 Received: (at 39264) by debbugs.gnu.org; 24 Jan 2020 15:34:30 +0000 Received: from localhost ([127.0.0.1]:54641 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iv0yc-0006Jf-B1 for submit@debbugs.gnu.org; Fri, 24 Jan 2020 10:34:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45901) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iv0ya-0006JM-ID; Fri, 24 Jan 2020 10:34:28 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34479) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iv0yV-0007IV-DZ; Fri, 24 Jan 2020 10:34:23 -0500 Received: from [176.228.60.248] (port=2203 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iv0yU-0001Jf-74; Fri, 24 Jan 2020 10:34:23 -0500 Date: Fri, 24 Jan 2020 17:34:04 +0200 Message-Id: <83tv4krhqr.fsf@gnu.org> From: Eli Zaretskii To: ynyaaa@gmail.com In-reply-to: <86sgk4sy35.fsf@gmail.com> (ynyaaa@gmail.com) Subject: Re: bug#39264: 26.3; (frame-char-width) is different from real char width of monospace font 'Noto Sans Mono' References: <86sgk4sy35.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 39264 Cc: 39264@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) 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. From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 10 10:36:35 2020 Received: (at 39264-done) by debbugs.gnu.org; 10 Feb 2020 15:36:35 +0000 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 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==; 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 From: Stefan Kangas To: Eli Zaretskii Subject: Re: bug#39264: 26.3; (frame-char-width) is different from real char width of monospace font 'Noto Sans Mono' In-Reply-To: <83tv4krhqr.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 24 Jan 2020 17:34:04 +0200") References: <86sgk4sy35.fsf@gmail.com> <83tv4krhqr.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Date: Mon, 10 Feb 2020 16:36:26 +0100 Message-ID: <87d0am5u9x.fsf@marxist.se> MIME-Version: 1.0 Content-Type: text/plain 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-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 39264-done Cc: ynyaaa@gmail.com, 39264-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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 From unknown Thu Aug 14 21:53:34 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 10 Mar 2020 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator