aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2015-12-03 18:03:47 +0200
committerEli Zaretskii2015-12-03 18:03:47 +0200
commit44d6957767f4de200aab437166589652033f42fe (patch)
tree11a60920b7bde4c00aacdc1f039c369d43462e8e
parenteca277f937f4c51b83fa0f156b8081e88ea3f121 (diff)
downloademacs-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.texi33
-rw-r--r--etc/NEWS36
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
3664The following four functions return size information about fonts used
3665by various faces, allowing various layout considerations in Lisp
3666programs. These functions take face remapping into consideration,
3667returning information about the remapped face, if the face in question
3668was remapped. @xref{Face Remapping}.
3669
3670@defun default-font-width
3671This function returns the average width in pixels of the font used by
3672the current buffer's default face.
3673@end defun
3674
3675@defun default-font-height
3676This function returns the height in pixels of the font used by the
3677current buffer's default face.
3678@end defun
3679
3680@defun window-font-width &optional window face
3681This 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
3683window. If @code{nil} or omitted, @var{window} defaults to the
3684selected 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
3689This 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
3691window. If @code{nil} or omitted, @var{window} defaults to the
3692selected 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
diff --git a/etc/NEWS b/etc/NEWS
index fa43a7f9f6a..0bde705af8c 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -181,21 +181,6 @@ for use in Emacs bug reports.
181hiding character but the default `.' can be used by let-binding the 181hiding character but the default `.' can be used by let-binding the
182variable `read-hide-char'. 182variable `read-hide-char'.
183 183
184** The function `font-info' now returns more details about a font.
185In particular, it now returns the average width of the font's
186characters, which can be used for geometry-related calculations.
187
188** A new function `default-font-width' returns the average width of a
189character in the current buffer's default font. If the default face
190is remapped (see `face-remapping-alist'), the value for the remapped
191face is returned. This function complements the existing function
192`default-font-height'.
193
194** New functions `window-font-height' and `window-font-width' return
195the height and average width of characters in a specified face and
196window. If FACE is remapped (see `face-remapping-alist'), the
197function 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
200number of characters that can be displayed on one line. If a face 185number of characters that can be displayed on one line. If a face
201and/or window are provided, these values are used for the 186and/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
1237directory at point. 1222directory 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.
1229In particular, it now returns the average width of the font's
1230characters, which can be used for geometry-related calculations.
1231
1232+++
1233**** A new function `default-font-width' returns the average width of a
1234character in the current buffer's default font. If the default face
1235is remapped (see `face-remapping-alist'), the value for the remapped
1236face 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
1241the height and average width of characters in a specified face and
1242window. If FACE is remapped (see `face-remapping-alist'), the
1243function 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