Mercurial > emacs
comparison src/font.c @ 99075:3172ff476053
(font_match_p): Fix for the case that a vector of
characters is in script-representative-chars.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Thu, 23 Oct 2008 07:49:15 +0000 |
parents | 741755a52dcf |
children | 06c37ccf1b58 |
comparison
equal
deleted
inserted
replaced
99074:10cd979d05ca | 99075:3172ff476053 |
---|---|
2472 return 0; | 2472 return 0; |
2473 } | 2473 } |
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 { |
2485 struct font *fontp; | 2510 struct font *fontp; |
2486 | 2511 |
3806 (if VALUE is an integer), or in points (if VALUE is a float). | 3831 (if VALUE is an integer), or in points (if VALUE is a float). |
3807 | 3832 |
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; |
3815 { | 3845 { |
3816 Lisp_Object spec = font_make_spec (); | 3846 Lisp_Object spec = font_make_spec (); |
3902 return to; | 3932 return to; |
3903 } | 3933 } |
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 { |
3911 int idx; | 3947 int idx; |
3912 | 3948 |