Mercurial > emacs
comparison lispref/display.texi @ 72822:f55964fec436
(Glyphs): Clarifications.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Tue, 12 Sep 2006 01:43:13 +0000 |
parents | 501a2788cfa4 |
children | b84950e6ade6 a1a25ac6c88a |
comparison
equal
deleted
inserted
replaced
72821:887a1899eee7 | 72822:f55964fec436 |
---|---|
5250 | 5250 |
5251 @cindex glyph | 5251 @cindex glyph |
5252 A @dfn{glyph} is a generalization of a character; it stands for an | 5252 A @dfn{glyph} is a generalization of a character; it stands for an |
5253 image that takes up a single character position on the screen. Glyphs | 5253 image that takes up a single character position on the screen. Glyphs |
5254 are represented in Lisp as integers, just as characters are. Normally | 5254 are represented in Lisp as integers, just as characters are. Normally |
5255 Emacs finds glyphs in the display table (@pxref{Display Tables}). | 5255 glyph come from vectors in the display table (@pxref{Display Tables}). |
5256 | 5256 |
5257 A glyph can be @dfn{simple} or it can be defined by the @dfn{glyph | 5257 A glyph code can be @dfn{simple} or it can be defined by the |
5258 table}. A simple glyph is just a way of specifying a character and a | 5258 @dfn{glyph table}. A simple glyph code is just a way of specifying a |
5259 face to output it in. The glyph code for a simple glyph, mod 524288, | 5259 character and a face to output it in. When a glyph code is simple, |
5260 is the character to output, and the glyph code divided by 524288 | 5260 the code, mod 524288, is the character to output, and the code divided |
5261 specifies the face number (@pxref{Face Functions}) to use while | 5261 by 524288 specifies the face number (@pxref{Face Functions}) to use |
5262 outputting it. (524288 is | 5262 while outputting it. (524288 is |
5263 @ifnottex | 5263 @ifnottex |
5264 2**19.) | 5264 2**19.) |
5265 @end ifnottex | 5265 @end ifnottex |
5266 @tex | 5266 @tex |
5267 $2^{19}$.) | 5267 $2^{19}$.) |
5268 @end tex | 5268 @end tex |
5269 @xref{Faces}. | 5269 @xref{Faces}. |
5270 | 5270 |
5271 On character terminals, you can set up a @dfn{glyph table} to define | 5271 On character terminals, you can set up a @dfn{glyph table} to define |
5272 the meaning of glyph codes. The glyph codes is the value of the | 5272 the meaning of glyph codes. |
5273 variable @code{glyph-table}. | |
5274 | 5273 |
5275 @defvar glyph-table | 5274 @defvar glyph-table |
5276 The value of this variable is the current glyph table. It should be a | 5275 The value of this variable is the current glyph table. It should be |
5277 vector; the @var{g}th element defines glyph code @var{g}. | 5276 @code{nil} or a vector whose @var{g}th element defines glyph code |
5277 @var{g}. | |
5278 | 5278 |
5279 If a glyph code is greater than or equal to the length of the glyph | 5279 If a glyph code is greater than or equal to the length of the glyph |
5280 table, that code is automatically simple. If the value of | 5280 table, that code is automatically simple. If @code{glyph-table} is |
5281 @code{glyph-table} is @code{nil} instead of a vector, then all glyphs | 5281 @code{nil} then all glyph codes are simple. |
5282 are simple. The glyph table is not used on graphical displays, only | 5282 |
5283 on character terminals. On graphical displays, all glyphs are simple. | 5283 The glyph table is used only on character terminals. On graphical |
5284 @end defvar | 5284 displays, all glyph codes are simple. |
5285 | 5285 @end defvar |
5286 Here are the possible types of elements in the glyph table: | 5286 |
5287 Here are the meaningful types of elements in the glyph table: | |
5287 | 5288 |
5288 @table @asis | 5289 @table @asis |
5289 @item @var{string} | 5290 @item @var{string} |
5290 Send the characters in @var{string} to the terminal to output | 5291 Send the characters in @var{string} to the terminal to output |
5291 this glyph. This alternative is available on character terminals, | 5292 this glyph code. |
5292 but not on graphical displays. | |
5293 | 5293 |
5294 @item @var{integer} | 5294 @item @var{integer} |
5295 Define this glyph code as an alias for glyph code @var{integer}. You | 5295 Define this glyph code as an alias for glyph code @var{integer}. You |
5296 can use an alias to specify a face code for the glyph and use a small | 5296 can use such an alias to define a small-numbered glyph code which |
5297 number as its code. | 5297 specifies a face. |
5298 | 5298 |
5299 @item @code{nil} | 5299 @item @code{nil} |
5300 This glyph is simple. | 5300 This glyph code is simple. |
5301 @end table | 5301 @end table |
5302 | 5302 |
5303 @defun create-glyph string | 5303 @defun create-glyph string |
5304 This function returns a newly-allocated glyph code which is set up to | 5304 This function returns a newly-allocated glyph code which is set up to |
5305 display by sending @var{string} to the terminal. | 5305 display by sending @var{string} to the terminal. |