diff options
| author | Eli Zaretskii | 2015-12-03 18:03:47 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2015-12-03 18:03:47 +0200 |
| commit | 44d6957767f4de200aab437166589652033f42fe (patch) | |
| tree | 11a60920b7bde4c00aacdc1f039c369d43462e8e | |
| parent | eca277f937f4c51b83fa0f156b8081e88ea3f121 (diff) | |
| download | emacs-44d6957767f4de200aab437166589652033f42fe.tar.gz emacs-44d6957767f4de200aab437166589652033f42fe.zip | |
Document new font-related functionality
* doc/lispref/display.texi (Low-Level Font): Document
'default-font-width', 'default-font-height', 'window-font-width',
and 'window-font-height'.
* etc/NEWS: Move entries for 'default-font-width',
'default-font-height', 'window-font-width', and 'window-font-height'
to their place and mark them documented.
| -rw-r--r-- | doc/lispref/display.texi | 33 | ||||
| -rw-r--r-- | etc/NEWS | 36 |
2 files changed, 54 insertions, 15 deletions
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 3d520dbdd69..e9354cc2678 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi | |||
| @@ -3660,6 +3660,39 @@ tag (or @code{nil}, which stands for the default langsys), and each | |||
| 3660 | @end table | 3660 | @end table |
| 3661 | @end defun | 3661 | @end defun |
| 3662 | 3662 | ||
| 3663 | @cindex font information for layout | ||
| 3664 | The following four functions return size information about fonts used | ||
| 3665 | by various faces, allowing various layout considerations in Lisp | ||
| 3666 | programs. These functions take face remapping into consideration, | ||
| 3667 | returning information about the remapped face, if the face in question | ||
| 3668 | was remapped. @xref{Face Remapping}. | ||
| 3669 | |||
| 3670 | @defun default-font-width | ||
| 3671 | This function returns the average width in pixels of the font used by | ||
| 3672 | the current buffer's default face. | ||
| 3673 | @end defun | ||
| 3674 | |||
| 3675 | @defun default-font-height | ||
| 3676 | This function returns the height in pixels of the font used by the | ||
| 3677 | current buffer's default face. | ||
| 3678 | @end defun | ||
| 3679 | |||
| 3680 | @defun window-font-width &optional window face | ||
| 3681 | This function returns the average width in pixels for the font used by | ||
| 3682 | @var{face} in @var{window}. The specified @var{window} must be a live | ||
| 3683 | window. If @code{nil} or omitted, @var{window} defaults to the | ||
| 3684 | selected window, and @var{face} defaults to the default face in | ||
| 3685 | @var{window}. | ||
| 3686 | @end defun | ||
| 3687 | |||
| 3688 | @defun window-font-height &optional window face | ||
| 3689 | This function returns the height in pixels for the font used by | ||
| 3690 | @var{face} in @var{window}. The specified @var{window} must be a live | ||
| 3691 | window. If @code{nil} or omitted, @var{window} defaults to the | ||
| 3692 | selected window, and @var{face} defaults to the default face in | ||
| 3693 | @var{window}. | ||
| 3694 | @end defun | ||
| 3695 | |||
| 3663 | @node Fringes | 3696 | @node Fringes |
| 3664 | @section Fringes | 3697 | @section Fringes |
| 3665 | @cindex fringes | 3698 | @cindex fringes |
| @@ -181,21 +181,6 @@ for use in Emacs bug reports. | |||
| 181 | hiding character but the default `.' can be used by let-binding the | 181 | hiding character but the default `.' can be used by let-binding the |
| 182 | variable `read-hide-char'. | 182 | variable `read-hide-char'. |
| 183 | 183 | ||
| 184 | ** The function `font-info' now returns more details about a font. | ||
| 185 | In particular, it now returns the average width of the font's | ||
| 186 | characters, which can be used for geometry-related calculations. | ||
| 187 | |||
| 188 | ** A new function `default-font-width' returns the average width of a | ||
| 189 | character in the current buffer's default font. If the default face | ||
| 190 | is remapped (see `face-remapping-alist'), the value for the remapped | ||
| 191 | face is returned. This function complements the existing function | ||
| 192 | `default-font-height'. | ||
| 193 | |||
| 194 | ** New functions `window-font-height' and `window-font-width' return | ||
| 195 | the height and average width of characters in a specified face and | ||
| 196 | window. If FACE is remapped (see `face-remapping-alist'), the | ||
| 197 | function returns the information for the remapped face. | ||
| 198 | |||
| 199 | ** A new function `window-max-chars-per-line' returns the maximal | 184 | ** A new function `window-max-chars-per-line' returns the maximal |
| 200 | number of characters that can be displayed on one line. If a face | 185 | number of characters that can be displayed on one line. If a face |
| 201 | and/or window are provided, these values are used for the | 186 | and/or window are provided, these values are used for the |
| @@ -1236,6 +1221,27 @@ name. The variable `system-name' is now obsolete. | |||
| 1236 | ** If `pwd' is called with a prefix argument, insert the current default | 1221 | ** If `pwd' is called with a prefix argument, insert the current default |
| 1237 | directory at point. | 1222 | directory at point. |
| 1238 | 1223 | ||
| 1224 | +++ | ||
| 1225 | ** New functions return extended information about fonts and faces. | ||
| 1226 | |||
| 1227 | +++ | ||
| 1228 | *** The function `font-info' now returns more details about a font. | ||
| 1229 | In particular, it now returns the average width of the font's | ||
| 1230 | characters, which can be used for geometry-related calculations. | ||
| 1231 | |||
| 1232 | +++ | ||
| 1233 | **** A new function `default-font-width' returns the average width of a | ||
| 1234 | character in the current buffer's default font. If the default face | ||
| 1235 | is remapped (see `face-remapping-alist'), the value for the remapped | ||
| 1236 | face is returned. This function complements the existing function | ||
| 1237 | `default-font-height'. | ||
| 1238 | |||
| 1239 | +++ | ||
| 1240 | ***** New functions `window-font-height' and `window-font-width' return | ||
| 1241 | the height and average width of characters in a specified face and | ||
| 1242 | window. If FACE is remapped (see `face-remapping-alist'), the | ||
| 1243 | function returns the information for the remapped face. | ||
| 1244 | |||
| 1239 | --- | 1245 | --- |
| 1240 | ** New utilities in subr-x.el: | 1246 | ** New utilities in subr-x.el: |
| 1241 | *** New macros `if-let' and `when-let' allow defining bindings and to | 1247 | *** New macros `if-let' and `when-let' allow defining bindings and to |