diff options
| author | Kim F. Storm | 2007-02-14 11:31:28 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2007-02-14 11:31:28 +0000 |
| commit | 663320a4ffbb84de0f0eb960af7ef109a97d8bf6 (patch) | |
| tree | f614326af5f88728eb0da0c3049ada2792f52d68 /lispref | |
| parent | 9a184b00295e9960b7949712347c349df6fddf5c (diff) | |
| download | emacs-663320a4ffbb84de0f0eb960af7ef109a97d8bf6.tar.gz emacs-663320a4ffbb84de0f0eb960af7ef109a97d8bf6.zip | |
(Glyphs): Add make-glyph-code, glyph-char, glyph-face.
Rewrite glyph code description to refer to these functions.
Remove details of encoding face number and char into integer code.
Diffstat (limited to 'lispref')
| -rw-r--r-- | lispref/display.texi | 46 |
1 files changed, 26 insertions, 20 deletions
diff --git a/lispref/display.texi b/lispref/display.texi index e2b71f45421..02491c422d9 100644 --- a/lispref/display.texi +++ b/lispref/display.texi | |||
| @@ -5266,26 +5266,32 @@ are defined in the library @file{disp-table}. | |||
| 5266 | 5266 | ||
| 5267 | @cindex glyph | 5267 | @cindex glyph |
| 5268 | A @dfn{glyph} is a generalization of a character; it stands for an | 5268 | A @dfn{glyph} is a generalization of a character; it stands for an |
| 5269 | image that takes up a single character position on the screen. Glyphs | 5269 | image that takes up a single character position on the screen. Normally |
| 5270 | are represented in Lisp as integers, just as characters are. Normally | ||
| 5271 | glyphs come from vectors in the display table (@pxref{Display Tables}). | 5270 | glyphs come from vectors in the display table (@pxref{Display Tables}). |
| 5272 | 5271 | ||
| 5273 | A glyph code can be @dfn{simple} or it can be defined by the | 5272 | A glyph is represented in Lisp as a @dfn{glyph code}. A glyph code |
| 5274 | @dfn{glyph table}. A simple glyph code is just a way of specifying a | 5273 | can be @dfn{simple} or it can be defined by the @dfn{glyph table}. A |
| 5275 | character and a face to output it in. When a glyph code is simple, | 5274 | simple glyph code is just a way of specifying a character and a face |
| 5276 | the code, mod 524288, is the character to output, and the code divided | 5275 | to output it in. @xref{Faces}. |
| 5277 | by 524288 specifies the face number (@pxref{Face Functions}) to use | 5276 | |
| 5278 | while outputting it. (524288 is | 5277 | The following functions are used to manipulate simple glyph codes: |
| 5279 | @ifnottex | 5278 | |
| 5280 | 2**19.) | 5279 | @defun make-glyph-code char &optional face |
| 5281 | @end ifnottex | 5280 | This function returns a simple glyph code representing char @var{char} |
| 5282 | @tex | 5281 | with face @var{face}. |
| 5283 | $2^{19}$.) | 5282 | @end defun |
| 5284 | @end tex | 5283 | |
| 5285 | @xref{Faces}. | 5284 | @defun glyph-char glyph |
| 5285 | This function returns the character of simple glyph code @var{glyph}. | ||
| 5286 | @end defun | ||
| 5287 | |||
| 5288 | @defun glyph-face glyph | ||
| 5289 | This function returns face of simple glyph code @var{glyph}, or | ||
| 5290 | @code{nil} if @var{glyph} has the default face (face-id 0). | ||
| 5291 | @end defun | ||
| 5286 | 5292 | ||
| 5287 | On character terminals, you can set up a @dfn{glyph table} to define | 5293 | On character terminals, you can set up a @dfn{glyph table} to define |
| 5288 | the meaning of glyph codes. | 5294 | the meaning of glyph codes (represented as small integers). |
| 5289 | 5295 | ||
| 5290 | @defvar glyph-table | 5296 | @defvar glyph-table |
| 5291 | The value of this variable is the current glyph table. It should be | 5297 | The value of this variable is the current glyph table. It should be |
| @@ -5307,10 +5313,10 @@ displays, all glyph codes are simple. | |||
| 5307 | Send the characters in @var{string} to the terminal to output | 5313 | Send the characters in @var{string} to the terminal to output |
| 5308 | this glyph code. | 5314 | this glyph code. |
| 5309 | 5315 | ||
| 5310 | @item @var{integer} | 5316 | @item @var{code} |
| 5311 | Define this glyph code as an alias for glyph code @var{integer}. You | 5317 | Define this glyph code as an alias for glyph code @var{code} created |
| 5312 | can use such an alias to define a small-numbered glyph code which | 5318 | by @code{make-glyph-code}. You can use such an alias to define a |
| 5313 | specifies a face. | 5319 | small-numbered glyph code which specifies a character with a face. |
| 5314 | 5320 | ||
| 5315 | @item @code{nil} | 5321 | @item @code{nil} |
| 5316 | This glyph code is simple. | 5322 | This glyph code is simple. |