]> git.eshelyaron.com Git - emacs.git/commitdiff
*** empty log message ***
authorKenichi Handa <handa@m17n.org>
Wed, 30 Apr 2008 07:38:08 +0000 (07:38 +0000)
committerKenichi Handa <handa@m17n.org>
Wed, 30 Apr 2008 07:38:08 +0000 (07:38 +0000)
src/font.c
src/font.h
src/ftfont.c
src/lisp.h
src/xfaces.c
src/xftfont.c

index ba48c276b78a5fbf8ae193fb4e795886b4a2d695..cadf0bff72321da68b45c7a645f81ab2af618432 100644 (file)
@@ -213,17 +213,16 @@ font_pixel_size (f, spec)
 {
   Lisp_Object size = AREF (spec, FONT_SIZE_INDEX);
   double point_size;
-  int pixel_size, dpi;
+  int dpi, pixel_size;
   Lisp_Object extra, val;
 
   if (INTEGERP (size))
     return XINT (size);
   if (NILP (size))
-    return 0;
-  xassert (FLOATP (size));
+    return 0;  xassert (FLOATP (size));
   point_size = XFLOAT_DATA (size);
-  dpi = AREF (spec, FONT_DPI_INDEX);
-  if (INTEGERP (dpi))
+  val = AREF (spec, FONT_DPI_INDEX);
+  if (INTEGERP (val))
     dpi = XINT (XCDR (val));
   else
     dpi = f->resy;
@@ -330,7 +329,6 @@ extern Lisp_Object Vface_alternative_font_family_alist;
 
 extern Lisp_Object find_font_encoding P_ ((Lisp_Object));
 
-EXFUN (Fassoc_string, 3);
 
 /* Return encoding charset and repertory charset for REGISTRY in
    ENCODING and REPERTORY correspondingly.  If correct information for
@@ -443,7 +441,7 @@ font_prop_validate_style (style, val)
     {
       int n = font_style_to_value (prop, val, 0);
 
-      val = n >= 0 ? make_number (val) : Qerror;
+      val = n >= 0 ? make_number (n) : Qerror;
     }
   else
     val = Qerror;
@@ -1015,7 +1013,7 @@ font_parse_xlfd (name, font)
       val = INTERN_FIELD (XLFD_SPACING_INDEX);
       if (! NILP (val))
        {
-         val = font_prop_validate_spacing (FONT_SPACING_INDEX, val);
+         val = font_prop_validate_spacing (QCspacing, val);
          if (! INTEGERP (val))
            return -1;
          ASET (font, FONT_SPACING_INDEX, val);
@@ -1091,7 +1089,7 @@ font_parse_xlfd (name, font)
        ASET (font, FONT_DPI_INDEX, prop[XLFD_RESY_INDEX]);
       if (! NILP (prop[XLFD_SPACING_INDEX]))
        {
-         val = font_prop_validate_spacing (FONT_SPACING_INDEX,
+         val = font_prop_validate_spacing (QCspacing,
                                            prop[XLFD_SPACING_INDEX]);
          if (! INTEGERP (val))
            return -1;
@@ -1486,7 +1484,7 @@ font_parse_name (name, font)
 
 void
 font_parse_family_registry (family, registry, font_spec)
-     Lisp_Object family, registry;
+     Lisp_Object family, registry, font_spec;
 {
   int len;
   char *p0, *p1;
@@ -2781,7 +2779,7 @@ font_find_for_lface (f, attrs, spec, c)
       if (INTEGERP (size))
        ASET (prefer, FONT_SIZE_INDEX, size);
       else if (FLOATP (size))
-       ASET (prefer, FONT_SIZE_INDEX, font_pixel_size (f, spec));
+       ASET (prefer, FONT_SIZE_INDEX, make_number (font_pixel_size (f, spec)));
       else
        {
          double pt = XINT (attrs[LFACE_HEIGHT_INDEX]);
@@ -3272,7 +3270,7 @@ Optional 2nd argument EXTRA-TYPE, if non-nil, specifies to check
 which kind of font it is.  It must be one of `font-spec', `font-entity'
 `font-object'.  */)
      (object, extra_type)
