+DEFUN ("set-overriding-fontspec-internal", Fset_overriding_fontspec_internal,
+ Sset_overriding_fontspec_internal, 1, 1, 0,
+ doc: /* Internal use only.
+
+FONTLIST is an alist of TARGET vs FONTNAME, where TARGET is a charset
+or a char-table, FONTNAME have the same meanings as in
+`set-fontset-font'.
+
+It overrides the font specifications for each TARGET in the default
+fontset by the corresponding FONTNAME.
+
+If TARGET is a charset, targets are all characters in the charset. If
+TARGET is a char-table, targets are characters whose value is non-nil
+in the table.
+
+It is intended that this function is called only from
+`set-language-environment'. */)
+ (fontlist)
+ Lisp_Object fontlist;
+{
+ Lisp_Object tail;
+
+ fontlist = Fcopy_sequence (fontlist);
+ /* Now FONTLIST is ((TARGET . FONTNAME) ...). Reform it to ((TARGET
+ nil nil nil FONTSPEC) ...), where TARGET is a charset-id or a
+ char-table. */
+ for (tail = fontlist; CONSP (tail); tail = XCDR (tail))
+ {
+ Lisp_Object elt, target;
+
+ elt = XCAR (tail);
+ target = Fcar (elt);
+ elt = Fcons (Qnil, regularize_fontname (Fcdr (elt)));
+ if (! CHAR_TABLE_P (target))
+ {
+ int charset, c;
+
+ CHECK_SYMBOL (target);
+ charset = get_charset_id (target);
+ if (charset < 0)
+ error ("Invalid charset %s", SDATA (SYMBOL_NAME (target)));
+ target = make_number (charset);
+ c = MAKE_CHAR (charset, 0, 0);
+ XSETCAR (elt, make_number (c));
+ }
+ elt = Fcons (target, Fcons (Qnil, Fcons (Qnil, elt)));
+ XSETCAR (tail, elt);
+ }
+ Voverriding_fontspec_alist = fontlist;
+ clear_face_cache (0);
+ ++windows_or_buffers_changed;
+ return Qnil;
+}
+