Next: , Previous: , Up: Faces   [Contents][Index]


49.1.4 Face Convenience Functions

Command: set-face-foreground face color &optional locale tag-set how-to-add
Command: set-face-background face color &optional locale tag-set how-to-add

These functions set the foreground (respectively, background) color of face face to color. The argument color should be a string (the name of a color) or a color object as returned by make-color (see Colors).

Command: set-face-background-pixmap face pixmap &optional locale tag-set how-to-add

This function sets the background pixmap of face face to pixmap. The argument pixmap should be a string (the name of a bitmap or pixmap file; the directories listed in the variable x-bitmap-file-path will be searched) or a glyph object as returned by make-glyph (see Glyphs). The argument may also be a list of the form (width height data) where width and height are the size in pixels, and data is a string, containing the raw bits of the bitmap.

Similarly to how the glyph’s image specifier works See Creating Glyphs, you don’t create your own image specifier, but rather add specifications to the existing one. Note that the image instance that is generated in order to actually display the background pixmap is of type mono-pixmap, meaning that it’s a two-color image and the foreground and background of the image get filled in with the corresponding colors from the face. (#### Is this still true?)

Command: set-face-font face font &optional locale tag-set how-to-add

This function sets the font of face face. The argument font should be a string or a font object as returned by make-font (see Fonts).

Command: set-face-underline-p face underline-p &optional locale tag-set how-to-add

This function sets the underline property of face face.

Function: face-foreground face &optional locale tag-set exact-p
Function: face-background face &optional locale tag-set exact-p

These functions return the foreground (respectively, background) color specifier of face face. See Colors.

Function: face-background-pixmap face &optional locale tag-set exact-p

This function returns the background-pixmap image specifier of face face.

Function: face-font face &optional locale tag-set exact-p

This function returns the font specifier of face face.

Note: This is not the same as the function face-font in FSF Emacs.

See Fonts.

Function: face-font-name face &optional domain

This function returns the name of the font of face face, or nil if it is unspecified. This is basically equivalent to (font-name (face-font face) domain) except that it does not cause an error if face’s font is nil.

Note: This function is named face-font in FSF Emacs.

Function: face-underline-p face &optional locale

This function returns the underline property of face face.

Function: face-foreground-instance face &optional domain
Function: face-background-instance face &optional domain

These functions return the foreground (respectively, background) color specifier of face face. See Colors.

Function: face-background-pixmap-instance face &optional domain

This function return the background-pixmap glyph object of face face.

Function: face-font-instance face &optional domain

This function returns the font specifier of face face. See Fonts.


Next: , Previous: , Up: Faces   [Contents][Index]