aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2003-05-20 13:04:49 +0000
committerKenichi Handa2003-05-20 13:04:49 +0000
commite3400864d27649a28e2a684db3bb7f16577cd0e9 (patch)
tree230f6d67808c4becdce5a2e580b2045840b36232 /src
parent4b971341ff5ad247dccd762f13cd0a0360bc0510 (diff)
downloademacs-e3400864d27649a28e2a684db3bb7f16577cd0e9.tar.gz
emacs-e3400864d27649a28e2a684db3bb7f16577cd0e9.zip
(BASE_FONTSET_P): Check FONTSET_BASE, not
FONTSET_NAME. (fontset_add): Fix for the case that TO is less than TO1. (Ffontset_info): Don't use fallback fontset on checking the default fontset. (dump_fontset): New function for debugging.
Diffstat (limited to 'src')
-rw-r--r--src/fontset.c34
1 files changed, 30 insertions, 4 deletions
diff --git a/src/fontset.c b/src/fontset.c
index 209d699b84e..1c880aa246b 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -269,8 +269,6 @@ fontset_id_valid_p (id)
269#define FONTSET_NAME(fontset) XCHAR_TABLE (fontset)->extras[1] 269#define FONTSET_NAME(fontset) XCHAR_TABLE (fontset)->extras[1]
270#define FONTSET_ASCII(fontset) XCHAR_TABLE (fontset)->extras[4] 270#define FONTSET_ASCII(fontset) XCHAR_TABLE (fontset)->extras[4]
271 271
272#define BASE_FONTSET_P(fontset) STRINGP (FONTSET_NAME (fontset))
273
274/* Macros to access special values of (realized) FONTSET. */ 272/* Macros to access special values of (realized) FONTSET. */
275#define FONTSET_BASE(fontset) XCHAR_TABLE (fontset)->extras[2] 273#define FONTSET_BASE(fontset) XCHAR_TABLE (fontset)->extras[2]
276#define FONTSET_FRAME(fontset) XCHAR_TABLE (fontset)->extras[3] 274#define FONTSET_FRAME(fontset) XCHAR_TABLE (fontset)->extras[3]
@@ -278,6 +276,8 @@ fontset_id_valid_p (id)
278#define FONTSET_REPERTORY(fontset) XCHAR_TABLE (fontset)->extras[6] 276#define FONTSET_REPERTORY(fontset) XCHAR_TABLE (fontset)->extras[6]
279#define FONTSET_FALLBACK(fontset) XCHAR_TABLE (fontset)->extras[7] 277#define FONTSET_FALLBACK(fontset) XCHAR_TABLE (fontset)->extras[7]
280 278
279#define BASE_FONTSET_P(fontset) (NILP (FONTSET_BASE (fontset)))
280
281 281
282/* Return the element of FONTSET for the character C. If FONTSET is a 282/* Return the element of FONTSET for the character C. If FONTSET is a
283 base fontset other then the default fontset and FONTSET doesn't 283 base fontset other then the default fontset and FONTSET doesn't
@@ -372,6 +372,8 @@ fontset_add (fontset, range, elt, add)
372 to = XINT (XCDR (range)); 372 to = XINT (XCDR (range));
373 do { 373 do {
374 elt1 = char_table_ref_and_range (fontset, from, &from1, &to1); 374 elt1 = char_table_ref_and_range (fontset, from, &from1, &to1);
375 if (to < to1)
376 to1 = to;
375 if (NILP (elt1)) 377 if (NILP (elt1))
376 elt1 = Fmake_vector (make_number (1), elt); 378 elt1 = Fmake_vector (make_number (1), elt);
377 else 379 else
@@ -386,7 +388,7 @@ fontset_add (fontset, range, elt, add)
386 ASET (new, i0, AREF (elt1, i)); 388 ASET (new, i0, AREF (elt1, i));
387 elt1 = new; 389 elt1 = new;
388 } 390 }
389 char_table_set_range (fontset, from, to1, elt1); 391 char_table_set_range (fontset, from, to1, elt1);
390 from = to1 + 1; 392 from = to1 + 1;
391 } while (from < to); 393 } while (from < to);
392 return Qnil; 394 return Qnil;
@@ -620,7 +622,6 @@ fontset_face (fontset, c, face)
620 if (! EQ (base_fontset, Vdefault_fontset)) 622 if (! EQ (base_fontset, Vdefault_fontset))
621 return fontset_face (FONTSET_FALLBACK (fontset), c, face); 623 return fontset_face (FONTSET_FALLBACK (fontset), c, face);
622 624
623 font_not_found:
624 /* We have tried all the fonts for C, but none of them can be opened 625 /* We have tried all the fonts for C, but none of them can be opened
625 nor can display C. */ 626 nor can display C. */
626 if (NILP (FONTSET_NOFONT_FACE (fontset))) 627 if (NILP (FONTSET_NOFONT_FACE (fontset)))
@@ -1608,8 +1609,10 @@ fontset. The format is the same as abobe. */)
1608 { 1609 {
1609 this_fontset = Vdefault_fontset; 1610 this_fontset = Vdefault_fontset;
1610 this_table = XCHAR_TABLE (table)->extras[0]; 1611 this_table = XCHAR_TABLE (table)->extras[0];
1612#if 0
1611 for (i = 0; i < n_realized; i++) 1613 for (i = 0; i < n_realized; i++)
1612 realized[i] = FONTSET_FALLBACK (realized[i]); 1614 realized[i] = FONTSET_FALLBACK (realized[i]);
1615#endif
1613 } 1616 }
1614 for (c = 0; c <= MAX_5_BYTE_CHAR; ) 1617 for (c = 0; c <= MAX_5_BYTE_CHAR; )
1615 { 1618 {
@@ -1814,3 +1817,26 @@ at the vertical center of lines. */);
1814 defsubr (&Sfontset_font); 1817 defsubr (&Sfontset_font);
1815 defsubr (&Sfontset_list); 1818 defsubr (&Sfontset_list);
1816} 1819}
1820
1821Lisp_Object
1822dump_fontset (fontset)
1823 Lisp_Object fontset;
1824{
1825 Lisp_Object val;
1826
1827 if (NILP (FONTSET_FALLBACK (fontset)))
1828 val = Fcons (Fcons (intern ("fallback-id"), Qnil), Qnil);
1829 else
1830 val = Fcons (Fcons (intern ("fallback-id"),
1831 FONTSET_ID (FONTSET_FALLBACK (fontset))),
1832 Qnil);
1833 if (NILP (FONTSET_BASE (fontset)))
1834 val = Fcons (Fcons (intern ("base"), Qnil), val);
1835 else
1836 val = Fcons (Fcons (intern ("base"),
1837 FONTSET_NAME (FONTSET_BASE (fontset))),
1838 val);
1839 val = Fcons (Fcons (intern ("name"), FONTSET_NAME (fontset)), val);
1840 val = Fcons (Fcons (intern ("id"), FONTSET_ID (fontset)), val);
1841 return val;
1842}