diff options
| author | Kenichi Handa | 2008-10-23 07:49:15 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2008-10-23 07:49:15 +0000 |
| commit | 5bdd4dd25d95a4d1b55b15ce126734c90e5e5cfd (patch) | |
| tree | 67eaf70901ba81b7e93d16ef3030c04141697c90 /src | |
| parent | 159bd5a226e5038c5133399212808b1fe09ec507 (diff) | |
| download | emacs-5bdd4dd25d95a4d1b55b15ce126734c90e5e5cfd.tar.gz emacs-5bdd4dd25d95a4d1b55b15ce126734c90e5e5cfd.zip | |
(font_match_p): Fix for the case that a vector of
characters is in script-representative-chars.
Diffstat (limited to 'src')
| -rw-r--r-- | src/font.c | 50 |
1 files changed, 43 insertions, 7 deletions
diff --git a/src/font.c b/src/font.c index 5e09323cf63..1b3fa9e8237 100644 --- a/src/font.c +++ b/src/font.c | |||
| @@ -2474,11 +2474,36 @@ font_match_p (spec, font) | |||
| 2474 | else if (EQ (key, QCscript)) | 2474 | else if (EQ (key, QCscript)) |
| 2475 | { | 2475 | { |
| 2476 | val2 = assq_no_quit (val, Vscript_representative_chars); | 2476 | val2 = assq_no_quit (val, Vscript_representative_chars); |
| 2477 | if (! NILP (val2)) | 2477 | if (CONSP (val2)) |
| 2478 | for (val2 = XCDR (val2); CONSP (val2); val2 = XCDR (val2)) | 2478 | { |
| 2479 | if (font_encode_char (font, XINT (XCAR (val2))) | 2479 | val2 = XCDR (val2); |
| 2480 | == FONT_INVALID_CODE) | 2480 | if (CONSP (val2)) |
| 2481 | return 0; | 2481 | { |
| 2482 | /* All characters in the list must be supported. */ | ||
| 2483 | for (; CONSP (val2); val2 = XCDR (val2)) | ||
| 2484 | { | ||
| 2485 | if (! NATNUMP (XCAR (val2))) | ||
| 2486 | continue; | ||
| 2487 | if (font_encode_char (font, XFASTINT (XCAR (val2))) | ||
| 2488 | == FONT_INVALID_CODE) | ||
| 2489 | return 0; | ||
| 2490 | } | ||
| 2491 | } | ||
| 2492 | else if (VECTORP (val2)) | ||
| 2493 | { | ||
| 2494 | /* At most one character in the vector must be supported. */ | ||
| 2495 | for (i = 0; i < ASIZE (val2); i++) | ||
| 2496 | { | ||
| 2497 | if (! NATNUMP (AREF (val2, i))) | ||
| 2498 | continue; | ||
| 2499 | if (font_encode_char (font, XFASTINT (AREF (val2, i))) | ||
| 2500 | != FONT_INVALID_CODE) | ||
| 2501 | return break; | ||
| 2502 | } | ||
| 2503 | if (i == ASIZE (val2)) | ||
| 2504 | return 0; | ||
| 2505 | } | ||
| 2506 | } | ||
| 2482 | } | 2507 | } |
| 2483 | else if (EQ (key, QCotf)) | 2508 | else if (EQ (key, QCotf)) |
| 2484 | { | 2509 | { |
| @@ -3808,7 +3833,12 @@ specifying the font size. It specifies the font size in pixels | |||
| 3808 | `:name' | 3833 | `:name' |
| 3809 | 3834 | ||
| 3810 | VALUE must be a string of XLFD-style or fontconfig-style font name. | 3835 | VALUE must be a string of XLFD-style or fontconfig-style font name. |
| 3811 | usage: (font-spec ARGS ...) */) | 3836 | usage: (font-spec ARGS ...) |
| 3837 | |||
| 3838 | `:script' | ||
| 3839 | |||
| 3840 | VALUE must be a symbol representing a script that the font must | ||
| 3841 | support. */) | ||
| 3812 | (nargs, args) | 3842 | (nargs, args) |
| 3813 | int nargs; | 3843 | int nargs; |
| 3814 | Lisp_Object *args; | 3844 | Lisp_Object *args; |
| @@ -3904,7 +3934,13 @@ properties in TO. */) | |||
| 3904 | 3934 | ||
| 3905 | DEFUN ("font-get", Ffont_get, Sfont_get, 2, 2, 0, | 3935 | DEFUN ("font-get", Ffont_get, Sfont_get, 2, 2, 0, |
| 3906 | doc: /* Return the value of FONT's property KEY. | 3936 | doc: /* Return the value of FONT's property KEY. |
| 3907 | FONT is a font-spec, a font-entity, or a font-object. */) | 3937 | FONT is a font-spec, a font-entity, or a font-object. |
| 3938 | KEY must be one of these symbols: | ||
| 3939 | :family, :weight, :slant, :width, :foundry, :adstyle, :registry, | ||
| 3940 | :size, :name, :script | ||
| 3941 | See the documentation of `font-spec' for their meanings. | ||
| 3942 | If FONT is a font-entity or font-object, the value of :script may be | ||
| 3943 | a list of scripts that are supported by the font. */) | ||
| 3908 | (font, key) | 3944 | (font, key) |
| 3909 | Lisp_Object font, key; | 3945 | Lisp_Object font, key; |
| 3910 | { | 3946 | { |