diff src/fontset.c @ 30124:26076259e03f

(Ffontset_info): Make the return value more compatible with that of Emacs 20.
author Kenichi Handa <handa@m17n.org>
date Mon, 10 Jul 2000 04:01:01 +0000
parents c8e5453dc85d
children 5a375a2cdd3a
line wrap: on
line diff
--- a/src/fontset.c	Sun Jul 09 18:36:21 2000 +0000
+++ b/src/fontset.c	Mon Jul 10 04:01:01 2000 +0000
@@ -1221,10 +1221,11 @@
 
 DEFUN ("fontset-info", Ffontset_info, Sfontset_info, 1, 2, 0,
   "Return information about a fontset named NAME on frame FRAME.\n\
-The value is a list:\n\
-  \(FONTSET-NAME (CHARSET-OR-RANGE FONT-SPEC OPENED ...) ...),\n\
+The value is a vector:\n\
+  [ SIZE HEIGHT ((CHARSET-OR-RANGE FONT-SPEC OPENED ...) ...) ],\n\
 where,\n\
-  FONTSET-NAME is a full name of the fontset.\n\
+  SIZE is the maximum bound width of ASCII font in the fontset,\n\
+  HEIGHT is the maximum bound height of ASCII font in the fontset,\n\
   CHARSET-OR-RANGE is a charset, a character (may be a generic character)\n\
     or a cons of two characters specifying the range of characters.\n\
   FONT-SPEC is a fontname pattern string or a cons (FAMILY . REGISTRY),\n\
@@ -1233,6 +1234,7 @@
     FAMILY may contain a `FOUNDARY' field at the head.\n\
     REGISTRY may contain a `CHARSET_ENCODING' field at the tail.\n\
   OPENEDs are names of fonts actually opened.\n\
+If the ASCII font is not yet opened, SIZE and HEIGHT are 0.\n\
 If FRAME is omitted, it defaults to the currently selected frame.")
   (name, frame)
      Lisp_Object name, frame;
@@ -1242,6 +1244,7 @@
   Lisp_Object indices[3];
   Lisp_Object val, tail, elt;
   Lisp_Object *realized;
+  struct font_info *fontp = NULL;
   int n_realized = 0;
   int i;
   
@@ -1313,7 +1316,17 @@
 	    }
 	}
     }
-  return Fcons (FONTSET_NAME (fontset), val);
+
+  elt = Fcdr (Fcdr (Fassq (CHARSET_SYMBOL (CHARSET_ASCII), val)));
+  if (CONSP (elt))
+    {
+      elt = XCAR (elt);
+      fontp = (*query_font_func) (f, XSTRING (elt)->data);
+    }
+  val = Fmake_vector (make_number (3), val);
+  AREF (val, 0) = fontp ? make_number (fontp->size) : make_number (0);
+  AREF (val, 1) = fontp ? make_number (fontp->height) : make_number (0);
+  return val;
 }
 
 DEFUN ("fontset-font", Ffontset_font, Sfontset_font, 2, 2, 0,