Changeset 3055

Show
Ignore:
Timestamp:
03/09/03 16:12:44 (6 years ago)
Author:
miyoshi
Message:

(mw32_check_font_request_alist): Parse and check a
font request alist.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • work/cvs2svn/src/ChangeLog.Meadow

    r3054 r3055  
     12003-03-09  MIYOSHI Masanori  <miyoshi@boreas.dti.ne.jp> 
     2 
     3        * mw32font.c (mw32_check_font_request_alist): Parse and check a 
     4        font request alist. 
     5 
    162003-03-09  MIYASHITA Hisashi  <himi@meadowy.org> 
    27 
  • work/cvs2svn/src/mw32font.c

    r3053 r3055  
    21812181 
    21822182static void 
    2183 mw32_check_font_request_alist(Lisp_Object alist) 
     2183mw32_check_font_request_alist (Lisp_Object alist) 
    21842184{ 
    21852185  Lisp_Object width, height, base, overhang, encoding; 
    21862186  Lisp_Object relative_compose, default_ascent, encoder; 
    21872187  Lisp_Object spacing, dim, centering; 
    2188  
    2189   width = mw32_get_font_request_parameter (Qwidth, alist); 
    2190   height = mw32_get_font_request_parameter (Qheight, alist); 
    2191   base = mw32_get_font_request_parameter (Qbase, alist); 
    2192   overhang = mw32_get_font_request_parameter (Qoverhang, alist); 
    2193   encoding = mw32_get_font_request_parameter (Qencoding, alist); 
    2194   relative_compose = mw32_get_font_request_parameter (Qrelative_compose, alist); 
    2195   default_ascent = mw32_get_font_request_parameter (Qdefault_ascent, alist); 
    2196   spacing = mw32_get_font_request_parameter (Qspacing, alist); 
    2197   centering = mw32_get_font_request_parameter (Qcentering, alist); 
    2198  
    2199   if (!NILP(width)) CHECK_NUMBER (width, 2); 
    2200   if (!NILP(height)) CHECK_NUMBER (height, 3); 
    2201   if (!NILP(base)) CHECK_NUMBER (base, 4); 
    2202   if (!NILP(overhang)) CHECK_NUMBER (overhang, 5); 
    2203   if (!NILP(encoding) && (!mw32_valid_encoding_p (encoding))) 
    2204     error("Encoding:%S is not valid.", encoding); 
    2205   if (!NILP(relative_compose)) CHECK_NUMBER (relative_compose, 7); 
    2206   if (!NILP(default_ascent)) CHECK_NUMBER (default_ascent, 8); 
    2207   if (!NILP(spacing)) CHECK_NUMBER (spacing, 9); 
    2208   if (!NILP(centering)) CHECK_SYMBOL (centering, 10); 
     2188  Lisp_Object fr, spec, logfont, option, tem; 
     2189 
     2190 
     2191  /* check strict-spec */ 
     2192  fr = assq_no_quit (Qstrict_spec, alist); 
     2193  for (fr = XCDR (fr); CONSP (fr); fr = XCDR (fr)) 
     2194    { 
     2195      tem = XCAR (fr); 
     2196      if (!CONSP (tem)) 
     2197        Fsignal (Qerror, Fcons (build_string ("Invalid font request"), 
     2198                                Fcons (alist, Qnil))); 
     2199 
     2200      /* check spec */ 
     2201      spec = XCAR (tem); 
     2202      if (!VECTORP (spec)) 
     2203        Fsignal (Qerror, Fcons (build_string ("Invalid font spec"), 
     2204                                Fcons (spec, Qnil))); 
     2205 
     2206      /* check logfont */ 
     2207      tem = XCDR (tem); 
     2208      if (!CONSP (tem)) 
     2209        Fsignal (Qerror, Fcons (build_string ("Invalid logfont"), 
     2210                                Fcons (tem, Qnil))); 
     2211      logfont = XCAR (tem); 
     2212 
     2213      /* check option */ 
     2214      tem = XCDR (tem); 
     2215      if (!CONSP (tem)) 
     2216        continue; 
     2217      option = XCAR (tem); 
     2218 
     2219      encoding = mw32_get_font_request_parameter (Qencoding, option); 
     2220      if (!NILP (encoding) && (!mw32_valid_encoding_p (encoding))) 
     2221        Fsignal (Qerror, Fcons (build_string ("Invalid encoding"), 
     2222                                Fcons (encoding, Qnil))); 
     2223 
     2224      relative_compose = mw32_get_font_request_parameter (Qrelative_compose, 
     2225                                                          option); 
     2226      if (!NILP (relative_compose)) CHECK_NUMBER (relative_compose, 0); 
     2227 
     2228      default_ascent = mw32_get_font_request_parameter (Qdefault_ascent, 
     2229                                                        option); 
     2230      if (!NILP (default_ascent)) CHECK_NUMBER (default_ascent, 1); 
     2231 
     2232      spacing = mw32_get_font_request_parameter (Qspacing, option); 
     2233      if (!NILP (spacing)) CHECK_NUMBER (spacing, 2); 
     2234 
     2235      centering = mw32_get_font_request_parameter (Qcentering, option); 
     2236      /* needless to check centering */ 
     2237    } 
     2238 
     2239  /* check function */ 
     2240  fr = assq_no_quit (Qfunction, alist); 
     2241  if (CONSP (fr)) 
     2242    { 
     2243      Lisp_Object func = CDR (fr); 
     2244      if (!FUNCTIONP (func)) 
     2245        Fsignal (Qerror, Fcons (build_string ("Invalid function"), 
     2246                                Fcons (func, Qnil))); 
     2247    } 
    22092248} 
    22102249