diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/fontset.c | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/src/fontset.c b/src/fontset.c index 141ba4b0b59..93fdbfeccd1 100644 --- a/src/fontset.c +++ b/src/fontset.c | |||
| @@ -33,6 +33,7 @@ Boston, MA 02111-1307, USA. */ | |||
| 33 | Lisp_Object Vglobal_fontset_alist; | 33 | Lisp_Object Vglobal_fontset_alist; |
| 34 | 34 | ||
| 35 | Lisp_Object Vfont_encoding_alist; | 35 | Lisp_Object Vfont_encoding_alist; |
| 36 | Lisp_Object Vuse_default_ascent; | ||
| 36 | 37 | ||
| 37 | /* We had better have our own strcasecmp function because some system | 38 | /* We had better have our own strcasecmp function because some system |
| 38 | doesn't have it. */ | 39 | doesn't have it. */ |
| @@ -196,7 +197,6 @@ fs_load_font (f, font_table, charset, fontname, fontset) | |||
| 196 | 197 | ||
| 197 | for (tmp = XCONS (elt)->cdr; CONSP (tmp); tmp = XCONS (tmp)->cdr) | 198 | for (tmp = XCONS (elt)->cdr; CONSP (tmp); tmp = XCONS (tmp)->cdr) |
| 198 | if (CONSP (XCONS (tmp)->car) | 199 | if (CONSP (XCONS (tmp)->car) |
| 199 | && INTEGERP (XCONS (XCONS (tmp)->car)->car) | ||
| 200 | && ((i = get_charset_id (XCONS (XCONS (tmp)->car)->car)) | 200 | && ((i = get_charset_id (XCONS (XCONS (tmp)->car)->car)) |
| 201 | >= 0) | 201 | >= 0) |
| 202 | && INTEGERP (XCONS (XCONS (tmp)->car)->cdr) | 202 | && INTEGERP (XCONS (XCONS (tmp)->car)->cdr) |
| @@ -251,8 +251,12 @@ fs_load_font (f, font_table, charset, fontname, fontset) | |||
| 251 | 251 | ||
| 252 | if (fontp2->size != fontp->size * CHARSET_WIDTH (i)) | 252 | if (fontp2->size != fontp->size * CHARSET_WIDTH (i)) |
| 253 | fontsetp->font_indexes[i] = FONT_NOT_OPENED; | 253 | fontsetp->font_indexes[i] = FONT_NOT_OPENED; |
| 254 | /* The following code should be disabled until Emacs | ||
| 255 | supports variable height lines. */ | ||
| 256 | #if 0 | ||
| 254 | else if (fontsetp->height < fontp->height) | 257 | else if (fontsetp->height < fontp->height) |
| 255 | fontsetp->height = fontp->height; | 258 | fontsetp->height = fontp->height; |
| 259 | #endif | ||
| 256 | } | 260 | } |
| 257 | } | 261 | } |
| 258 | } | 262 | } |
| @@ -613,11 +617,12 @@ If FRAME is omitted or nil, all frames are affected.") | |||
| 613 | if (NILP (frame)) | 617 | if (NILP (frame)) |
| 614 | { | 618 | { |
| 615 | Lisp_Object fontset_info = Fassoc (fullname, Vglobal_fontset_alist); | 619 | Lisp_Object fontset_info = Fassoc (fullname, Vglobal_fontset_alist); |
| 616 | Lisp_Object tem = Fassq (charset, XCONS (fontset_info)->cdr); | 620 | Lisp_Object tem = Fassq (charset_symbol, XCONS (fontset_info)->cdr); |
| 617 | 621 | ||
| 618 | if (NILP (tem)) | 622 | if (NILP (tem)) |
| 619 | XCONS (fontset_info)->cdr | 623 | XCONS (fontset_info)->cdr |
| 620 | = Fcons (Fcons (charset, fontname), XCONS (fontset_info)->cdr); | 624 | = Fcons (Fcons (charset_symbol, fontname), |
| 625 | XCONS (fontset_info)->cdr); | ||
| 621 | else | 626 | else |
| 622 | XCONS (tem)->cdr = fontname; | 627 | XCONS (tem)->cdr = fontname; |
| 623 | } | 628 | } |
| @@ -636,13 +641,13 @@ If FRAME is omitted or nil, all frames are affected.") | |||
| 636 | struct fontset_info *fontsetp | 641 | struct fontset_info *fontsetp |
| 637 | = FRAME_FONTSET_DATA (f)->fontset_table[fontset]; | 642 | = FRAME_FONTSET_DATA (f)->fontset_table[fontset]; |
| 638 | 643 | ||
| 639 | if (fontsetp->fontname[XINT (charset)]) | 644 | if (fontsetp->fontname[charset]) |
| 640 | xfree (fontsetp->fontname[XINT (charset)]); | 645 | xfree (fontsetp->fontname[charset]); |
| 641 | fontsetp->fontname[XINT (charset)] | 646 | fontsetp->fontname[charset] |
| 642 | = (char *) xmalloc (XSTRING (fontname)->size + 1); | 647 | = (char *) xmalloc (XSTRING (fontname)->size + 1); |
| 643 | bcopy (XSTRING (fontname)->data, fontsetp->fontname[XINT (charset)], | 648 | bcopy (XSTRING (fontname)->data, fontsetp->fontname[charset], |
| 644 | XSTRING (fontname)->size + 1); | 649 | XSTRING (fontname)->size + 1); |
| 645 | fontsetp->font_indexes[XINT (charset)] = FONT_NOT_OPENED; | 650 | fontsetp->font_indexes[charset] = FONT_NOT_OPENED; |
| 646 | 651 | ||
| 647 | if (charset == CHARSET_ASCII) | 652 | if (charset == CHARSET_ASCII) |
| 648 | { | 653 | { |
| @@ -667,7 +672,7 @@ DEFUN ("font-info", Ffont_info, Sfont_info, 1, 2, 0, | |||
| 667 | "Return information about a font named NAME on frame FRAME.\n\ | 672 | "Return information about a font named NAME on frame FRAME.\n\ |
| 668 | If FRAME is omitted or nil, use the selected frame.\n\ | 673 | If FRAME is omitted or nil, use the selected frame.\n\ |
| 669 | The returned value is a vector of OPENED-NAME, FULL-NAME, CHARSET, SIZE,\n\ | 674 | The returned value is a vector of OPENED-NAME, FULL-NAME, CHARSET, SIZE,\n\ |
| 670 | HEIGHT, BASELINE-OFFSET, and RELATIVE-COMPOSE,\n\ | 675 | HEIGHT, BASELINE-OFFSET, RELATIVE-COMPOSE, and DEFAULT-ASCENT,\n\ |
| 671 | where\n\ | 676 | where\n\ |
| 672 | OPENED-NAME is the name used for opening the font,\n\ | 677 | OPENED-NAME is the name used for opening the font,\n\ |
| 673 | FULL-NAME is the full name of the font,\n\ | 678 | FULL-NAME is the full name of the font,\n\ |
| @@ -675,7 +680,8 @@ where\n\ | |||
| 675 | SIZE is the minimum bound width of the font,\n\ | 680 | SIZE is the minimum bound width of the font,\n\ |
| 676 | HEIGHT is the height of the font,\n\ | 681 | HEIGHT is the height of the font,\n\ |
| 677 | BASELINE-OFFSET is the upward offset pixels from ASCII baseline,\n\ | 682 | BASELINE-OFFSET is the upward offset pixels from ASCII baseline,\n\ |
| 678 | RELATIVE-COMPOSE is the number controlling how to compose characters.\n\ | 683 | RELATIVE-COMPOSE and DEFAULT-ASCENT are the numbers controlling\n\ |
| 684 | how to compose characters.\n\ | ||
| 679 | If the named font is not yet loaded, return nil.") | 685 | If the named font is not yet loaded, return nil.") |
| 680 | (name, frame) | 686 | (name, frame) |
| 681 | Lisp_Object name, frame; | 687 | Lisp_Object name, frame; |
| @@ -702,7 +708,7 @@ If the named font is not yet loaded, return nil.") | |||
| 702 | if (!fontp) | 708 | if (!fontp) |
| 703 | return Qnil; | 709 | return Qnil; |
| 704 | 710 | ||
| 705 | info = Fmake_vector (make_number (6), Qnil); | 711 | info = Fmake_vector (make_number (7), Qnil); |
| 706 | 712 | ||
| 707 | XVECTOR (info)->contents[0] = build_string (fontp->name); | 713 | XVECTOR (info)->contents[0] = build_string (fontp->name); |
| 708 | XVECTOR (info)->contents[1] = build_string (fontp->full_name); | 714 | XVECTOR (info)->contents[1] = build_string (fontp->full_name); |
| @@ -711,6 +717,7 @@ If the named font is not yet loaded, return nil.") | |||
| 711 | XVECTOR (info)->contents[4] = make_number (fontp->height); | 717 | XVECTOR (info)->contents[4] = make_number (fontp->height); |
| 712 | XVECTOR (info)->contents[5] = make_number (fontp->baseline_offset); | 718 | XVECTOR (info)->contents[5] = make_number (fontp->baseline_offset); |
| 713 | XVECTOR (info)->contents[6] = make_number (fontp->relative_compose); | 719 | XVECTOR (info)->contents[6] = make_number (fontp->relative_compose); |
| 720 | XVECTOR (info)->contents[7] = make_number (fontp->default_ascent); | ||
| 714 | 721 | ||
| 715 | return info; | 722 | return info; |
| 716 | } | 723 | } |
| @@ -790,6 +797,7 @@ syms_of_fontset () | |||
| 790 | /* Window system initializer should have set proper functions. */ | 797 | /* Window system initializer should have set proper functions. */ |
| 791 | abort (); | 798 | abort (); |
| 792 | 799 | ||
| 800 | Qfontset = intern ("fontset"); | ||
| 793 | staticpro (&Qfontset); | 801 | staticpro (&Qfontset); |
| 794 | 802 | ||
| 795 | Vcached_fontset_data = Qnil; | 803 | Vcached_fontset_data = Qnil; |
| @@ -813,6 +821,12 @@ ENCODING is one of the following integer values:\n\ | |||
| 813 | 3: code points 0xA020..0xFF7F are used."); | 821 | 3: code points 0xA020..0xFF7F are used."); |
| 814 | Vfont_encoding_alist = Qnil; | 822 | Vfont_encoding_alist = Qnil; |
| 815 | 823 | ||
| 824 | DEFVAR_LISP ("use-default-ascent", &Vuse_default_ascent, | ||
| 825 | "Char table of characters of which ascent values should be ignored.\n\ | ||
| 826 | If an entry for a character is non-nil, the ascent value of the glyph\n\ | ||
| 827 | is assumed to be what specified by _MULE_DEFAULT_ASCENT property of a font."); | ||
| 828 | Vuse_default_ascent = Qnil; | ||
| 829 | |||
| 816 | defsubr (&Squery_fontset); | 830 | defsubr (&Squery_fontset); |
| 817 | defsubr (&Snew_fontset); | 831 | defsubr (&Snew_fontset); |
| 818 | defsubr (&Sset_fontset_font); | 832 | defsubr (&Sset_fontset_font); |