aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2024-05-17 10:18:35 +0300
committerEli Zaretskii2024-05-17 10:18:35 +0300
commit3dd09516c9a87f663fefde77befb7d569cbed9f0 (patch)
treeeb1641039e249ea5b7ddc1306353f5ff957bc622
parent042b58b5ff4ac4c17e03b25fd2c367c1cf869a99 (diff)
downloademacs-3dd09516c9a87f663fefde77befb7d569cbed9f0.tar.gz
emacs-3dd09516c9a87f663fefde77befb7d569cbed9f0.zip
; Improve documentation of 'set-fontset-font'
* doc/lispref/display.texi (Fontsets): * src/fontset.c (Fset_fontset_font): Doc fix (bug#70993).
-rw-r--r--doc/lispref/display.texi8
-rw-r--r--src/fontset.c11
2 files changed, 18 insertions, 1 deletions
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index c6b29e87b3a..f20064519fc 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -4015,6 +4015,14 @@ the charset @code{japanese-jisx0208}:
4015(set-fontset-font t 'japanese-jisx0208 4015(set-fontset-font t 'japanese-jisx0208
4016 (font-spec :family "Kochi Gothic")) 4016 (font-spec :family "Kochi Gothic"))
4017@end smallexample 4017@end smallexample
4018
4019Note that this function should generally be called from the user's
4020init files, and more generally before any of @var{characters} were
4021displayed in the current Emacs session. That's because for some
4022scripts, Emacs caches the way they are displayed, and the cached
4023information includes the font used for them -- once these characters
4024are displayed once, the cached font will continue to be used
4025regardless of changes in the fontsets.
4018@end defun 4026@end defun
4019 4027
4020@defun char-displayable-p char 4028@defun char-displayable-p char
diff --git a/src/fontset.c b/src/fontset.c
index 7af6782a37c..4aa2fb7b2c7 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -1499,7 +1499,16 @@ Optional 5th argument ADD, if non-nil, specifies how to add FONT-SPEC
1499to the previously set font specifications for CHARACTERS. If it is 1499to the previously set font specifications for CHARACTERS. If it is
1500`prepend', FONT-SPEC is prepended to the existing font specifications. 1500`prepend', FONT-SPEC is prepended to the existing font specifications.
1501If it is `append', FONT-SPEC is appended. By default, FONT-SPEC 1501If it is `append', FONT-SPEC is appended. By default, FONT-SPEC
1502overwrites the previous settings. */) 1502overwrites the previous settings.
1503
1504For reliable results, this function should be called before any
1505of CHARACTERS were displayed in the current Emacs session. In
1506particular, if some of CHARACTERS are displayed using character
1507compositions, those compositions will be cached after they are first
1508produced, and the cached values include the font used for displaying
1509the composed characters -- calling this function will not affect the
1510font recorded in the cache of compositions, thus they will continue
1511to be shown using the fonts from before the call. */)
1503 (Lisp_Object fontset, Lisp_Object characters, Lisp_Object font_spec, 1512 (Lisp_Object fontset, Lisp_Object characters, Lisp_Object font_spec,
1504 Lisp_Object frame, Lisp_Object add) 1513 Lisp_Object frame, Lisp_Object add)
1505{ 1514{