From: Stefan Kangas <stefan@marxist.se>
To: Eli Zaretskii <eliz@gnu.org>
Cc: ynyaaa@gmail.com, 39264-done@debbugs.gnu.org
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 [thread overview]
Message-ID: <87d0am5u9x.fsf@marxist.se> (raw)
In-Reply-To: <83tv4krhqr.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 24 Jan 2020 17:34:04 +0200")
Eli Zaretskii <eliz@gnu.org> 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
prev parent reply other threads:[~2020-02-10 15:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-24 14:55 bug#39264: 26.3; (frame-char-width) is different from real char width of monospace font 'Noto Sans Mono' ynyaaa
2020-01-24 15:34 ` Eli Zaretskii
2020-02-10 15:36 ` Stefan Kangas [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87d0am5u9x.fsf@marxist.se \
--to=stefan@marxist.se \
--cc=39264-done@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=ynyaaa@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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.