changeset 94936:abd9e2a3d739

Include font.h. (print_object): Handle font-related objects.
author Kenichi Handa <handa@m17n.org>
date Wed, 14 May 2008 01:39:58 +0000
parents 45602a11979b
children 18a1217b0d5e
files src/print.c
diffstat 1 files changed, 29 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/print.c	Wed May 14 01:39:27 2008 +0000
+++ b/src/print.c	Wed May 14 01:39:58 2008 +0000
@@ -36,6 +36,7 @@
 #include "intervals.h"
 #include "blockinput.h"
 #include "termhooks.h"		/* For struct terminal.  */
+#include "font.h"
 
 Lisp_Object Vstandard_output, Qstandard_output;
 
@@ -2129,6 +2130,34 @@
 	  strout (buf, -1, -1, printcharfun, 0);
 	  PRINTCHAR ('>');
 	}
+      else if (FONTP (obj))
+	{
+	  EMACS_INT i;
+
+	  if (! FONT_OBJECT_P (obj))
+	    {
+	      if (FONT_SPEC_P (obj))
+		strout ("#<font-spec", -1, -1, printcharfun, 0);
+	      else
+		strout ("#<font-entity", -1, -1, printcharfun, 0);
+	      for (i = 0; i < FONT_SPEC_MAX; i++)
+		{
+		  PRINTCHAR (' ');
+		  if (i < FONT_WEIGHT_INDEX || i > FONT_WIDTH_INDEX)
+		    print_object (AREF (obj, i), printcharfun, escapeflag);
+		  else
+		    print_object (font_style_symbolic (obj, i, 0),
+				  printcharfun, escapeflag);
+		}
+	    }
+	  else
+	    {
+	      strout ("#<font-object ", -1, -1, printcharfun, 0);
+	      print_object (AREF (obj, FONT_NAME_INDEX), printcharfun,
+			    escapeflag);
+	    }
+	  PRINTCHAR ('>');
+	}
       else
 	{
 	  EMACS_INT size = XVECTOR (obj)->size;