X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/41d79f4d2b18fd016b5dceb73b90a01d94d61409..644e04f80801c3dc09ab3deccdc9bb8d13b2dc5d:/src/fontset.c diff --git a/src/fontset.c b/src/fontset.c index 5797c8d3df..d748c7ef92 100644 --- a/src/fontset.c +++ b/src/fontset.c @@ -55,14 +55,14 @@ Boston, MA 02111-1307, USA. */ face is also realized for multibyte characters based on an ASCII face. All of the multibyte faces based on the same ASCII face share the same realized fontset. - + A fontset object is implemented by a char-table. An element of a base fontset is: (INDEX . FONTNAME) or (INDEX . (FOUNDRY . REGISTRY )) FONTNAME is a font name pattern for the corresponding character. - FOUNDRY and REGISTRY are respectively foundy and regisry fields of + FOUNDRY and REGISTRY are respectively foundry and registry fields of a font name for the corresponding character. INDEX specifies for which character (or generic character) the element is defined. It may be different from an index to access this element. For @@ -71,9 +71,9 @@ Boston, MA 02111-1307, USA. */ charset. REGISTRY is the An element of a realized fontset is FACE-ID which is a face to use - for displaying the correspnding character. + for displaying the corresponding character. - All single byte charaters (ASCII and 8bit-unibyte) share the same + All single byte characters (ASCII and 8bit-unibyte) share the same element in a fontset. The element is stored in the first element of the fontset. @@ -110,7 +110,7 @@ Boston, MA 02111-1307, USA. */ These structures are hidden from the other codes than this file. The other codes handle fontsets only by their ID numbers. They usually use variable name `fontset' for IDs. But, in this file, we - always use varialbe name `id' for IDs, and name `fontset' for the + always use variable name `id' for IDs, and name `fontset' for the actual fontset objects. */ @@ -123,7 +123,7 @@ Lisp_Object Qfontset; /* Vector containing all fontsets. */ static Lisp_Object Vfontset_table; -/* Next possibly free fontset ID. Usually this keeps the mininum +/* Next possibly free fontset ID. Usually this keeps the minimum fontset ID not yet used. */ static int next_fontset_id; @@ -136,8 +136,6 @@ Lisp_Object Vuse_default_ascent; Lisp_Object Vignore_relative_composition; Lisp_Object Valternate_fontname_alist; Lisp_Object Vfontset_alias_alist; -Lisp_Object Vhighlight_wrong_size_font; -Lisp_Object Vclip_large_size_font; Lisp_Object Vvertical_centering_font_regexp; /* The following six are declarations of callback functions depending @@ -147,8 +145,8 @@ Lisp_Object Vvertical_centering_font_regexp; /* Return a pointer to struct font_info of font FONT_IDX of frame F. */ struct font_info *(*get_font_info_func) P_ ((FRAME_PTR f, int font_idx)); -/* Return a list of font names which matches PATTERN. See the document of - `x-list-fonts' for more detail. */ +/* Return a list of font names which matches PATTERN. See the documentation + of `x-list-fonts' for more details. */ Lisp_Object (*list_fonts_func) P_ ((struct frame *f, Lisp_Object pattern, int size, @@ -168,7 +166,7 @@ void (*set_frame_fontset_func) P_ ((FRAME_PTR f, Lisp_Object arg, /* To find a CCL program, fs_load_font calls this function. The argument is a pointer to the struct font_info. - This function set the memer `encoder' of the structure. */ + This function set the member `encoder' of the structure. */ void (*find_ccl_program_func) P_ ((struct font_info *)); /* Check if any window system is used now. */ @@ -320,14 +318,14 @@ make_fontset (frame, name, base) /* Find a free slot in Vfontset_table. Usually, next_fontset_id is the next available fontset ID. So it is expected that this loop terminates quickly. In addition, as the last element of - Vfotnset_table is always nil, we don't have to check the range of + Vfontset_table is always nil, we don't have to check the range of id. */ while (!NILP (AREF (Vfontset_table, id))) id++; if (id + 1 == size) { Lisp_Object tem; - int i; + int i; tem = Fmake_vector (make_number (size + 8), Qnil); for (i = 0; i < size; i++) @@ -372,10 +370,10 @@ font_family_registry (fontname, force) int force; { Lisp_Object family, registry; - char *p = XSTRING (fontname)->data; - char *sep[15]; + const char *p = SDATA (fontname); + const char *sep[15]; int i = 0; - + while (*p && i < 15) if (*p++ == '-') { @@ -392,7 +390,7 @@ font_family_registry (fontname, force) } -/********** INTERFACES TO xfaces.c and dispextern.h **********/ +/********** INTERFACES TO xfaces.c and dispextern.h **********/ /* Return name of the fontset with ID. */ @@ -483,7 +481,7 @@ face_for_char (f, face, c) /* No face is recorded for C in the fontset of FACE. Make a new realized face for C that has the same fontset. */ face_id = lookup_face (f, face->lface, c, face); - + /* Record the face ID in FONTSET at the same index as the information in the base fontset. */ FONTSET_SET (fontset, c, make_number (face_id)); @@ -534,8 +532,7 @@ fontset_font_pattern (f, id, c) { Lisp_Object fontset, elt; struct font_info *fontp; - Lisp_Object family_registry; - + elt = Qnil; if (fontset_id_valid_p (id)) { @@ -560,7 +557,7 @@ fontset_font_pattern (f, id, c) font name. */ elt = XCDR (elt); xassert (STRINGP (elt)); - fontp = FS_LOAD_FONT (f, c, XSTRING (elt)->data, -1); + fontp = FS_LOAD_FONT (f, c, SDATA (elt), -1); if (!fontp) return Qnil; @@ -569,6 +566,10 @@ fontset_font_pattern (f, id, c) } +#if defined(WINDOWSNT) && defined (_MSC_VER) +#pragma optimize("", off) +#endif + /* Load a font named FONTNAME to display character C on frame F. Return a pointer to the struct font_info of the loaded font. If loading fails, return NULL. If FACE is non-zero and a fontset is @@ -615,7 +616,7 @@ fs_load_font (f, c, fontname, id, face) if (!fontname && charset == CHARSET_ASCII) { elt = FONTSET_ASCII (fontset); - fontname = XSTRING (XCDR (elt))->data; + fontname = SDATA (XCDR (elt)); } } @@ -633,7 +634,7 @@ fs_load_font (f, c, fontname, id, face) fontp->vertical_centering = (STRINGP (Vvertical_centering_font_regexp) - && (fast_c_string_match_ignore_case + && (fast_c_string_match_ignore_case (Vvertical_centering_font_regexp, fontp->full_name) >= 0)); if (fontp->encoding[1] != FONT_ENCODING_NOT_DECIDED) @@ -694,13 +695,17 @@ fs_load_font (f, c, fontname, id, face) return fontp; } +#if defined(WINDOWSNT) && defined (_MSC_VER) +#pragma optimize("", on) +#endif + /* Cache data used by fontset_pattern_regexp. The car part is a pattern string containing at least one wild card, the cdr part is the corresponding regular expression. */ static Lisp_Object Vcached_fontset_data; -#define CACHED_FONTSET_NAME (XSTRING (XCAR (Vcached_fontset_data))->data) +#define CACHED_FONTSET_NAME (SDATA (XCAR (Vcached_fontset_data))) #define CACHED_FONTSET_REGEX (XCDR (Vcached_fontset_data)) /* If fontset name PATTERN contains any wild card, return regular @@ -710,21 +715,21 @@ static Lisp_Object fontset_pattern_regexp (pattern) Lisp_Object pattern; { - if (!index (XSTRING (pattern)->data, '*') - && !index (XSTRING (pattern)->data, '?')) + if (!index (SDATA (pattern), '*') + && !index (SDATA (pattern), '?')) /* PATTERN does not contain any wild cards. */ return Qnil; if (!CONSP (Vcached_fontset_data) - || strcmp (XSTRING (pattern)->data, CACHED_FONTSET_NAME)) + || strcmp (SDATA (pattern), CACHED_FONTSET_NAME)) { /* We must at first update the cached data. */ - char *regex = (char *) alloca (XSTRING (pattern)->size * 2 + 3); + char *regex = (char *) alloca (SCHARS (pattern) * 2 + 3); char *p0, *p1 = regex; /* Convert "*" to ".*", "?" to ".". */ *p1++ = '^'; - for (p0 = (char *) XSTRING (pattern)->data; *p0; p0++) + for (p0 = (char *) SDATA (pattern); *p0; p0++) { if (*p0 == '*') { @@ -739,7 +744,7 @@ fontset_pattern_regexp (pattern) *p1++ = '$'; *p1++ = 0; - Vcached_fontset_data = Fcons (build_string (XSTRING (pattern)->data), + Vcached_fontset_data = Fcons (build_string (SDATA (pattern)), build_string (regex)); } @@ -777,17 +782,17 @@ fs_query_fontset (name, regexpp) for (i = 0; i < ASIZE (Vfontset_table); i++) { Lisp_Object fontset; - unsigned char *this_name; + const unsigned char *this_name; fontset = FONTSET_FROM_ID (i); if (NILP (fontset) || !BASE_FONTSET_P (fontset)) continue; - this_name = XSTRING (FONTSET_NAME (fontset))->data; + this_name = SDATA (FONTSET_NAME (fontset)); if (regexpp ? fast_c_string_match_ignore_case (name, this_name) >= 0 - : !strcmp (XSTRING (name)->data, this_name)) + : !strcmp (SDATA (name), this_name)) return i; } return -1; @@ -795,12 +800,12 @@ fs_query_fontset (name, regexpp) DEFUN ("query-fontset", Fquery_fontset, Squery_fontset, 1, 2, 0, - "Return the name of a fontset that matches PATTERN.\n\ -The value is nil if there is no matching fontset.\n\ -PATTERN can contain `*' or `?' as a wildcard\n\ -just as X font name matching algorithm allows.\n\ -If REGEXPP is non-nil, PATTERN is a regular expression.") - (pattern, regexpp) + doc: /* Return the name of a fontset that matches PATTERN. +The value is nil if there is no matching fontset. +PATTERN can contain `*' or `?' as a wildcard +just as X font name matching algorithm allows. +If REGEXPP is non-nil, PATTERN is a regular expression. */) + (pattern, regexpp) Lisp_Object pattern, regexpp; { Lisp_Object fontset; @@ -808,9 +813,9 @@ If REGEXPP is non-nil, PATTERN is a regular expression.") (*check_window_system_func) (); - CHECK_STRING (pattern, 0); + CHECK_STRING (pattern); - if (XSTRING (pattern)->size == 0) + if (SCHARS (pattern) == 0) return Qnil; id = fs_query_fontset (pattern, !NILP (regexpp)); @@ -823,7 +828,7 @@ If REGEXPP is non-nil, PATTERN is a regular expression.") /* Return a list of base fontset names matching PATTERN on frame F. If SIZE is not 0, it is the size (maximum bound width) of fontsets - to be listed. */ + to be listed. */ Lisp_Object list_fontsets (f, pattern, size) @@ -842,18 +847,18 @@ list_fontsets (f, pattern, size) for (id = 0; id < ASIZE (Vfontset_table); id++) { Lisp_Object fontset; - unsigned char *name; + const unsigned char *name; fontset = FONTSET_FROM_ID (id); if (NILP (fontset) || !BASE_FONTSET_P (fontset) || !EQ (frame, FONTSET_FRAME (fontset))) continue; - name = XSTRING (FONTSET_NAME (fontset))->data; + name = SDATA (FONTSET_NAME (fontset)); if (!NILP (regexp) ? (fast_c_string_match_ignore_case (regexp, name) < 0) - : strcmp (XSTRING (pattern)->data, name)) + : strcmp (SDATA (pattern), name)) continue; if (size) @@ -870,9 +875,9 @@ list_fontsets (f, pattern, size) } DEFUN ("new-fontset", Fnew_fontset, Snew_fontset, 2, 2, 0, - "Create a new fontset NAME that contains font information in FONTLIST.\n\ -FONTLIST is an alist of charsets vs corresponding font name patterns.") - (name, fontlist) + doc: /* Create a new fontset NAME that contains font information in FONTLIST. +FONTLIST is an alist of charsets vs corresponding font name patterns. */) + (name, fontlist) Lisp_Object name, fontlist; { Lisp_Object fontset, elements, ascii_font; @@ -880,14 +885,14 @@ FONTLIST is an alist of charsets vs corresponding font name patterns.") (*check_window_system_func) (); - CHECK_STRING (name, 0); - CHECK_LIST (fontlist, 1); + CHECK_STRING (name); + CHECK_LIST (fontlist); name = Fdowncase (name); tem = Fquery_fontset (name, Qnil); if (!NILP (tem)) error ("Fontset `%s' matches the existing fontset `%s'", - XSTRING (name)->data, XSTRING (tem)->data); + SDATA (name), SDATA (tem)); /* Check the validity of FONTLIST while creating a template for fontset elements. */ @@ -961,25 +966,25 @@ check_fontset_name (name) if (EQ (name, Qt)) return Vdefault_fontset; - CHECK_STRING (name, 0); + CHECK_STRING (name); id = fs_query_fontset (name, 0); if (id < 0) - error ("Fontset `%s' does not exist", XSTRING (name)->data); + error ("Fontset `%s' does not exist", SDATA (name)); return FONTSET_FROM_ID (id); } DEFUN ("set-fontset-font", Fset_fontset_font, Sset_fontset_font, 3, 4, 0, - "Modify fontset NAME to use FONTNAME for CHARACTER.\n\ -\n\ -CHARACTER may be a cons; (FROM . TO), where FROM and TO are\n\ -non-generic characters. In that case, use FONTNAME\n\ -for all characters in the range FROM and TO (inclusive).\n\ -CHARACTER may be a charset. In that case, use FONTNAME\n\ -for all character in the charsets.\n\ -\n\ -FONTNAME may be a cons; (FAMILY . REGISTRY), where FAMILY is a family\n\ -name of a font, REGSITRY is a registry name of a font.") - (name, character, fontname, frame) + doc: /* Modify fontset NAME to use FONTNAME for CHARACTER. + +CHARACTER may be a cons; (FROM . TO), where FROM and TO are +non-generic characters. In that case, use FONTNAME +for all characters in the range FROM and TO (inclusive). +CHARACTER may be a charset. In that case, use FONTNAME +for all character in the charsets. + +FONTNAME may be a cons; (FAMILY . REGISTRY), where FAMILY is a family +name of a font, REGISTRY is a registry name of a font. */) + (name, character, fontname, frame) Lisp_Object name, character, fontname, frame; { Lisp_Object fontset, elt; @@ -994,8 +999,8 @@ name of a font, REGSITRY is a registry name of a font.") { /* CH should be (FROM . TO) where FROM and TO are non-generic characters. */ - CHECK_NUMBER (XCAR (character), 1); - CHECK_NUMBER (XCDR (character), 1); + CHECK_NUMBER_CAR (character); + CHECK_NUMBER_CDR (character); from = XINT (XCAR (character)); to = XINT (XCDR (character)); if (!char_valid_p (from, 0) || !char_valid_p (to, 0)) @@ -1008,13 +1013,13 @@ name of a font, REGSITRY is a registry name of a font.") { elt = Fget (character, Qcharset); if (!VECTORP (elt) || ASIZE (elt) < 1 || !NATNUMP (AREF (elt, 0))) - error ("Invalid charset: %s", (XSYMBOL (character)->name)->data); + error ("Invalid charset: %s", SDATA (SYMBOL_NAME (character))); from = MAKE_CHAR (XINT (AREF (elt, 0)), 0, 0); to = from; } else { - CHECK_NUMBER (character, 1); + CHECK_NUMBER (character); from = XINT (character); to = from; } @@ -1037,17 +1042,17 @@ name of a font, REGSITRY is a registry name of a font.") } else { - CHECK_CONS (fontname, 2); + CHECK_CONS (fontname); family = XCAR (fontname); registry = XCDR (fontname); if (!NILP (family)) { - CHECK_STRING (family, 2); + CHECK_STRING (family); family = Fdowncase (family); } if (!NILP (registry)) { - CHECK_STRING (registry, 2); + CHECK_STRING (registry); registry = Fdowncase (registry); } elt = Fcons (make_number (from), Fcons (family, registry)); @@ -1056,7 +1061,7 @@ name of a font, REGSITRY is a registry name of a font.") /* The arg FRAME is kept for backward compatibility. We only check the validity. */ if (!NILP (frame)) - CHECK_LIVE_FRAME (frame, 3); + CHECK_LIVE_FRAME (frame); for (; from <= to; from++) FONTSET_SET (fontset, from, elt); @@ -1083,20 +1088,20 @@ name of a font, REGSITRY is a registry name of a font.") } DEFUN ("font-info", Ffont_info, Sfont_info, 1, 2, 0, - "Return information about a font named NAME on frame FRAME.\n\ -If FRAME is omitted or nil, use the selected frame.\n\ -The returned value is a vector of OPENED-NAME, FULL-NAME, CHARSET, SIZE,\n\ - HEIGHT, BASELINE-OFFSET, RELATIVE-COMPOSE, and DEFAULT-ASCENT,\n\ -where\n\ - OPENED-NAME is the name used for opening the font,\n\ - FULL-NAME is the full name of the font,\n\ - SIZE is the maximum bound width of the font,\n\ - HEIGHT is the height of the font,\n\ - BASELINE-OFFSET is the upward offset pixels from ASCII baseline,\n\ - RELATIVE-COMPOSE and DEFAULT-ASCENT are the numbers controlling\n\ - how to compose characters.\n\ -If the named font is not yet loaded, return nil.") - (name, frame) + doc: /* Return information about a font named NAME on frame FRAME. +If FRAME is omitted or nil, use the selected frame. +The returned value is a vector of OPENED-NAME, FULL-NAME, CHARSET, SIZE, + HEIGHT, BASELINE-OFFSET, RELATIVE-COMPOSE, and DEFAULT-ASCENT, +where + OPENED-NAME is the name used for opening the font, + FULL-NAME is the full name of the font, + SIZE is the maximum bound width of the font, + HEIGHT is the height of the font, + BASELINE-OFFSET is the upward offset pixels from ASCII baseline, + RELATIVE-COMPOSE and DEFAULT-ASCENT are the numbers controlling + how to compose characters. +If the named font is not yet loaded, return nil. */) + (name, frame) Lisp_Object name, frame; { FRAME_PTR f; @@ -1105,17 +1110,17 @@ If the named font is not yet loaded, return nil.") (*check_window_system_func) (); - CHECK_STRING (name, 0); + CHECK_STRING (name); name = Fdowncase (name); if (NILP (frame)) frame = selected_frame; - CHECK_LIVE_FRAME (frame, 1); + CHECK_LIVE_FRAME (frame); f = XFRAME (frame); if (!query_font_func) error ("Font query function is not supported"); - fontp = (*query_font_func) (f, XSTRING (name)->data); + fontp = (*query_font_func) (f, SDATA (name)); if (!fontp) return Qnil; @@ -1150,8 +1155,8 @@ If the named font is not yet loaded, return nil.") DEFUN ("internal-char-font", Finternal_char_font, Sinternal_char_font, 1, 1, 0, - "For internal use only.") - (position) + doc: /* For internal use only. */) + (position) Lisp_Object position; { int pos, pos_byte, dummy; @@ -1162,7 +1167,7 @@ DEFUN ("internal-char-font", Finternal_char_font, Sinternal_char_font, 1, 1, 0, struct frame *f; struct face *face; - CHECK_NUMBER_COERCE_MARKER (position, 0); + CHECK_NUMBER_COERCE_MARKER (position); pos = XINT (position); if (pos < BEGV || pos >= ZV) args_out_of_range_3 (position, make_number (BEGV), make_number (ZV)); @@ -1214,7 +1219,7 @@ accumulate_font_info (arg, character, elt) { if (this_charset == CHAR_CHARSET (XINT (XCAR (last_char)))) { - XCDR (last_char) = character; + XSETCDR (last_char, character); return; } } @@ -1222,33 +1227,33 @@ accumulate_font_info (arg, character, elt) return; else if (this_charset == CHAR_CHARSET (XINT (last_char))) { - XCAR (XCAR (last)) = Fcons (last_char, character); + XSETCAR (XCAR (last), Fcons (last_char, character)); return; } } - XCDR (last) = Fcons (Fcons (character, Fcons (elt, Qnil)), Qnil); - XCAR (arg) = XCDR (last); + XSETCDR (last, Fcons (Fcons (character, Fcons (elt, Qnil)), Qnil)); + XSETCAR (arg, XCDR (last)); } DEFUN ("fontset-info", Ffontset_info, Sfontset_info, 1, 2, 0, - "Return information about a fontset named NAME on frame FRAME.\n\ -The value is a vector:\n\ - [ SIZE HEIGHT ((CHARSET-OR-RANGE FONT-SPEC OPENED ...) ...) ],\n\ -where,\n\ - SIZE is the maximum bound width of ASCII font in the fontset,\n\ - HEIGHT is the maximum bound height of ASCII font in the fontset,\n\ - CHARSET-OR-RANGE is a charset, a character (may be a generic character)\n\ - or a cons of two characters specifying the range of characters.\n\ - FONT-SPEC is a fontname pattern string or a cons (FAMILY . REGISTRY),\n\ - where FAMILY is a `FAMILY' field of a XLFD font name,\n\ - REGISTRY is a `CHARSET_REGISTRY' field of a XLDF font name.\n\ - FAMILY may contain a `FOUNDARY' field at the head.\n\ - REGISTRY may contain a `CHARSET_ENCODING' field at the tail.\n\ - OPENEDs are names of fonts actually opened.\n\ -If the ASCII font is not yet opened, SIZE and HEIGHT are 0.\n\ -If FRAME is omitted, it defaults to the currently selected frame.") - (name, frame) + doc: /* Return information about a fontset named NAME on frame FRAME. +The value is a vector: + [ SIZE HEIGHT ((CHARSET-OR-RANGE FONT-SPEC OPENED ...) ...) ], +where, + SIZE is the maximum bound width of ASCII font in the fontset, + HEIGHT is the maximum bound height of ASCII font in the fontset, + CHARSET-OR-RANGE is a charset, a character (may be a generic character) + or a cons of two characters specifying the range of characters. + FONT-SPEC is a fontname pattern string or a cons (FAMILY . REGISTRY), + where FAMILY is a `FAMILY' field of a XLFD font name, + REGISTRY is a `CHARSET_REGISTRY' field of a XLFD font name. + FAMILY may contain a `FOUNDRY' field at the head. + REGISTRY may contain a `CHARSET_ENCODING' field at the tail. + OPENEDs are names of fonts actually opened. +If the ASCII font is not yet opened, SIZE and HEIGHT are 0. +If FRAME is omitted, it defaults to the currently selected frame. */) + (name, frame) Lisp_Object name, frame; { Lisp_Object fontset; @@ -1259,14 +1264,14 @@ If FRAME is omitted, it defaults to the currently selected frame.") struct font_info *fontp = NULL; int n_realized = 0; int i; - + (*check_window_system_func) (); fontset = check_fontset_name (name); if (NILP (frame)) frame = selected_frame; - CHECK_LIVE_FRAME (frame, 1); + CHECK_LIVE_FRAME (frame); f = XFRAME (frame); /* Recode realized fontsets whose base is FONTSET in the table @@ -1306,7 +1311,7 @@ If FRAME is omitted, it defaults to the currently selected frame.") c = XINT (XCAR (elt)); SPLIT_CHAR (c, charset, c1, c2); if (c1 == 0) - XCAR (elt) = CHARSET_SYMBOL (charset); + XSETCAR (elt, CHARSET_SYMBOL (charset)); } else c = XINT (XCAR (XCAR (elt))); @@ -1319,11 +1324,11 @@ If FRAME is omitted, it defaults to the currently selected frame.") if (INTEGERP (face_id)) { face = FACE_FROM_ID (f, XINT (face_id)); - if (face->font && face->font_name) + if (face && face->font && face->font_name) { font = build_string (face->font_name); if (NILP (Fmember (font, XCDR (XCDR (elt))))) - XCDR (XCDR (elt)) = Fcons (font, XCDR (XCDR (elt))); + XSETCDR (XCDR (elt), Fcons (font, XCDR (XCDR (elt)))); } } } @@ -1333,7 +1338,7 @@ If FRAME is omitted, it defaults to the currently selected frame.") if (CONSP (elt)) { elt = XCAR (elt); - fontp = (*query_font_func) (f, XSTRING (elt)->data); + fontp = (*query_font_func) (f, SDATA (elt)); } val = Fmake_vector (make_number (3), val); AREF (val, 0) = fontp ? make_number (fontp->size) : make_number (0); @@ -1342,9 +1347,9 @@ If FRAME is omitted, it defaults to the currently selected frame.") } DEFUN ("fontset-font", Ffontset_font, Sfontset_font, 2, 2, 0, - "Return a font name pattern for character CH in fontset NAME.\n\ -If NAME is t, find a font name pattern in the default fontset.") - (name, ch) + doc: /* Return a font name pattern for character CH in fontset NAME. +If NAME is t, find a font name pattern in the default fontset. */) + (name, ch) Lisp_Object name, ch; { int c; @@ -1352,7 +1357,7 @@ If NAME is t, find a font name pattern in the default fontset.") fontset = check_fontset_name (name); - CHECK_NUMBER (ch, 1); + CHECK_NUMBER (ch); c = XINT (ch); if (!char_valid_p (c, 1)) invalid_character (c); @@ -1363,11 +1368,10 @@ If NAME is t, find a font name pattern in the default fontset.") return elt; } - DEFUN ("fontset-list", Ffontset_list, Sfontset_list, 0, 0, 0, - "Return a list of all defined fontset names.") - () + doc: /* Return a list of all defined fontset names. */) + () { Lisp_Object fontset, list; int i; @@ -1406,7 +1410,7 @@ syms_of_fontset () FONTSET_ID (Vdefault_fontset) = make_number (0); FONTSET_NAME (Vdefault_fontset) = build_string ("-*-*-*-*-*-*-*-*-*-*-*-*-fontset-default"); -#if defined (macintosh) +#if defined (MAC_OS) FONTSET_ASCII (Vdefault_fontset) = Fcons (make_number (0), build_string ("-apple-monaco-medium-r-*--*-120-*-*-*-*-mac-roman")); @@ -1423,68 +1427,50 @@ syms_of_fontset () next_fontset_id = 1; DEFVAR_LISP ("font-encoding-alist", &Vfont_encoding_alist, - "Alist of fontname patterns vs corresponding encoding info.\n\ -Each element looks like (REGEXP . ENCODING-INFO),\n\ - where ENCODING-INFO is an alist of CHARSET vs ENCODING.\n\ -ENCODING is one of the following integer values:\n\ - 0: code points 0x20..0x7F or 0x2020..0x7F7F are used,\n\ - 1: code points 0xA0..0xFF or 0xA0A0..0xFFFF are used,\n\ - 2: code points 0x20A0..0x7FFF are used,\n\ - 3: code points 0xA020..0xFF7F are used."); + doc: /* Alist of fontname patterns vs corresponding encoding info. +Each element looks like (REGEXP . ENCODING-INFO), + where ENCODING-INFO is an alist of CHARSET vs ENCODING. +ENCODING is one of the following integer values: + 0: code points 0x20..0x7F or 0x2020..0x7F7F are used, + 1: code points 0xA0..0xFF or 0xA0A0..0xFFFF are used, + 2: code points 0x20A0..0x7FFF are used, + 3: code points 0xA020..0xFF7F are used. */); Vfont_encoding_alist = Qnil; DEFVAR_LISP ("use-default-ascent", &Vuse_default_ascent, - "Char table of characters whose ascent values should be ignored.\n\ -If an entry for a character is non-nil, the ascent value of the glyph\n\ -is assumed to be what specified by _MULE_DEFAULT_ASCENT property of a font.\n\ -\n\ -This affects how a composite character which contains\n\ -such a character is displayed on screen."); + doc: /* Char table of characters whose ascent values should be ignored. +If an entry for a character is non-nil, the ascent value of the glyph +is assumed to be what specified by _MULE_DEFAULT_ASCENT property of a font. + +This affects how a composite character which contains +such a character is displayed on screen. */); Vuse_default_ascent = Qnil; DEFVAR_LISP ("ignore-relative-composition", &Vignore_relative_composition, - "Char table of characters which is not composed relatively.\n\ -If an entry for a character is non-nil, a composition sequence\n\ -which contains that character is displayed so that\n\ -the glyph of that character is put without considering\n\ -an ascent and descent value of a previous character."); + doc: /* Char table of characters which is not composed relatively. +If an entry for a character is non-nil, a composition sequence +which contains that character is displayed so that +the glyph of that character is put without considering +an ascent and descent value of a previous character. */); Vignore_relative_composition = Qnil; DEFVAR_LISP ("alternate-fontname-alist", &Valternate_fontname_alist, - "Alist of fontname vs list of the alternate fontnames.\n\ -When a specified font name is not found, the corresponding\n\ -alternate fontnames (if any) are tried instead."); + doc: /* Alist of fontname vs list of the alternate fontnames. +When a specified font name is not found, the corresponding +alternate fontnames (if any) are tried instead. */); Valternate_fontname_alist = Qnil; DEFVAR_LISP ("fontset-alias-alist", &Vfontset_alias_alist, - "Alist of fontset names vs the aliases."); + doc: /* Alist of fontset names vs the aliases. */); Vfontset_alias_alist = Fcons (Fcons (FONTSET_NAME (Vdefault_fontset), build_string ("fontset-default")), Qnil); - DEFVAR_LISP ("highlight-wrong-size-font", &Vhighlight_wrong_size_font, - "*Non-nil means highlight characters shown in wrong size fonts somehow.\n\ -The way to highlight them depends on window system on which Emacs runs.\n\ -On X11, a rectangle is shown around each such character."); - Vhighlight_wrong_size_font = Qnil; - - DEFVAR_LISP ("clip-large-size-font", &Vclip_large_size_font, - "*Non-nil means characters shown in overlarge fonts are clipped.\n\ -The height of clipping area is the same as that of an ASCII character.\n\ -The width of the area is the same as that of an ASCII character,\n\ -or twice as wide, depending on the character set's column-width.\n\ -\n\ -If the only font you have for a specific character set is too large,\n\ -and clipping these characters makes them hard to read,\n\ -you can set this variable to nil to display the characters without clipping.\n\ -The drawback is that you will get some garbage left on your screen."); - Vclip_large_size_font = Qt; - DEFVAR_LISP ("vertical-centering-font-regexp", &Vvertical_centering_font_regexp, - "*Regexp matching font names that require vertical centering on display.\n\ -When a character is displayed with such fonts, the character is displayed\n\ -at the vertival center of lines."); + doc: /* *Regexp matching font names that require vertical centering on display. +When a character is displayed with such fonts, the character is displayed +at the vertical center of lines. */); Vvertical_centering_font_regexp = Qnil; defsubr (&Squery_fontset);