emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/xfns.c,v [emacs]


From: Kenichi Handa
Subject: [Emacs-diffs] Changes to emacs/src/xfns.c,v [emacs]
Date: Tue, 06 Jun 2006 03:56:47 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Branch:         emacs
Changes by:     Kenichi Handa <handa>   06/06/06 03:56:47

Index: xfns.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/xfns.c,v
retrieving revision 1.590.2.38
retrieving revision 1.590.2.39
diff -u -b -r1.590.2.38 -r1.590.2.39
--- xfns.c      31 Mar 2006 04:56:21 -0000      1.590.2.38
+++ xfns.c      6 Jun 2006 03:56:46 -0000       1.590.2.39
@@ -49,6 +49,10 @@
 #include "termhooks.h"
 #include "atimer.h"
 
+#ifdef USE_FONT_BACKEND
+#include "font.h"
+#endif /* USE_FONT_BACKEND */
+
 #ifdef HAVE_X_WINDOWS
 
 #include <ctype.h>
@@ -537,6 +541,8 @@
 
 
 
+static void x_default_font_parameter P_ ((struct frame *, Lisp_Object));
+
 static Lisp_Object unwind_create_frame P_ ((Lisp_Object));
 static Lisp_Object unwind_create_tip_frame P_ ((Lisp_Object));
 
@@ -2958,6 +2964,43 @@
   return Qnil;
 }
 
+#ifdef USE_FONT_BACKEND
+static void
+x_default_font_parameter (f, parms)
+     struct frame *f;
+     Lisp_Object parms;
+{
+  struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
+  Lisp_Object font = x_get_arg (dpyinfo, parms, Qfont, "font", "Font",
+                               RES_TYPE_STRING);
+
+  if (! STRINGP (font))
+    {
+      char *names[]
+       = { "-adobe-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1",
+           "-misc-fixed-medium-r-normal-*-*-140-*-*-c-*-iso8859-1",
+           "-*-*-medium-r-normal-*-*-140-*-*-c-*-iso8859-1",
+           /* This was formerly the first thing tried, but it finds
+              too many fonts and takes too long.  */
+           "-*-*-medium-r-*-*-*-*-*-*-c-*-iso8859-1",
+           /* If those didn't work, look for something which will
+              at least work.  */
+           "-*-fixed-*-*-*-*-*-140-*-*-c-*-iso8859-1",
+           NULL };
+      int i;
+
+      for (i = 0; names[i]; i++)
+       {
+         font = font_open_by_name (f, names[i]);
+         if (! NILP (font))
+           break;
+       }
+      if (NILP (font))
+       font = build_string ("fixed");
+    }
+  x_default_parameter (f, parms, Qfont, font, "font", "Font", RES_TYPE_STRING);
+}
+#endif /* USE_FONT_BACKEND */
 
 DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame,
        1, 1, 0,
@@ -3133,8 +3176,32 @@
       specbind (Qx_resource_name, name);
     }
 
+  f->resx = dpyinfo->resx;
+  f->resy = dpyinfo->resy;
+
+#ifdef USE_FONT_BACKEND
+  if (enable_font_backend)
+    {
+      /* Perhaps, we must allow frame parameter, say `font-backend',
+        to specify which font backends to use.  */
+#ifdef HAVE_FREETYPE
+#ifdef HAVE_XFT
+      register_font_driver (&xftfont_driver, f);
+#else  /* not HAVE_XFT */
+      register_font_driver (&ftxfont_driver, f);
+#endif /* not HAVE_XFT */
+#endif /* HAVE_FREETYPE */
+      register_font_driver (&xfont_driver, f);
+    }
+#endif /* USE_FONT_BACKEND */
+
   /* Extract the window parameters from the supplied values
      that are needed to determine window geometry.  */
+#ifdef USE_FONT_BACKEND
+  if (enable_font_backend)
+    x_default_font_parameter (f, parms);
+else
+#endif /* USE_FONT_BACKEND */
   {
     Lisp_Object font;
 
@@ -4719,8 +4786,32 @@
       specbind (Qx_resource_name, name);
     }
 
+  f->resx = dpyinfo->resx;
+  f->resy = dpyinfo->resy;
+
+#ifdef USE_FONT_BACKEND
+  if (enable_font_backend)
+    {
+      /* Perhaps, we must allow frame parameter, say `font-backend',
+        to specify which font backends to use.  */
+#ifdef HAVE_FREETYPE
+#ifdef HAVE_XFT
+      register_font_driver (&xftfont_driver, f);
+#else  /* not HAVE_XFT */
+      register_font_driver (&ftxfont_driver, f);
+#endif /* not HAVE_XFT */
+#endif /* HAVE_FREETYPE */
+      register_font_driver (&xfont_driver, f);
+    }
+#endif /* USE_FONT_BACKEND */
+
   /* Extract the window parameters from the supplied values that are
      needed to determine window geometry.  */
+#ifdef USE_FONT_BACKEND
+  if (enable_font_backend)
+    x_default_font_parameter (f, parms);
+else
+#endif /* USE_FONT_BACKEND */
   {
     Lisp_Object font;
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]