diff options
| author | Titus von der Malsburg | 2015-03-21 12:31:29 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2015-03-21 12:31:29 +0200 |
| commit | 4a50af936e24b5f71df4079beb6dde82ed1955c2 (patch) | |
| tree | 820f0e83852d7bab9b050e4adaf38e8e928dacbc /etc | |
| parent | 70565a21765ea5f9b163e1a0ef1331df03c7fc67 (diff) | |
| download | emacs-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/ChangeLog | 5 | ||||
| -rw-r--r-- | etc/NEWS | 18 |
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 @@ | |||
| 1 | 2015-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 | |||
| 1 | 2015-03-03 Kelvin White <kwhite@gnu.org> | 6 | 2015-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. |
| @@ -173,6 +173,24 @@ possible inaccuracies in the end position. | |||
| 173 | In particular, it now returns the average width of the font's | 173 | In particular, it now returns the average width of the font's |
| 174 | characters, which can be used for geometry-related calculations. | 174 | characters, which can be used for geometry-related calculations. |
| 175 | 175 | ||
| 176 | ** A new function `default-font-width' returns the average width of a | ||
| 177 | character in the current buffer's default font. If the default face | ||
| 178 | is remapped (see `face-remapping-alist'), the value for the remapped | ||
| 179 | face is returned. This function complements the existing function | ||
| 180 | `default-font-height'. | ||
| 181 | |||
| 182 | ** New functions `window-font-height' and `window-font-width' return | ||
| 183 | the height and average width of characters in a specified face and | ||
| 184 | window. If FACE is remapped (see `face-remapping-alist'), the | ||
| 185 | function returns the information for the remapped face. | ||
| 186 | |||
| 187 | ** A new function `window-max-chars-per-line' returns the maximal | ||
| 188 | number of characters that can be displayed on one line. If a face | ||
| 189 | and/or window are provided, these values are used for the | ||
| 190 | calculation. This function is different from `window-body-width' in | ||
| 191 | that it accounts for (i) continuation glyphs, (ii) the size of the | ||
| 192 | font, and (iii) the specified window. | ||
| 193 | |||
| 176 | 194 | ||
| 177 | * Editing Changes in Emacs 25.1 | 195 | * Editing Changes in Emacs 25.1 |
| 178 | 196 | ||