unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Anand Tamariya <atamariya@gmail.com>
To: Ihor Radchenko <yantar92@gmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Re: Pixel padding with variable pitch font
Date: Tue, 8 Jun 2021 10:34:03 +0530	[thread overview]
Message-ID: <CADm7Y4nv2NszXVqTtLJsYTDOCNeeSQ_n6zrHnAqEZnZoUP1aEg@mail.gmail.com> (raw)
In-Reply-To: <87sg1tm57w.fsf@localhost>

[-- Attachment #1: Type: text/plain, Size: 572 bytes --]

One can still measure the actual character width using
> window-text-pixel-size and take it into account.

 That's correct. width is pixel width returned by (posn-at-point) and
w is (font-get
(font-at (point)) :size).

This assumes that, e.g., #x2001 takes the same horizontal space as the
> SPC character (or the same as a column)?

The code is only assuming what the specs prescribe. It makes no guarantee
for non-standard fonts.

The complete code in action, if anybody is interested, is here
https://gitlab.com/atamariya/emacs/-/blob/dev/lisp/cedet/company.el#L2562 .

[-- Attachment #2: Type: text/html, Size: 1480 bytes --]

      reply	other threads:[~2021-06-08  5:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-07 13:19 Pixel padding with variable pitch font Anand Tamariya
2021-06-07 13:35 ` Eli Zaretskii
2021-06-08  2:59   ` Ihor Radchenko
2021-06-08  5:04     ` Anand Tamariya [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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADm7Y4nv2NszXVqTtLJsYTDOCNeeSQ_n6zrHnAqEZnZoUP1aEg@mail.gmail.com \
    --to=atamariya@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=yantar92@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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).