/[emacs]/emacs/src/fontset.c
ViewVC logotype

Diff of /emacs/src/fontset.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.65.2.14 by handa, Fri Jan 10 07:13:43 2003 UTC revision 1.65.2.15 by handa, Tue May 20 13:04:49 2003 UTC
# Line 269  fontset_id_valid_p (id) Line 269  fontset_id_valid_p (id)
269  #define FONTSET_NAME(fontset)           XCHAR_TABLE (fontset)->extras[1]  #define FONTSET_NAME(fontset)           XCHAR_TABLE (fontset)->extras[1]
270  #define FONTSET_ASCII(fontset)          XCHAR_TABLE (fontset)->extras[4]  #define FONTSET_ASCII(fontset)          XCHAR_TABLE (fontset)->extras[4]
271    
 #define BASE_FONTSET_P(fontset)         STRINGP (FONTSET_NAME (fontset))  
   
272  /* Macros to access special values of (realized) FONTSET.  */  /* Macros to access special values of (realized) FONTSET.  */
273  #define FONTSET_BASE(fontset)           XCHAR_TABLE (fontset)->extras[2]  #define FONTSET_BASE(fontset)           XCHAR_TABLE (fontset)->extras[2]
274  #define FONTSET_FRAME(fontset)          XCHAR_TABLE (fontset)->extras[3]  #define FONTSET_FRAME(fontset)          XCHAR_TABLE (fontset)->extras[3]
# Line 278  fontset_id_valid_p (id) Line 276  fontset_id_valid_p (id)
276  #define FONTSET_REPERTORY(fontset)      XCHAR_TABLE (fontset)->extras[6]  #define FONTSET_REPERTORY(fontset)      XCHAR_TABLE (fontset)->extras[6]
277  #define FONTSET_FALLBACK(fontset)       XCHAR_TABLE (fontset)->extras[7]  #define FONTSET_FALLBACK(fontset)       XCHAR_TABLE (fontset)->extras[7]
278    
279    #define BASE_FONTSET_P(fontset)         (NILP (FONTSET_BASE (fontset)))
280    
281    
282  /* Return the element of FONTSET for the character C.  If FONTSET is a  /* 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     base fontset other then the default fontset and FONTSET doesn't
# Line 372  fontset_add (fontset, range, elt, add) Line 372  fontset_add (fontset, range, elt, add)
372    to = XINT (XCDR (range));    to = XINT (XCDR (range));
373    do {    do {
374      elt1 = char_table_ref_and_range (fontset, from, &from1, &to1);      elt1 = char_table_ref_and_range (fontset, from, &from1, &to1);
375        if (to < to1)
376          to1 = to;
377      if (NILP (elt1))      if (NILP (elt1))
378        elt1 = Fmake_vector (make_number (1), elt);        elt1 = Fmake_vector (make_number (1), elt);
379      else      else
# Line 386  fontset_add (fontset, range, elt, add) Line 388  fontset_add (fontset, range, elt, add)
388            ASET (new, i0, AREF (elt1, i));            ASET (new, i0, AREF (elt1, i));
389          elt1 = new;          elt1 = new;
390        }        }
391      char_table_set_range (fontset, from, to1, elt1);          char_table_set_range (fontset, from, to1, elt1);
392      from = to1 + 1;      from = to1 + 1;
393    } while (from < to);    } while (from < to);
394    return Qnil;    return Qnil;
# Line 620  fontset_face (fontset, c, face) Line 622  fontset_face (fontset, c, face)
622    if (! EQ (base_fontset, Vdefault_fontset))    if (! EQ (base_fontset, Vdefault_fontset))
623      return fontset_face (FONTSET_FALLBACK (fontset), c, face);      return fontset_face (FONTSET_FALLBACK (fontset), c, face);
624    
  font_not_found:  
625    /* We have tried all the fonts for C, but none of them can be opened    /* We have tried all the fonts for C, but none of them can be opened
626       nor can display C.  */       nor can display C.  */
627    if (NILP (FONTSET_NOFONT_FACE (fontset)))    if (NILP (FONTSET_NOFONT_FACE (fontset)))
# Line 1608  fontset.  The format is the same as abob Line 1609  fontset.  The format is the same as abob
1609          {          {
1610            this_fontset = Vdefault_fontset;            this_fontset = Vdefault_fontset;
1611            this_table = XCHAR_TABLE (table)->extras[0];            this_table = XCHAR_TABLE (table)->extras[0];
1612    #if 0
1613            for (i = 0; i < n_realized; i++)            for (i = 0; i < n_realized; i++)
1614              realized[i] = FONTSET_FALLBACK (realized[i]);              realized[i] = FONTSET_FALLBACK (realized[i]);
1615    #endif
1616          }          }
1617        for (c = 0; c <= MAX_5_BYTE_CHAR; )        for (c = 0; c <= MAX_5_BYTE_CHAR; )
1618          {          {
# Line 1814  at the vertical center of lines.  */); Line 1817  at the vertical center of lines.  */);
1817    defsubr (&Sfontset_font);    defsubr (&Sfontset_font);
1818    defsubr (&Sfontset_list);    defsubr (&Sfontset_list);
1819  }  }
1820    
1821    Lisp_Object
1822    dump_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    }

Legend:
Removed from v.1.65.2.14  
changed lines
  Added in v.1.65.2.15

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26