all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* :family  and  :height  in set-face-attribute
@ 2024-06-24 10:32 Heime
  2024-06-24 12:54 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Heime @ 2024-06-24 10:32 UTC (permalink / raw)
  To: Heime via Users list for the GNU Emacs text editor


I have the following command working

(buffer-face-mode-invoke
  `(:family ,face-family :height ,(string-to-number face-height)) t)

But this one does not

(set-face-attribute 'default nil
  :family face-family :height (string-to-number face-height))




Sent with Proton Mail secure email.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: :family  and  :height  in set-face-attribute
  2024-06-24 10:32 :family and :height in set-face-attribute Heime
@ 2024-06-24 12:54 ` Eli Zaretskii
  2024-06-24 14:57   ` Heime
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2024-06-24 12:54 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Mon, 24 Jun 2024 10:32:25 +0000
> From: Heime <heimeborgia@protonmail.com>
> 
> 
> I have the following command working
> 
> (buffer-face-mode-invoke
>   `(:family ,face-family :height ,(string-to-number face-height)) t)
> 
> But this one does not
> 
> (set-face-attribute 'default nil
>   :family face-family :height (string-to-number face-height))

Works for me.  But since you haven't shown the values of face-family
and face-height, it's hard to tell whether I reproduced what you do.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: :family  and  :height  in set-face-attribute
  2024-06-24 12:54 ` Eli Zaretskii
@ 2024-06-24 14:57   ` Heime
  2024-06-24 15:34     ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Heime @ 2024-06-24 14:57 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs






Sent with Proton Mail secure email.

On Monday, June 24th, 2024 at 12:54 PM, Eli Zaretskii <eliz@gnu.org> wrote:

> > Date: Mon, 24 Jun 2024 10:32:25 +0000
> > From: Heime heimeborgia@protonmail.com
> > 
> > I have the following command working
> > 
> > (buffer-face-mode-invoke
> > `(:family ,face-family :height ,(string-to-number face-height)) t)
> > 
> > But this one does not
> > 
> > (set-face-attribute 'default nil
> > :family face-family :height (string-to-number face-height))
> 
> 
> Works for me. But since you haven't shown the values of face-family
> and face-height, it's hard to tell whether I reproduced what you do.

This is it

(defvar monatt nil
  "A boolean variable that is true by default.")

(defun monfont (face-family face-height)

  (interactive

    (list

      (let ( (cseq '("Wargames" "URW Chancery L" "Century Schoolbook L" "Bold Oblique")) )

        (completing-read " Family Name: " cseq nil t "Bold Oblique"))


      (let ( (hseq '("340" "300" "260" "220" "180")) )

        (completing-read " Face Height: " hseq nil t "180")) ))

  (if monatt

      (buffer-face-mode-invoke

        `(:family ,face-family :height ,(string-to-number face-height)) t)

    (set-face-attribute 'default nil

      :family face-family :height (string-to-number face-height)) ))





