unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Attribute names when calling face-attribute
@ 2022-01-13  0:34 fatiparty--- via Users list for the GNU Emacs text editor
  2022-01-13  0:54 ` Emanuel Berg via Users list for the GNU Emacs text editor
  2022-01-13  8:20 ` Eli Zaretskii
  0 siblings, 2 replies; 7+ messages in thread
From: fatiparty--- via Users list for the GNU Emacs text editor @ 2022-01-13  0:34 UTC (permalink / raw)
  To: Help Gnu Emacs


I am implementing ricci calculus notation.

Regarding the face-attribute function.  Is the attribute pre-defined or can
I select the attribute name?

For instance, could I call "(face-attribute 'default :size)" rather than
"(face-attribute 'default :height)"?
Here is my function

(defun ricci-size (size)
  "Return integer SIZE of superior and inferior glyph.
SIZE  typeface height. Integer scaled in 1/10 of point size.
Not smaller than value set by `ricci-minsize'."

  (ceiling
     (max
        (if (integerp ricci-minsize)
        ricci-minsize
      (condition-case nil ; For bootstrapping.
          (* ricci-minsize
         (face-attribute 'default :height))
        (error 0)))
    (* height ricci-scale))))  ; assumes height is integer.


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

end of thread, other threads:[~2022-01-13  8:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-13  0:34 Attribute names when calling face-attribute fatiparty--- via Users list for the GNU Emacs text editor
2022-01-13  0:54 ` Emanuel Berg via Users list for the GNU Emacs text editor
2022-01-13  1:09   ` fatiparty--- via Users list for the GNU Emacs text editor
2022-01-13  1:36     ` Emanuel Berg via Users list for the GNU Emacs text editor
2022-01-13  2:20       ` fatiparty--- via Users list for the GNU Emacs text editor
2022-01-13  4:11         ` Emanuel Berg via Users list for the GNU Emacs text editor
2022-01-13  8:20 ` Eli Zaretskii

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).