From: sbaugh@catern.com
To: emacs-devel@gnu.org
Subject: Re: Horizontal centering in the display engine
Date: Tue, 13 Apr 2021 16:49:59 -0400 [thread overview]
Message-ID: <8735vtx62w.fsf@catern.com> (raw)
In-Reply-To: 83blai0y3i.fsf@gnu.org
Eli Zaretskii <eliz@gnu.org> writes:
>> From: sbaugh@catern.com
>> To have centered text, I think I'd want to do something like
>>
>> :align-to (- center (0.5 . line-size))
>>
>> [...]
>>
>> As far as I understand the documentation, there's no way to express
>> something like line-size currently? Maybe that could be easily added?
>
> We have window-text-pixel-size, isn't that what you want?
But that can't be used in a pixel specification, as far as I understand?
And anyway, I don't think that's right - as the Elisp manual says,
"window-text-pixel-size treats the text displayed in a window as a whole
and does not care about the size of individual lines."
> If that doesn't help, then I guess I'll ask you to describe the use
> case in more detail.
The behavior I want is what's described here:
https://en.wikipedia.org/wiki/Typographic_alignment#Centered
There's a picture on that page captioned "Centered text" which shows the
desired behavior.
> E.g., are you planning on centering each line separately, or
> everything together, or something else?
Each line separately.
> IOW, how did you envision you'd put the display property on each line?
The same display property would be applied to every line.
> and how does this work when the user types text to add more lines, or
> make a line longer than the window? etc. etc.
When they add more lines, those new lines are also centered. If a line
is longer than the window, it's truncated or wrapped depending on
truncate-lines, word-wrap, etc., as usual.
next prev parent reply other threads:[~2021-04-13 20:49 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-13 18:25 Horizontal centering in the display engine 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 [this message]
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
-- strict thread matches above, loose matches on Subject: below --
2021-04-15 5:13 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.
2021-04-15 12:43 ` Stefan Monnier
2021-04-15 13:05 ` Paul W. Rankin via Emacs development discussions.
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=8735vtx62w.fsf@catern.com \
--to=sbaugh@catern.com \
--cc=emacs-devel@gnu.org \
/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).