^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: :family  and  :height  in set-face-attribute
  2024-06-24 14:57   ` Heime
@ 2024-06-24 15:34     ` Eli Zaretskii
  2024-06-24 15:39       ` Heime
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2024-06-24 15:34 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Mon, 24 Jun 2024 14:57:09 +0000
> From: Heime <heimeborgia@protonmail.com>
> Cc: help-gnu-emacs@gnu.org
> 
> On Monday, June 24th, 2024 at 12:54 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> 
> > > Date: Mon, 24 Jun 2024 10:32:25 +0000
> > > From: Heime heimeborgia@protonmail.com
> > > 
> > > I have the following command working
> > > 
> > > (buffer-face-mode-invoke
> > > `(:family ,face-family :height ,(string-to-number face-height)) t)
> > > 
> > > But this one does not
> > > 
> > > (set-face-attribute 'default nil
> > > :family face-family :height (string-to-number face-height))
> > 
> > 
> > Works for me. But since you haven't shown the values of face-family
> > and face-height, it's hard to tell whether I reproduced what you do.
> 
> This is it
> 
> (defvar monatt nil
>   "A boolean variable that is true by default.")
> 
> (defun monfont (face-family face-height)
> 
>   (interactive
> 
>     (list
> 
>       (let ( (cseq '("Wargames" "URW Chancery L" "Century Schoolbook L" "Bold Oblique")) )
> 
>         (completing-read " Family Name: " cseq nil t "Bold Oblique"))
> 
> 
>       (let ( (hseq '("340" "300" "260" "220" "180")) )
> 
>         (completing-read " Face Height: " hseq nil t "180")) ))
> 
>   (if monatt
> 
>       (buffer-face-mode-invoke
> 
>         `(:family ,face-family :height ,(string-to-number face-height)) t)
> 
>     (set-face-attribute 'default nil
> 
>       :family face-family :height (string-to-number face-height)) ))

Come on, can't you just show the values you use in the
set-face-attribute call?

Also, is the value of face-family with which you call
set-face-attribute one of the families returned by font-family-list?



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: :family  and  :height  in set-face-attribute
  2024-06-24 15:34     ` Eli Zaretskii
@ 2024-06-24 15:39       ` Heime
  2024-06-24 16:29         ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Heime @ 2024-06-24 15:39 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs






Sent with Proton Mail secure email.

On Monday, June 24th, 2024 at 3:34 PM, Eli Zaretskii <eliz@gnu.org> wrote:

> > Date: Mon, 24 Jun 2024 14:57:09 +0000
> > From: Heime heimeborgia@protonmail.com
> > Cc: help-gnu-emacs@gnu.org
> > 
> > On Monday, June 24th, 2024 at 12:54 PM, Eli Zaretskii eliz@gnu.org wrote:
> > 
> > > > Date: Mon, 24 Jun 2024 10:32:25 +0000
> > > > From: Heime heimeborgia@protonmail.com
> > > > 
> > > > I have the following command working
> > > > 
> > > > (buffer-face-mode-invoke
> > > > `(:family ,face-family :height ,(string-to-number face-height)) t)
> > > > 
> > > > But this one does not
> > > > 
> > > > (set-face-attribute 'default nil
> > > > :family face-family :height (string-to-number face-height))
> > > 
> > > Works for me. But since you haven't shown the values of face-family
> > > and face-height, it's hard to tell whether I reproduced what you do.
> > 
> > This is it
> > 
> > (defvar monatt nil
> > "A boolean variable that is true by default.")
> > 
> > (defun monfont (face-family face-height)
> > 
> > (interactive
> > 
> > (list
> > 
> > (let ( (cseq '("Wargames" "URW Chancery L" "Century Schoolbook L" "Bold Oblique")) )
> > 
> > (completing-read " Family Name: " cseq nil t "Bold Oblique"))
> > 
> > (let ( (hseq '("340" "300" "260" "220" "180")) )
> > 
> > (completing-read " Face Height: " hseq nil t "180")) ))
> > 
> > (if monatt
> > 
> > (buffer-face-mode-invoke
> > 
> > `(:family ,face-family :height ,(string-to-number face-height)) t)
> > 
> > (set-face-attribute 'default nil
> > 
> > :family face-family :height (string-to-number face-height)) ))
> 
> 
> Come on, can't you just show the values you use in the
> set-face-attribute call?

I use the strings in cseq
 
> Also, is the value of face-family with which you call
> set-face-attribute one of the families returned by font-family-list?
 
Yes they are.  Calling buffer-face-mode-invoke does what is expected to happen.  But not for set-face-attribute.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: :family  and  :height  in set-face-attribute
  2024-06-24 15:39       ` Heime
@ 2024-06-24 16:29         ` Eli Zaretskii
  2024-06-24 17:16           ` Heime
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2024-06-24 16:29 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Mon, 24 Jun 2024 15:39:07 +0000
> From: Heime <heimeborgia@protonmail.com>
> Cc: help-gnu-emacs@gnu.org
> 
> > > (set-face-attribute 'default nil
> > > 
> > > :family face-family :height (string-to-number face-height)) ))
> > 
> > 
> > Come on, can't you just show the values you use in the
> > set-face-attribute call?
> 
> I use the strings in cseq
>  
> > Also, is the value of face-family with which you call
> > set-face-attribute one of the families returned by font-family-list?
>  
> Yes they are.  Calling buffer-face-mode-invoke does what is expected to happen.  But not for set-face-attribute.

Then I don't know why it didn't work for you, sorry.  It did work for
me (but with font families I have, not with yours, which I don't
have).



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: :family  and  :height  in set-face-attribute
  2024-06-24 16:29         ` Eli Zaretskii
@ 2024-06-24 17:16           ` Heime
  0 siblings, 0 replies; 7+ messages in thread
From: Heime @ 2024-06-24 17:16 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs






Sent with Proton Mail secure email.

On Monday, June 24th, 2024 at 4:29 PM, Eli Zaretskii <eliz@gnu.org> wrote:

> > Date: Mon, 24 Jun 2024 15:39:07 +0000
> > From: Heime heimeborgia@protonmail.com
> > Cc: help-gnu-emacs@gnu.org
> > 
> > > > (set-face-attribute 'default nil
> > > > 
> > > > :family face-family :height (string-to-number face-height)) ))
> > > 
> > > Come on, can't you just show the values you use in the
> > > set-face-attribute call?
> > 
> > I use the strings in cseq
> > 
> > > Also, is the value of face-family with which you call
> > > set-face-attribute one of the families returned by font-family-list?
> > 
> > Yes they are. Calling buffer-face-mode-invoke does what is expected to happen. But not for set-face-attribute.
> 
> 
> Then I don't know why it didn't work for you, sorry. It did work for
> me (but with font families I have, not with yours, which I don't
> have).

The only instance that works is 

(set-face-attribute 'default nil :font "Wargames")






^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-06-24 17:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-24 10:32 :family and :height in set-face-attribute Heime
2024-06-24 12:54 ` Eli Zaretskii
2024-06-24 14:57   ` Heime
2024-06-24 15:34     ` Eli Zaretskii
2024-06-24 15:39       ` Heime
2024-06-24 16:29         ` Eli Zaretskii
2024-06-24 17:16           ` Heime

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.