-     Lisp_Object object;
+     Lisp_Object object, extra_type;
 {
   if (NILP (extra_type))
     return (FONTP (object) ? Qt : Qnil);
index ed688525d4c24d6d39ee97796171a6eac480d78d..320555d5f86b1e11f4c7723663793e303d223d80 100644 (file)
@@ -763,6 +763,7 @@ EXFUN (Ffont_spec, MANY);
 EXFUN (Fcopy_font_spec, 1);
 EXFUN (Fmerge_font_spec, 2);
 EXFUN (Ffont_get, 2);
+EXFUN (Ffont_put, 3);
 EXFUN (Flist_fonts, 4);
 EXFUN (Ffont_family_list, 1);
 EXFUN (Fclear_font_cache, 0);
index 84a15e80b5b91b47794fa753a7a020621ef3cca4..7360742231db78e4e680d4a9f3eb20d01ecc420d 100644 (file)
@@ -421,9 +421,9 @@ ftfont_spec_pattern (spec, otlayout, otspec)
     return NULL;
 
   if (INTEGERP (AREF (spec, FONT_DPI_INDEX)))
-    dpi = XINT (dpi);
+    dpi = XINT (AREF (spec, FONT_DPI_INDEX));
   if (INTEGERP (AREF (spec, FONT_SPACING_INDEX)))
-    spacing = XINT (val);
+    spacing = XINT (AREF (spec, FONT_SPACING_INDEX));
   if (INTEGERP (AREF (spec, FONT_AVGWIDTH_INDEX))
       && XINT (AREF (spec, FONT_AVGWIDTH_INDEX)) == 0)
     scalable = 1;
index 2b08ec89b8ac9aebc4121787baa71ef9c2ffbb53..1752cb865d8324dacdc12c37589c7c78aa20ea77 100644 (file)
@@ -2975,6 +2975,7 @@ EXFUN (Fread_minibuffer, 2);
 EXFUN (Feval_minibuffer, 2);
 EXFUN (Fread_string, 5);
 EXFUN (Fread_no_blanks_input, 3);
+EXFUN (Fassoc_string, 3);
 extern Lisp_Object get_minibuffer P_ ((int));
 extern void temp_echo_area_glyphs P_ ((Lisp_Object));
 extern void init_minibuf_once P_ ((void));
index 8575e171c1bef26ac3279a90adfb3ec6d5994da8..0bc81fb1de2c1c482dff1ec1574233745299e36b 100644 (file)
@@ -319,7 +319,7 @@ Lisp_Object QCfontset;
 
 /* Keywords symbols used for font properties.  */
 extern Lisp_Object QCfoundry, QCadstyle, QCregistry;
-extern QCspacing, QCsize, QCavgwidth;
+extern Lisp_Object QCspacing, QCsize, QCavgwidth;
 extern Lisp_Object Qp;
 
 /* Symbols used for attribute values.  */
@@ -1892,15 +1892,19 @@ the face font sort order.  */)
       for (i = 0; i < 4; i++)
        switch (font_sort_order[i])
          {
-         case XLFD_SWIDTH: font_props_for_sorting[i] = QCwidth; break;
-         case XLFD_POINT_SIZE: font_props_for_sorting[i] = QCsize; break;
-         case XLFD_WEIGHT: font_props_for_sorting[i] = QCweight; break;
-         default: font_props_for_sorting[i] = QCslant; break;
+         case XLFD_SWIDTH:
+           font_props_for_sorting[i] = FONT_WIDTH_INDEX; break;
+         case XLFD_POINT_SIZE:
+           font_props_for_sorting[i] = FONT_SIZE_INDEX; break;
+         case XLFD_WEIGHT:
+           font_props_for_sorting[i] = FONT_WEIGHT_INDEX; break;
+         default:
+           font_props_for_sorting[i] = FONT_SLANT_INDEX; break;
          }
-      font_sort_order[i++] = QCfamily;
-      font_sort_order[i++] = QCfoundry;
-      font_sort_order[i++] = QCadstyle;
-      font_sort_order[i++] = QCregistry;
+      font_props_for_sorting[i++] = FONT_FAMILY_INDEX;
+      font_props_for_sorting[i++] = FONT_FOUNDRY_INDEX;
+      font_props_for_sorting[i++] = FONT_ADSTYLE_INDEX;
+      font_props_for_sorting[i++] = FONT_REGISTRY_INDEX;
 
       qsort (XVECTOR (vec)->contents, nfonts, sizeof (Lisp_Object),
             compare_fonts_by_sort_order);
@@ -1916,7 +1920,8 @@ the face font sort order.  */)
 
       ASET (v, 0, AREF (font, FONT_FAMILY_INDEX));
       ASET (v, 1, FONT_WIDTH_SYMBOLIC (font));
-      point = PIXEL_TO_POINT (AREF (font, FONT_SIZE_INDEX) * 10, f->resy);
+      point = PIXEL_TO_POINT (XINT (AREF (font, FONT_SIZE_INDEX)) * 10,
+                             f->resy);
       ASET (v, 2, make_number (point));
       ASET (v, 3, FONT_WEIGHT_SYMBOLIC (font));
       ASET (v, 4, FONT_SLANT_SYMBOLIC (font));
index 1324b4dcd5bf8b40d2a4b376349e768dff9c4a18..da72df45393680280456192746ce6b1d93a99d83 100644 (file)
@@ -545,7 +545,7 @@ xftfont_shape (lgstring)
 {
   struct font *font;
   struct xftfont_info *xftfont_info;
-  int result;
+  Lisp_Object result;
   FT_Face ft_face;
 
   CHECK_FONT_GET_OBJECT (LGSTRING_FONT (lgstring), font);
@@ -563,7 +563,7 @@ xftfont_shape (lgstring)
            OTF_close (otf);
          xftfont_info->maybe_otf = 0;
          XftUnlockFace (xftfont_info->xftfont);
-         return 0;
+         return Qnil;
        }
       xftfont_info->otf = otf;
     }