[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-29 3f04efe9e7d: ; * src/font.h (struct font): Comment about use of
From: |
Eli Zaretskii |
Subject: |
emacs-29 3f04efe9e7d: ; * src/font.h (struct font): Comment about use of average_width. |
Date: |
Sun, 10 Sep 2023 11:31:55 -0400 (EDT) |
branch: emacs-29
commit 3f04efe9e7d56388d29bb19c875c2004691eab4d
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>
; * src/font.h (struct font): Comment about use of average_width.
---
src/font.h | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/src/font.h b/src/font.h
index 492c2e58b09..aea49d6a823 100644
--- a/src/font.h
+++ b/src/font.h
@@ -298,10 +298,16 @@ struct font
SPACE glyph, the value is 0. */
int space_width;
- /* Average width of glyphs in the font. If the font itself doesn't
- have that information, but has glyphs of ASCII characters, the
- value is the average width of those glyphs. Otherwise, the value
- is 0. */
+ /* Average width of glyphs in the font. Should be the average width
+ of the glyphs of ASCII characters. The value for the default
+ face's font is used to determine the canonical character width of
+ the frame (see FRAME_COLUMN_WIDTH). For fonts that are not
+ fixed-pitch, the font backend should actually calculate the value
+ from the glyphs of ASCII characters in the range 32..126
+ inclusively; relying on the average-width attribute recorded in
+ the font is unreliable in this case, especially in fonts that
+ support CJK scripts, where many characters are wide. Value can
+ be zero if the font doesn't have glyphs for ASCII characters. */
int average_width;
/* Ascent and descent of the font (in pixels). */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- emacs-29 3f04efe9e7d: ; * src/font.h (struct font): Comment about use of average_width.,
Eli Zaretskii <=