aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/font.c50
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
3810VALUE must be a string of XLFD-style or fontconfig-style font name. 3835VALUE must be a string of XLFD-style or fontconfig-style font name.
3811usage: (font-spec ARGS ...) */) 3836usage: (font-spec ARGS ...)
3837
3838`:script'
3839
3840VALUE must be a symbol representing a script that the font must
3841support. */)
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
3905DEFUN ("font-get", Ffont_get, Sfont_get, 2, 2, 0, 3935DEFUN ("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.
3907FONT is a font-spec, a font-entity, or a font-object. */) 3937FONT is a font-spec, a font-entity, or a font-object.
3938KEY must be one of these symbols:
3939 :family, :weight, :slant, :width, :foundry, :adstyle, :registry,
3940 :size, :name, :script
3941See the documentation of `font-spec' for their meanings.
3942If FONT is a font-entity or font-object, the value of :script may be
3943a 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{