aboutsummaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorTitus von der Malsburg2015-03-21 12:31:29 +0200
committerEli Zaretskii2015-03-21 12:31:29 +0200
commit4a50af936e24b5f71df4079beb6dde82ed1955c2 (patch)
tree820f0e83852d7bab9b050e4adaf38e8e928dacbc /etc
parent70565a21765ea5f9b163e1a0ef1331df03c7fc67 (diff)
downloademacs-4a50af936e24b5f71df4079beb6dde82ed1955c2.tar.gz
emacs-4a50af936e24b5f71df4079beb6dde82ed1955c2.zip
Add new functions for computing default font dimensions
lisp/window.el (window-font-width, window-font-height) (window-max-chars-per-line): New functions. lisp/simple.el (default-font-height): Doc fix. (default-font-width): New function. etc/NEWS: Mention `default-font-width', `window-font-height', `window-font-width', and `window-max-chars-per-line'.
Diffstat (limited to 'etc')
-rw-r--r--etc/ChangeLog5
-rw-r--r--etc/NEWS18
2 files changed, 23 insertions, 0 deletions
diff --git a/etc/ChangeLog b/etc/ChangeLog
index cd5c54037c8..c94e12296ed 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,8 @@
12015-03-21 Titus von der Malsburg <malsburg@posteo.de>
2
3 * NEWS: Mention `default-font-width', `window-font-height',
4 `window-font-width', and `window-max-chars-per-line'.
5
12015-03-03 Kelvin White <kwhite@gnu.org> 62015-03-03 Kelvin White <kwhite@gnu.org>
2 7
3 * NEWS.24: Add section to include ERC changes. 8 * NEWS.24: Add section to include ERC changes.
diff --git a/etc/NEWS b/etc/NEWS
index cabd0087d92..7cdb24b402e 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -173,6 +173,24 @@ possible inaccuracies in the end position.
173In particular, it now returns the average width of the font's 173In particular, it now returns the average width of the font's
174characters, which can be used for geometry-related calculations. 174characters, which can be used for geometry-related calculations.
175 175
176** A new function `default-font-width' returns the average width of a
177character in the current buffer's default font. If the default face
178is remapped (see `face-remapping-alist'), the value for the remapped
179face is returned. This function complements the existing function
180`default-font-height'.
181
182** New functions `window-font-height' and `window-font-width' return
183the height and average width of characters in a specified face and
184window. If FACE is remapped (see `face-remapping-alist'), the
185function returns the information for the remapped face.
186
187** A new function `window-max-chars-per-line' returns the maximal
188number of characters that can be displayed on one line. If a face
189and/or window are provided, these values are used for the
190calculation. This function is different from `window-body-width' in
191that it accounts for (i) continuation glyphs, (ii) the size of the
192font, and (iii) the specified window.
193
176 194
177* Editing Changes in Emacs 25.1 195* Editing Changes in Emacs 25.1
178 196