unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Paul W. Rankin" via "Emacs development discussions." <emacs-devel@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: sbaugh@catern.com, emacs-devel@gnu.org
Subject: Re: Horizontal centering in the display engine
Date: Thu, 15 Apr 2021 21:39:59 +1000	[thread overview]
Message-ID: <f161702768b15ab26c6b54a9d3573d45@bydasein.com> (raw)
In-Reply-To: <83zgy0xc30.fsf@gnu.org>

On 2021-04-15 17:04, Eli Zaretskii wrote:
> This calculation of line-width is, of course, only valid when there's
> a single face used by the line's characters.
> 
> Using window-text-pixel-size will produce more accurate results, but
> OP's main problem is not how to compute the line's width, it is how to
> make the alignment adjust itself automatically to any changes in the
> line's text and in the window's width.

Yes, just a proof of concept, we need to leave some things for OP to 
find out themselves ;)

If implemented with font-lock, the properties will automatically update 
when the text is changed, and a hook can be added to 
window-size-change-functions for the window changing.



  reply	other threads:[~2021-04-15 11:39 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-15  5:13 Horizontal centering in the display engine Paul W. Rankin via Emacs development discussions.
2021-04-15  7:04 ` Eli Zaretskii
2021-04-15 11:39   ` Paul W. Rankin via Emacs development discussions. [this message]
2021-04-15 12:43     ` Stefan Monnier
2021-04-15 13:05       ` Paul W. Rankin via Emacs development discussions.
  -- strict thread matches above, loose matches on Subject: below --
2021-04-13 18:25 sbaugh
2021-04-13 18:39 ` Eli Zaretskii
2021-04-13 19:28   ` sbaugh
2021-04-13 19:43     ` Eli Zaretskii
2021-04-13 20:49       ` sbaugh
2021-04-14  6:56         ` Eli Zaretskii
2021-04-14 13:28           ` sbaugh
2021-04-14 13:42             ` Yuan Fu
2021-04-14 14:04             ` Stefan Monnier
2021-04-14 15:22               ` sbaugh
2021-04-14 14:42             ` Eli Zaretskii
2021-04-14 15:25               ` sbaugh
2021-04-14 15:52                 ` Eli Zaretskii
2021-04-14  8:28         ` martin rudalics

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=f161702768b15ab26c6b54a9d3573d45@bydasein.com \
    --to=emacs-devel@gnu.org \
    --cc=eliz@gnu.org \
    --cc=pwr@bydasein.com \
    --cc=sbaugh@catern.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).