* "Harmonizing" the :height attribute for multiple faces in the same string?
@ 2020-09-08 16:33 Bastien
2020-09-08 17:28 ` Eli Zaretskii
2020-09-08 19:11 ` Stefan Monnier
0 siblings, 2 replies; 5+ messages in thread
From: Bastien @ 2020-09-08 16:33 UTC (permalink / raw)
To: emacs-devel
Dear all,
given a string combining various substrings each with a different
face, each face with a different :height attribute: how can I set
:height to the same value for all faces in this string, keeping
the faces (and their attributes) distincts ?
The use case is this: when navigating Org headings, the minibuffer
displays the heading the point is on, but when users customize the
height of the various heading levels (org-level-1, etc.), then the
displayed heading in the minibuffer combines multiple heights,
which is ugly.
Any help appreciated!
Thanks,
--
Bastien
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: "Harmonizing" the :height attribute for multiple faces in the same string?
2020-09-08 16:33 "Harmonizing" the :height attribute for multiple faces in the same string? Bastien
@ 2020-09-08 17:28 ` Eli Zaretskii
2020-09-08 18:48 ` Clément Pit-Claudel
2020-09-08 19:11 ` Stefan Monnier
1 sibling, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2020-09-08 17:28 UTC (permalink / raw)
To: Bastien; +Cc: emacs-devel
> From: Bastien <bzg@gnu.org>
> Date: Tue, 08 Sep 2020 18:33:55 +0200
>
> given a string combining various substrings each with a different
> face, each face with a different :height attribute: how can I set
> :height to the same value for all faces in this string, keeping
> the faces (and their attributes) distincts ?
Define new faces, each of which inherit from the one of the respective
substring, and then override the :height with set-face-attribute?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: "Harmonizing" the :height attribute for multiple faces in the same string?
2020-09-08 17:28 ` Eli Zaretskii
@ 2020-09-08 18:48 ` Clément Pit-Claudel
0 siblings, 0 replies; 5+ messages in thread
From: Clément Pit-Claudel @ 2020-09-08 18:48 UTC (permalink / raw)
To: emacs-devel
On 9/8/20 1:28 PM, Eli Zaretskii wrote:
>> From: Bastien <bzg@gnu.org>
>> Date: Tue, 08 Sep 2020 18:33:55 +0200
>>
>> given a string combining various substrings each with a different
>> face, each face with a different :height attribute: how can I set
>> :height to the same value for all faces in this string, keeping
>> the faces (and their attributes) distincts ?
>
> Define new faces, each of which inherit from the one of the respective
> substring, and then override the :height with set-face-attribute?
Alternatively, does add-face-text-property help?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: "Harmonizing" the :height attribute for multiple faces in the same string?
2020-09-08 16:33 "Harmonizing" the :height attribute for multiple faces in the same string? Bastien
2020-09-08 17:28 ` Eli Zaretskii
@ 2020-09-08 19:11 ` Stefan Monnier
2020-09-09 8:50 ` Bastien
1 sibling, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2020-09-08 19:11 UTC (permalink / raw)
To: Bastien; +Cc: emacs-devel
> given a string combining various substrings each with a different
> face, each face with a different :height attribute: how can I set
> :height to the same value for all faces in this string, keeping
> the faces (and their attributes) distincts ?
How 'bout `add-face-text-property` with a face that specifies the :height?
Stefan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: "Harmonizing" the :height attribute for multiple faces in the same string?
2020-09-08 19:11 ` Stefan Monnier
@ 2020-09-09 8:50 ` Bastien
0 siblings, 0 replies; 5+ messages in thread
From: Bastien @ 2020-09-09 8:50 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-devel
Hi Stefan,
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> given a string combining various substrings each with a different
>> face, each face with a different :height attribute: how can I set
>> :height to the same value for all faces in this string, keeping
>> the faces (and their attributes) distincts ?
>
> How 'bout `add-face-text-property` with a face that specifies the
> :height?
I ended up using such a solution, thanks a lot for putting me on the
right tracks!
--
Bastien
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-09-09 8:50 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-08 16:33 "Harmonizing" the :height attribute for multiple faces in the same string? Bastien
2020-09-08 17:28 ` Eli Zaretskii
2020-09-08 18:48 ` Clément Pit-Claudel
2020-09-08 19:11 ` Stefan Monnier
2020-09-09 8:50 ` Bastien
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).