annotate man/lispref/faces.texi @ 267:966663fcf606 r20-5b32

Import from CVS: tag r20-5b32
author cvs
date Mon, 13 Aug 2007 10:26:29 +0200
parents 376386a54a3c
children 54f7aa390f4f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 @c -*-texinfo-*-
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 @c This is part of the XEmacs Lisp Reference Manual.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 @c Copyright (C) 1995 Ben Wing.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 @c See the file lispref.texi for copying conditions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 @setfilename ../../info/faces.info
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 @node Faces and Window-System Objects, Glyphs, Specifiers, top
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 @chapter Faces and Window-System Objects
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 @cindex faces
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 @cindex window-system objects
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 @menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 * Faces:: Controlling the way text looks.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 * Fonts:: Controlling the typeface of text.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 * Colors:: Controlling the color of text and pixmaps.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 @end menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 @node Faces
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 @section Faces
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 A @dfn{face} is a named collection of graphical properties: font,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 foreground color, background color, background pixmap, optional
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 underlining, and (on TTY devices) whether the text is to be highlighted,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 dimmed, blinking, or displayed in reverse video. Faces control the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 display of text on the screen. Every face has a name, which is a symbol
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 such as @code{default} or @code{modeline}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 Each built-in property of a face is controlled using a specifier,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 which allows it to have separate values in particular buffers, frames,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 windows, and devices and to further vary according to device type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 (X or TTY) and device class (color, mono, or grayscale).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 @xref{Specifiers} for more information.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 The face named @code{default} is used for ordinary text. The face named
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 @code{modeline} is used for displaying the modeline. The face named
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 @code{highlight} is used for highlighted extents (@pxref{Extents}). The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 faces named @code{left-margin} and @code{right-margin} are used for the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 left and right margin areas, respectively (@pxref{Annotations}). The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 face named @code{zmacs-region} is used for the highlighted region
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 between point and mark.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 @menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 * Merging Faces:: How XEmacs decides which face to use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 for a character.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 * Basic Face Functions:: How to define and examine faces.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 * Face Properties:: How to access and modify a face's properties.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 * Face Convenience Functions:: Convenience functions for accessing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 particular properties of a face.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 * Other Face Display Functions:: Other functions pertaining to how a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 a face appears.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 @end menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 @node Merging Faces
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 @subsection Merging Faces for Display
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 Here are all the ways to specify which face to use for display of text:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 @itemize @bullet
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 With defaults. Each frame has a @dfn{default face}, which is used for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 all text that doesn't somehow specify another face. The face named
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 @code{default} applies to the text area, while the faces
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 @code{left-margin} and @code{right-margin} apply to the left and right
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 margin areas.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 With text properties. A character may have a @code{face} property; if so,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 it's displayed with that face. (Text properties are actually implemented
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 in terms of extents.) @xref{Text Properties}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 With extents. An extent may have a @code{face} property, which applies
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 to all the text covered by the extent; in addition, if the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 @code{highlight} property is set, the @code{highlight} property applies
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 when the mouse moves over the extent or if the extent is explicitly
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 highlighted. @xref{Extents}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 With annotations. Annotations that are inserted into a buffer can specify
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 their own face. (Annotations are actually implemented in terms of extents.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 @xref{Annotations}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 @end itemize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 If these various sources together specify more than one face for a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 particular character, XEmacs merges the properties of the various faces
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 specified. Extents, text properties, and annotations all use the same
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 underlying representation (as extents). When multiple extents cover one
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 character, an extent with higher priority overrides those with lower
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 priority. @xref{Extents}. If no extent covers a particular character,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 the @code{default} face is used.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 @cindex background pixmap
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 If a background pixmap is specified, it determines what will be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 displayed in the background of text characters. If the background
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 pixmap is actually a pixmap, with its colors specified, those colors are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 used; if it is a bitmap, the face's foreground and background colors are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 used to color it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 @node Basic Face Functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 @subsection Basic Functions for Working with Faces
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 The properties a face can specify include the font, the foreground
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 color, the background color, the background pixmap, the underlining,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 the display table, and (for TTY devices) whether the text is to be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 highlighted, dimmed, blinking, or displayed in reverse video.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 The face can also leave these unspecified, causing them to assume the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 value of the corresponding property of the @code{default} face.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 Here are the basic primitives for working with faces.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 @defun make-face name &optional doc-string temporary
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 This function defines and returns a new face named @var{name}, initially
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 with all properties unspecified. It does nothing if there is already a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 face named @var{name}. Optional argument @var{doc-string} specifies
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 an explanatory string used for descriptive purposes. If optional
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 argument @var{temporary} is non-@code{nil}, the face will automatically
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 disappear when there are no more references to it anywhere in text or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 Lisp code (otherwise, the face will continue to exist indefinitely
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 even if it is not used).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 @defun face-list &optional temporary
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 This function returns a list of the names of all defined faces. If
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 @var{temporary} is @code{nil}, only the permanent faces are included.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 If it is @code{t}, only the temporary faces are included. If it is any
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 other non-@code{nil} value both permanent and temporary are included.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 @defun facep object
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 This function returns whether the given object is a face.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 @defun copy-face old-face new-name &optional locale how-to-add
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 This function defines a new face named @var{new-name} which is a copy of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 the existing face named @var{old-face}. If there is already a face
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 named @var{new-name}, then it alters the face to have the same
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 properties as @var{old-face}. @var{locale} and @var{how-to-add}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 let you copy just parts of the old face rather than the whole face,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 and are as in @code{copy-specifier} (@pxref{Specifiers}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 @node Face Properties
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 @subsection Face Properties
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 You can examine and modify the properties of an existing face with the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 following functions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 The following symbols have predefined meanings:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 @table @code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 @item foreground
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 The foreground color of the face.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 @item background
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 The background color of the face.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 @item font
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 The font used to display text covered by this face.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 @item display-table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 The display table of the face.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 @item background-pixmap
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 The pixmap displayed in the background of the face. Only used by faces
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 on X devices.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 @item underline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 Underline all text covered by this face.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 @item highlight
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 Highlight all text covered by this face. Only used by faces on TTY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 devices.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 @item dim
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 Dim all text covered by this face. Only used by faces on TTY devices.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 @item blinking
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 Blink all text covered by this face. Only used by faces on TTY devices.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 @item reverse
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 Reverse the foreground and background colors. Only used by faces on TTY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 devices.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 @item doc-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 Description of what the face's normal use is. NOTE: This is not a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 specifier, unlike all the other built-in properties, and cannot contain
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 locale-specific values.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 @defun set-face-property face property value &optional locale tag how-to-add
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 This function changes a property of a @var{face}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 For built-in properties, the actual value of the property is a specifier
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 and you cannot change this; but you can change the specifications within
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 the specifier, and that is what this function will do. For user-defined
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 properties, you can use this function to either change the actual value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 of the property or, if this value is a specifier, change the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 specifications within it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 If @var{property} is a built-in property, the specifications to be added
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 to this property can be supplied in many different ways:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 @itemize @bullet
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 If @var{value} is a simple instantiator (e.g. a string naming a font or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 color) or a list of instantiators, then the instantiator(s) will be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 added as a specification of the property for the given @var{locale}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 (which defaults to @code{global} if omitted).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 If @var{value} is a list of specifications (each of which is a cons of a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 locale and a list of instantiators), then @var{locale} must be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 @code{nil} (it does not make sense to explicitly specify a locale in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 this case), and specifications will be added as given.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 If @var{value} is a specifier (as would be returned by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 @code{face-property} if no @var{locale} argument is given), then some or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 all of the specifications in the specifier will be added to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 property. In this case, the function is really equivalent to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 @code{copy-specifier} and @var{locale} has the same semantics (if it is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 a particular locale, the specification for the locale will be copied; if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 a locale type, specifications for all locales of that type will be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 copied; if @code{nil} or @code{all}, then all specifications will be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 copied).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 @end itemize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 @var{how-to-add} should be either @code{nil} or one of the symbols
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 @code{prepend}, @code{append}, @code{remove-tag-set-prepend},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 @code{remove-tag-set-append}, @code{remove-locale},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 @code{remove-locale-type}, or @code{remove-all}. See
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 @code{copy-specifier} and @code{add-spec-to-specifier} for a description
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 of what each of these means. Most of the time, you do not need to worry
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 about this argument; the default behavior usually is fine.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 In general, it is OK to pass an instance object (e.g. as returned by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 @code{face-property-instance}) as an instantiator in place of an actual
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 instantiator. In such a case, the instantiator used to create that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 instance object will be used (for example, if you set a font-instance
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 object as the value of the @code{font} property, then the font name used
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 to create that object will be used instead). If some cases, however,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 doing this conversion does not make sense, and this will be noted in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 documentation for particular types of instance objects.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 If @var{property} is not a built-in property, then this function will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 simply set its value if @var{locale} is @code{nil}. However, if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 @var{locale} is given, then this function will attempt to add
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 @var{value} as the instantiator for the given @var{locale}, using
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 @code{add-spec-to-specifier}. If the value of the property is not a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 specifier, it will automatically be converted into a @code{generic}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 specifier.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 @defun face-property face property &optional locale
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 This function returns @var{face}'s value of the given @var{property}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 If @var{locale} is omitted, the @var{face}'s actual value for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 @var{property} will be returned. For built-in properties, this will be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 a specifier object of a type appropriate to the property (e.g. a font or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 color specifier). For other properties, this could be anything.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 If @var{locale} is supplied, then instead of returning the actual value,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 the specification(s) for the given locale or locale type will be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 returned. This will only work if the actual value of @var{property} is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 a specifier (this will always be the case for built-in properties, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 not or not may apply to user-defined properties). If the actual value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 of @var{property} is not a specifier, this value will simply be returned
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 regardless of @var{locale}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 The return value will be a list of instantiators (e.g. strings
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 specifying a font or color name), or a list of specifications, each of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 which is a cons of a locale and a list of instantiators. Specifically,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 if @var{locale} is a particular locale (a buffer, window, frame, device,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 or @code{global}), a list of instantiators for that locale will be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 returned. Otherwise, if @var{locale} is a locale type (one of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 symbols @code{buffer}, @code{window}, @code{frame}, or @code{device}),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 the specifications for all locales of that type will be returned.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 Finally, if @var{locale} is @code{all}, the specifications for all
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 locales of all types will be returned.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 The specifications in a specifier determine what the value of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 @var{property} will be in a particular @dfn{domain} or set of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 circumstances, which is typically a particular Emacs window along with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 the buffer it contains and the frame and device it lies within. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 value is derived from the instantiator associated with the most specific
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 locale (in the order buffer, window, frame, device, and @code{global})
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 that matches the domain in question. In other words, given a domain
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 (i.e. an Emacs window, usually), the specifier for @var{property} will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 first be searched for a specification whose locale is the buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 contained within that window; then for a specification whose locale is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 the window itself; then for a specification whose locale is the frame
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 that the window is contained within; etc. The first instantiator that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 is valid for the domain (usually this means that the instantiator is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 recognized by the device [i.e. the X server or TTY device] that the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 domain is on). The function @code{face-property-instance} actually does
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 all this, and is used to determine how to display the face.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 @defun face-property-instance face property &optional domain default no-fallback
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 This function returns the instance of @var{face}'s @var{property} in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 specified @var{domain}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 Under most circumstances, @var{domain} will be a particular window, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 the returned instance describes how the specified property actually is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 displayed for that window and the particular buffer in it. Note that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 this may not be the same as how the property appears when the buffer is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 displayed in a different window or frame, or how the property appears in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 the same window if you switch to another buffer in that window; and in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 those cases, the returned instance would be different.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 The returned instance will typically be a color-instance, font-instance,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 or pixmap-instance object, and you can query it using the appropriate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 object-specific functions. For example, you could use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 @code{color-instance-rgb-components} to find out the RGB (red, green,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 and blue) components of how the @code{background} property of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 @code{highlight} face is displayed in a particular window. The results
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 might be different from the results you would get for another window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 (perhaps the user specified a different color for the frame that window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 is on; or perhaps the same color was specified but the window is on a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 different X server, and that X server has different RGB values for the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 color from this one).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 @var{domain} defaults to the selected window if omitted.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 @var{domain} can be a frame or device, instead of a window. The value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 returned for a such a domain is used in special circumstances when a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 more specific domain does not apply; for example, a frame value might be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 used for coloring a toolbar, which is conceptually attached to a frame
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 rather than a particular window. The value is also useful in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 determining what the value would be for a particular window within the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 frame or device, if it is not overridden by a more specific
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 specification.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 If @var{property} does not name a built-in property, its value will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 simply be returned unless it is a specifier object, in which case it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 will be instanced using @code{specifier-instance}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 Optional arguments @var{default} and @var{no-fallback} are the same as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 in @code{specifier-instance}. @xref{Specifiers}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 @node Face Convenience Functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 @subsection Face Convenience Functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 @defun set-face-foreground face color &optional locale tag how-to-add
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 @defunx set-face-background face color &optional locale tag how-to-add
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 These functions set the foreground (respectively, background) color of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 face @var{face} to @var{color}. The argument @var{color} should be a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 string (the name of a color) or a color object as returned by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 @code{make-color} (@pxref{Colors}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 @defun set-face-background-pixmap face pixmap &optional locale tag how-to-add
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 This function sets the background pixmap of face @var{face} to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 @var{pixmap}. The argument @var{pixmap} should be a string (the name of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 a bitmap or pixmap file; the directories listed in the variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 @code{x-bitmap-file-path} will be searched) or a glyph object as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 returned by @code{make-glyph} (@pxref{Glyphs}). The argument may also
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 be a list of the form @code{(@var{width} @var{height} @var{data})} where
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 @var{width} and @var{height} are the size in pixels, and @var{data} is a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 string, containing the raw bits of the bitmap.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 @defun set-face-font face font &optional locale tag how-to-add
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 This function sets the font of face @var{face}. The argument @var{font}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 should be a string or a font object as returned by @code{make-font}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 (@pxref{Fonts}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 @defun set-face-underline-p face underline-p &optional locale tag how-to-add
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 This function sets the underline property of face @var{face}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 @defun face-foreground face &optional locale
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 @defunx face-background face &optional locale
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 These functions return the foreground (respectively, background) color
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 specifier of face @var{face}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 @xref{Colors}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 @defun face-background-pixmap face &optional locale
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 This function return the background-pixmap glyph object of face
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 @var{face}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 @defun face-font face &optional locale
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 This function returns the font specifier of face @var{face}. (Note:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 This is not the same as the function @code{face-font} in FSF Emacs.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 @xref{Fonts}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 @defun face-font-name face &optional domain
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 This function returns the name of the font of face @var{face}, or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 @code{nil} if it is unspecified. This is basically equivalent to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 @code{(font-name (face-font @var{face}) @var{domain})} except that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 it does not cause an error if @var{face}'s font is @code{nil}. (This
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 function is named @code{face-font} in FSF Emacs.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 @defun face-underline-p face &optional locale
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 This function returns the underline property of face @var{face}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 @defun face-foreground-instance face &optional domain
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 @defunx face-background-instance face &optional domain
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 These functions return the foreground (respectively, background) color
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 specifier of face @var{face}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 @xref{Colors}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 @defun face-background-pixmap-instance face &optional domain
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 This function return the background-pixmap glyph object of face
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 @var{face}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413 @defun face-font-instance face &optional domain
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 This function returns the font specifier of face @var{face}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415 @xref{Fonts}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 @node Other Face Display Functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 @subsection Other Face Display Functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421 @defun invert-face face &optional locale
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 Swap the foreground and background colors of face @var{face}. If the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423 face doesn't specify both foreground and background, then its foreground
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424 and background are set to the default background and foreground.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 @defun face-equal face1 face2 &optional domain
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 This returns @code{t} if the faces @var{face1} and @var{face2} will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 display in the same way. @var{domain} is as in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 @code{face-property-instance}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 @defun face-differs-from-default-p face &optional domain
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434 This returns @code{t} if the face @var{face} displays differently from
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 the default face. @var{domain} is as in @code{face-property-instance}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438 @node Fonts
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439 @section Fonts
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440 @cindex fonts
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442 This section describes how to work with font specifier and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443 font instance objects, which encapsulate fonts in the window system.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 @menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 * Font Specifiers:: Specifying how a font will appear.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447 * Font Instances:: What a font specifier gets instanced as.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 * Font Instance Names:: The name of a font instance.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 * Font Instance Size:: The size of a font instance.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450 * Font Instance Characteristics:: Display characteristics of font instances.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451 * Font Convenience Functions:: Convenience functions that automatically
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452 instance and retrieve the properties
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 of a font specifier.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454 @end menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 @node Font Specifiers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457 @subsection Font Specifiers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 @defun font-specifier-p object
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460 This predicate returns @code{t} if @var{object} is a font specifier, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461 @code{nil} otherwise.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464 @node Font Instances
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465 @subsection Font Instances
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467 @defun font-instance-p object
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468 This predicate returns @code{t} if @var{object} is a font instance, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 @code{nil} otherwise.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472 @defun make-font-instance name &optional device noerror
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473 This function creates a new font-instance object of the specified name.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 @var{device} specifies the device this object applies to and defaults to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475 the selected device. An error is signalled if the font is unknown or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476 cannot be allocated; however, if @var{noerror} is non-@code{nil},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 @code{nil} is simply returned in this case.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479 The returned object is a normal, first-class lisp object. The way you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 ``deallocate'' the font is the way you deallocate any other lisp object:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 you drop all pointers to it and allow it to be garbage collected. When
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482 these objects are GCed, the underlying X data is deallocated as well.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485 @node Font Instance Names
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486 @subsection Font Instance Names
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487 @cindex font instance name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 @cindex available fonts
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489 @cindex fonts available
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 @defun list-fonts pattern &optional device
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 This function returns a list of font names matching the given pattern.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 @var{device} specifies which device to search for names, and defaults to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494 the currently selected device.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497 @defun font-instance-name font-instance
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498 This function returns the name used to allocate @var{font-instance}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501 @defun font-instance-truename font-instance
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502 This function returns the canonical name of the given font instance.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503 Font names are patterns which may match any number of fonts, of which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504 the first found is used. This returns an unambiguous name for that font
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505 (but not necessarily its only unambiguous name).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508 @node Font Instance Size
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509 @subsection Font Instance Size
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510 @cindex font instance size
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512 @defun x-font-size font
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513 This function returns the nominal size of the given font. This is done
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514 by parsing its name, so it's likely to lose. X fonts can be specified
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515 (by the user) in either pixels or 10ths of points, and this returns the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516 first one it finds, so you have to decide which units the returned value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517 is measured in yourself ...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520 @defun x-find-larger-font font &optional device
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521 This function loads a new, slightly larger version of the given font (or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522 font name). Returns the font if it succeeds, @code{nil} otherwise. If
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523 scalable fonts are available, this returns a font which is 1 point
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524 larger. Otherwise, it returns the next larger version of this font that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525 is defined.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528 @defun x-find-smaller-font font &optional device
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 This function loads a new, slightly smaller version of the given font
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530 (or font name). Returns the font if it succeeds, @code{nil} otherwise.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531 If scalable fonts are available, this returns a font which is 1 point
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532 smaller. Otherwise, it returns the next smaller version of this font
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 that is defined.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 @node Font Instance Characteristics
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537 @subsection Font Instance Characteristics
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 @cindex font instance characteristics
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539 @cindex characteristics of font instances
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540 @cindex bold
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541 @cindex demibold
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542 @cindex italic
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543 @cindex oblique
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545 @defun font-instance-properties font
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546 This function returns the properties (an alist or @code{nil}) of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
547 @var{font-instance}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550 @defun x-make-font-bold font &optional device
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551 Given an X font specification, this attempts to make a ``bold'' font.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552 If it fails, it returns @code{nil}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555 @defun x-make-font-unbold font &optional device
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 Given an X font specification, this attempts to make a non-bold font.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557 If it fails, it returns @code{nil}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560 @defun x-make-font-italic font &optional device
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561 Given an X font specification, this attempts to make an ``italic'' font.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562 If it fails, it returns @code{nil}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
563 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
565 @defun x-make-font-unitalic font &optional device
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566 Given an X font specification, this attempts to make a non-italic font.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567 If it fails, it returns @code{nil}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570 @defun x-make-font-bold-italic font &optional device
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571 Given an X font specification, this attempts to make a ``bold-italic''
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
572 font. If it fails, it returns @code{nil}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
575 @node Font Convenience Functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
576 @subsection Font Convenience Functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
577
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
578 @defun font-name font &optional domain
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579 This function returns the name of the @var{font} in the specified
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580 @var{domain}, if any. @var{font} should be a font specifier object and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
581 @var{domain} is normally a window and defaults to the selected window if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
582 omitted. This is equivalent to using @code{specifier-instance} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
583 applying @code{font-instance-name} to the result.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
584 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
586 @defun font-truename font &optional domain
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
587 This function returns the truename of the @var{font} in the specified
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
588 @var{domain}, if any. @var{font} should be a font specifier object and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
589 @var{domain} is normally a window and defaults to the selected window if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
590 omitted. This is equivalent to using @code{specifier-instance} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
591 applying @code{font-instance-truename} to the result.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
592 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
593
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
594 @defun font-properties font &optional domain
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
595 This function returns the properties of the @var{font} in the specified
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
596 @var{domain}, if any. @var{font} should be a font specifier object and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
597 @var{domain} is normally a window and defaults to the selected window if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
598 omitted. This is equivalent to using @code{specifier-instance} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
599 applying @code{font-instance-properties} to the result.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
600 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
601
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
602 @node Colors
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
603 @section Colors
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
604 @cindex colors
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
605
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
606 @menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
607 * Color Specifiers:: Specifying how a color will appear.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
608 * Color Instances:: What a color specifier gets instanced as.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
609 * Color Instance Properties:: Properties of color instances.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
610 * Color Convenience Functions:: Convenience functions that automatically
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
611 instance and retrieve the properties
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
612 of a color specifier.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
613 @end menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
614
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
615 @node Color Specifiers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
616 @subsection Color Specifiers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
617
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
618 @defun color-specifier-p object
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
619 This function returns non-@code{nil} if @var{object} is a color specifier.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
620 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
621
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
622 @node Color Instances
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
623 @subsection Color Instances
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
624 @cindex color instances
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
625
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
626 A @dfn{color-instance object} is an object describing the way a color
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
627 specifier is instanced in a particular domain. Functions such as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
628 @code{face-background-instance} return a color-instance object. For
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
629 example,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
630
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
631 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
632 (face-background-instance 'default (next-window))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
633 @result{} #<color-instance moccasin 47=(FFFF,E4E4,B5B5) 0x678d>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
634 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
635
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
636 The color-instance object returned describes the way the background
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
637 color of the @code{default} face is displayed in the next window after
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
638 the selected one.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
639
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
640 @defun color-instance-p object
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
641 This function returns non-@code{nil} if @var{object} is a color-instance.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
642 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
643
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
644 @node Color Instance Properties
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
645 @subsection Color Instance Properties
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
646
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
647 @defun color-instance-name color-instance
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
648 This function returns the name used to allocate @var{color-instance}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
649 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
650
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
651 @defun color-instance-rgb-components color-instance
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
652 This function returns a three element list containing the red, green,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
653 and blue color components of @var{color-instance}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
654
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
655 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
656 (color-instance-rgb-components
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
657 (face-background-instance 'default (next-window)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
658 @result{} (65535 58596 46517)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
659 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
660 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
661
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
662 @node Color Convenience Functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
663 @subsection Color Convenience Functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
664
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
665 @defun color-name color &optional domain
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
666 This function returns the name of the @var{color} in the specified
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
667 @var{domain}, if any. @var{color} should be a color specifier object
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
668 and @var{domain} is normally a window and defaults to the selected
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
669 window if omitted. This is equivalent to using
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
670 @code{specifier-instance} and applying @code{color-instance-name} to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
671 result.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
672 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
673
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
674 @defun color-rgb-components color &optional domain
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
675 This function returns the @sc{RGB} components of the @var{color} in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
676 specified @var{domain}, if any. @var{color} should be a color specifier
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
677 object and @var{domain} is normally a window and defaults to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
678 selected window if omitted. This is equivalent to using
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
679 @code{specifier-instance} and applying
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
680 @code{color-instance-rgb-components} to the result.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
681
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
682 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
683 (color-rgb-components (face-background 'default (next-window)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
684 @result{} (65535 58596 46517)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
685 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
686 @end defun