savannah-hackers
[Top][All Lists]
Advanced

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

[Savannah-help-public] address@hidden: Emacs-diffs Digest, Vol 43, Issue


From: Richard Stallman
Subject: [Savannah-help-public] address@hidden: Emacs-diffs Digest, Vol 43, Issue 24]
Date: Tue, 06 Jun 2006 17:13:08 -0400

Something has gone wrong with the script that mails diffs
to this list.  It was supposed to be set up to mail only
changes in the trunk, but these changes are in a branch.

------- Start of forwarded message -------
From: address@hidden
Subject: Emacs-diffs Digest, Vol 43, Issue 24
To: address@hidden
Reply-To: address@hidden
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
X-Spam-Status: No, score=-2.6 required=5.0 tests=ALL_TRUSTED,MISSING_DATE,
        NO_REAL_NAME autolearn=failed version=3.0.4
Date: Tue, 06 Jun 2006 00:01:04 -0400

Send Emacs-diffs mailing list submissions to
        address@hidden

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.gnu.org/mailman/listinfo/emacs-diffs
or, via email, send a message with subject or body 'help' to
        address@hidden

You can reach the person managing the list at
        address@hidden

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Emacs-diffs digest..."


Today's Topics:

   1. Changes to emacs/src/xfaces.c,v [emacs] (Kenichi Handa)
   2. Changes to emacs/src/xterm.c,v [emacs] (Kenichi Handa)
   3. Changes to emacs/src/Attic/ChangeLog.unicode,     v [emacs]
      (Kenichi Handa)
   4. Changes to emacs/configure.in,v [emacs] (Kenichi Handa)


- ----------------------------------------------------------------------

Message: 1
Date: Tue, 06 Jun 2006 03:52:38 +0000
From: Kenichi Handa <address@hidden>
Subject: [Emacs-diffs] Changes to emacs/src/xfaces.c,v [emacs]
To: address@hidden
Message-ID: <address@hidden>

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

Index: xfaces.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/xfaces.c,v
retrieving revision 1.281.2.43
retrieving revision 1.281.2.44
diff -u -b -r1.281.2.43 -r1.281.2.44
- --- xfaces.c  10 May 2006 20:42:34 -0000      1.281.2.43
+++ xfaces.c    6 Jun 2006 03:52:38 -0000       1.281.2.44
@@ -246,6 +246,12 @@
 #include "window.h"
 #include "intervals.h"
 
+#ifdef HAVE_WINDOW_SYSTEM
+#ifdef USE_FONT_BACKEND
+#include "font.h"
+#endif /* USE_FONT_BACKEND */
+#endif /* HAVE_WINDOW_SYSTEM */
+
 #ifdef HAVE_X_WINDOWS
 
 /* Compensate for a bug in Xos.h on some systems, on which it requires
@@ -988,6 +994,9 @@
     {
       struct x_display_info *dpyinfo;
 
+#ifdef USE_FONT_BACKEND
+      if (! enable_font_backend)
+#endif /* USE_FONT_BACKEND */
       /* Fonts are common for frames on one display, i.e. on
         one X screen.  */
       for (dpyinfo = x_display_list; dpyinfo; dpyinfo = dpyinfo->next)
@@ -1249,6 +1258,10 @@
   char *font_name;
   int needs_overstrike;
 
+#ifdef USE_FONT_BACKEND
+  if (enable_font_backend)
+    abort ();
+#endif /* USE_FONT_BACKEND */
   face->font_info_id = -1;
   face->font = NULL;
   face->font_name = NULL;
@@ -2188,6 +2201,58 @@
 
 #ifdef HAVE_WINDOW_SYSTEM
 
+#ifdef USE_FONT_BACKEND
+static INLINE Lisp_Object
+face_symbolic_value (table, dim, font_prop)
+     struct table_entry *table;
+     int dim;
+     Lisp_Object font_prop;
+{
+  struct table_entry *p;
+  char *s = SDATA (SYMBOL_NAME (font_prop));
+  int low, mid, high, cmp;
+
+  low = 0;
+  high = dim - 1;
+
+  while (low <= high)
+    {
+      mid = (low + high) / 2;
+      cmp = strcmp (table[mid].name, s);
+
+      if (cmp < 0)
+       low = mid + 1;
+      else if (cmp > 0)
+       high = mid - 1;
+      else
+       return *table[mid].symbol;
+    }
+
+  return Qnil;
+}
+
+static INLINE Lisp_Object
+face_symbolic_weight (weight)
+     Lisp_Object weight;
+{
+  return face_symbolic_value (weight_table, DIM (weight_table), weight);
+}
+
+static INLINE Lisp_Object
+face_symbolic_slant (slant)
+     Lisp_Object slant;
+{
+  return face_symbolic_value (slant_table, DIM (slant_table), slant);
+}
+
+static INLINE Lisp_Object
+face_symbolic_swidth (width)
+     Lisp_Object width;
+{
+  return face_symbolic_value (swidth_table, DIM (swidth_table), width);
+}
+#endif /* USE_FONT_BACKEND */
+
 Lisp_Object
 split_font_name_into_vector (fontname)
      Lisp_Object fontname;
@@ -3467,6 +3532,107 @@
 
   /* If FONTNAME is actually a fontset name, get ASCII font name of it.  */
   fontset = fs_query_fontset (fontname, 0);
+
+#ifdef USE_FONT_BACKEND
+  if (enable_font_backend)
+    {
+      Lisp_Object entity;
+      struct font *font = NULL;
+
+      if (fontset > 0)
+       font = fontset_ascii_font (f, fontset);
+      else if (fontset == 0)
+       {
+         if (may_fail_p)
+           return 0;
+         abort ();
+       }
+      else
+       {
+         Lisp_Object font_object = font_open_by_name (f, SDATA (fontname));
+
+         if (! NILP (font_object))
+           {
+             font = XSAVE_VALUE (font_object)->pointer;
+             fontset = new_fontset_from_font (f, font_object);
+           }
+       }
+
+      if (! font)
+       {
+         if (may_fail_p)
+           return 0;
+         abort ();
+       }
+
+      entity = font->entity;
+
+      /* Set attributes only if unspecified, otherwise face defaults for
+        new frames would never take effect.  If we couldn't get a font
+        name conforming to XLFD, set normal values.  */
+
+      if (force_p || UNSPECIFIEDP (LFACE_FAMILY (lface)))
+       {
+         Lisp_Object foundry = AREF (entity, FONT_FOUNDRY_INDEX);
+         Lisp_Object family = AREF (entity, FONT_FAMILY_INDEX);
+         Lisp_Object val;
+
+         if (! NILP (foundry))
+           {
+             if (! NILP (family))
+               val = concat3 (SYMBOL_NAME (foundry), build_string ("-"),
+                              SYMBOL_NAME (family));
+             else
+               val = concat2 (SYMBOL_NAME (foundry), build_string ("-*"));
+           }
+         else
+           {
+             if (! NILP (family))
+               val = SYMBOL_NAME (family);
+             else
+               val = build_string ("*");
+           }
+         LFACE_FAMILY (lface) = val;
+       }
+
+      if (force_p || UNSPECIFIEDP (LFACE_HEIGHT (lface)))
+       {
+         int pt = pixel_point_size (f, font->pixel_size * 10);
+
+         xassert (pt > 0);
+         LFACE_HEIGHT (lface) = make_number (pt);
+       }
+
+      if (force_p || UNSPECIFIEDP (LFACE_AVGWIDTH (lface)))
+       LFACE_AVGWIDTH (lface) = make_number (0);
+
+      if (force_p || UNSPECIFIEDP (LFACE_WEIGHT (lface)))
+       {
+         Lisp_Object weight = font_symbolic_weight (entity);
+         Lisp_Object symbol = face_symbolic_weight (weight);
+
+         LFACE_WEIGHT (lface) = NILP (symbol) ? weight : symbol;
+       }
+      if (force_p || UNSPECIFIEDP (LFACE_SLANT (lface)))
+       {
+         Lisp_Object slant = font_symbolic_slant (entity);
+         Lisp_Object symbol = face_symbolic_slant (slant);
+
+         LFACE_SLANT (lface) = NILP (symbol) ? slant : symbol;
+       }
+      if (force_p || UNSPECIFIEDP (LFACE_SWIDTH (lface)))
+       {
+         Lisp_Object width = font_symbolic_width (entity);
+         Lisp_Object symbol = face_symbolic_swidth (width);
+
+         LFACE_SWIDTH (lface) = NILP (symbol) ? width : symbol;
+       }
+
+      ASET (lface, LFACE_FONT_INDEX, Ffont_xlfd_name (font->entity));
+      ASET (lface, LFACE_FONTSET_INDEX, fontset_name (fontset));
+      return 1;
+    }
+#endif /* USE_FONT_BACKEND */
   if (fontset > 0)
     font_name = SDATA (fontset_ascii (fontset));
   else if (fontset == 0)
@@ -4592,6 +4758,18 @@
 
       if (STRINGP (LFACE_FONT (lface)))
        font_name = LFACE_FONT (lface);
+#ifdef USE_FONT_BACKEND
+      else if (enable_font_backend)
+       {
+         Lisp_Object entity = font_find_for_lface (f, &AREF (lface, 0), Qnil);
+
+         if (NILP (entity))
+           error ("No font matches the specified attribute");
+         font_name = font_open_for_lface (f, &AREF (lface, 0), entity);
+         if (NILP (font_name))
+           error ("No font matches the specified attribute");
+       }
+#endif
       else
        {
          /* Choose a font name that reflects LFACE's attributes and has
@@ -5357,6 +5535,10 @@
            free_face_fontset (f, face);
          if (face->gc)
            {
+#ifdef USE_FONT_BACKEND
+             if (enable_font_backend && face->font_info)
+               font_done_for_face (f, face);
+#endif /* USE_FONT_BACKEND */
              x_free_gc (f, face->gc);
              face->gc = 0;
            }
@@ -5418,6 +5600,10 @@
        }
 #endif
       face->gc = x_create_gc (f, mask, &xgcv);
+#ifdef USE_FONT_BACKEND
+      if (enable_font_backend && face->font)
+       font_prepare_for_face (f, face);
+#endif /* USE_FONT_BACKEND */
       UNBLOCK_INPUT;
     }
 #endif /* HAVE_WINDOW_SYSTEM */
@@ -5524,6 +5710,10 @@
          struct face *face = c->faces_by_id[i];
          if (face && face->gc)
            {
+#ifdef USE_FONT_BACKEND
+             if (enable_font_backend && face->font_info)
+               font_done_for_face (c->f, face);
+#endif /* USE_FONT_BACKEND */
              x_free_gc (c->f, face->gc);
              face->gc = 0;
            }
@@ -5850,6 +6040,43 @@
 
   return face->id;
 }
+
+#ifdef USE_FONT_BACKEND
+int
+face_for_font (f, font, base_face)
+     struct frame *f;
+     struct font *font;
+     struct face *base_face;
+{
+  struct face_cache *cache = FRAME_FACE_CACHE (f);
+  unsigned hash;
+  int i;
+  struct face *face;
+
+  xassert (cache != NULL);
+  base_face = base_face->ascii_face;
+  hash = lface_hash (base_face->lface);
+  i = hash % FACE_CACHE_BUCKETS_SIZE;
+
+  for (face = cache->buckets[i]; face; face = face->next)
+    {
+      if (face->ascii_face == face)
+       continue;
+      if (face->ascii_face == base_face
+         && face->font_info == (struct font_info *) font)
+       return face->id;
+    }
+
+  /* If not found, realize a new face.  */
+  face = realize_non_ascii_face (f, -1, base_face);
+  face->font = font->font.font;
+  face->font_info = (struct font_info *) font;
+  face->font_info_id = 0;
+  face->font_name = font->font.full_name;
+  return face->id;
+}
+#endif /* USE_FONT_BACKEND */
+
 #endif /* HAVE_WINDOW_SYSTEM */
 
 /* Return the face id of the realized face for named face SYMBOL on
@@ -6451,6 +6678,10 @@
       free_all_realized_faces (Qnil);
     }
 
+#ifdef USE_FONT_BACKEND
+  font_update_sort_order (font_sort_order);
+#endif /* USE_FONT_BACKEND */
+
   return Qnil;
 }
 
@@ -7425,6 +7656,9 @@
     {
       face->font = default_face->font;
       face->font_info_id = default_face->font_info_id;
+#ifdef USE_FONT_BACKEND
+      face->font_info = default_face->font_info;
+#endif /* USE_FONT_BACKEND */
       face->font_name = default_face->font_name;
       face->fontset
        = make_fontset_for_ascii_face (f, default_face->fontset, face);
@@ -7447,8 +7681,16 @@
        fontset = default_face->fontset;
       if (fontset == -1)
        abort ();
+#ifdef USE_FONT_BACKEND
+      if (enable_font_backend)
+       font_load_for_face (f, face);
+      else
+#endif /* USE_FONT_BACKEND */
       load_face_font (f, face);
+      if (face->font)
       face->fontset = make_fontset_for_ascii_face (f, fontset, face);
+      else
+       face->fontset = -1;
     }
 
   /* Load colors, and set remaining attributes.  */




- ------------------------------

Message: 2
Date: Tue, 06 Jun 2006 03:52:52 +0000
From: Kenichi Handa <address@hidden>
Subject: [Emacs-diffs] Changes to emacs/src/xterm.c,v [emacs]
To: address@hidden
Message-ID: <address@hidden>

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

Index: xterm.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/xterm.c,v
retrieving revision 1.804.2.56
retrieving revision 1.804.2.57
diff -u -b -r1.804.2.56 -r1.804.2.57
- --- xterm.c   17 May 2006 07:46:43 -0000      1.804.2.56
+++ xterm.c     6 Jun 2006 03:52:51 -0000       1.804.2.57
@@ -102,6 +102,10 @@
 #include "gtkutil.h"
 #endif
 
+#ifdef USE_FONT_BACKEND
+#include "font.h"
+#endif /* USE_FONT_BACKEND */
+
 #ifdef USE_LUCID
 extern int xlwmenu_window_p P_ ((Widget w, Window window));
 extern void xlwmenu_redisplay P_ ((Widget));
@@ -1076,6 +1080,11 @@
   /* If font in this face is same as S->font, use it.  */
   if (s->font == s->face->font)
     s->gc = s->face->gc;
+#ifdef USE_FONT_BACKEND
+  else if (enable_font_backend)
+    /* No need of setting a font for s->gc.  */
+    s->gc = s->face->gc;
+#endif /* USE_FONT_BACKEND */
   else
     {
       /* Otherwise construct scratch_cursor_gc with values from FACE
@@ -1173,6 +1182,10 @@
   XRectangle r;
   get_glyph_string_clip_rect (s, &r);
   XSetClipRectangles (s->display, s->gc, 0, 0, &r, 1, Unsorted);
+#ifdef USE_FONT_BACKEND
+  s->clip_x = r.x, s->clip_y = r.y;
+  s->clip_width = r.width, s->clip_height = r.height;
+#endif /* USE_FONT_BACKEND */
 }
 
 
@@ -1185,6 +1198,18 @@
      struct glyph_string *src, *dst;
 {
   XRectangle r;
+
+#ifdef USE_FONT_BACKEND
+  if (enable_font_backend)
+    {
+      r.x = dst->clip_x = src->x;
+      r.width = dst->clip_width = src->clip_width;
+      r.y = dst->clip_y = src->clip_y;
+      r.height = dst->clip_height = src->clip_height;
+    }
+  else
+    {
+#endif /* USE_FONT_BACKEND */
   struct glyph_string *clip_head = src->clip_head;
   struct glyph_string *clip_tail = src->clip_tail;
 
@@ -1192,6 +1217,9 @@
   src->clip_head = src->clip_tail = src;
   get_glyph_string_clip_rect (src, &r);
   src->clip_head = clip_head, src->clip_tail = clip_tail;
+#ifdef USE_FONT_BACKEND
+    }
+#endif /* USE_FONT_BACKEND */
   XSetClipRectangles (dst->display, dst->gc, 0, 0, &r, 1, Unsorted);
 }
 
@@ -1208,6 +1236,24 @@
     {
       XCharStruct cs;
       int direction, font_ascent, font_descent;
+
+#ifdef USE_FONT_BACKEND
+      if (enable_font_backend)
+       {
+         unsigned *code = alloca (sizeof (unsigned) * s->nchars);
+         struct font *font = (struct font *) s->font_info;
+         struct font_metrics metrics;
+         int i;
+
+         for (i = 0; i < s->nchars; i++)
+           code[i] = (s->char2b[i].byte1 << 8) | s->char2b[i].byte2;
+         font->driver->text_extents (font, code, s->nchars, &metrics);
+         cs.rbearing = metrics.rbearing;
+         cs.lbearing = metrics.lbearing;
+         cs.width = metrics.width;
+       }
+      else
+#endif /* USE_FONT_BACKEND */
       XTextExtents16 (s->font, s->char2b, s->nchars, &direction,
                      &font_ascent, &font_descent, &cs);
       s->right_overhang = cs.rbearing > cs.width ? cs.rbearing - cs.width : 0;
@@ -1307,6 +1353,30 @@
          x += g->pixel_width;
        }
     }
+#ifdef USE_FONT_BACKEND
+  else if (enable_font_backend)
+    {
+      unsigned *code = alloca (sizeof (unsigned) * s->nchars);
+      int boff = s->font_info->baseline_offset;
+      struct font *font = (struct font *) s->font_info;
+      int y;
+
+      for (i = 0; i < s->nchars; i++)
+       code[i] = (s->char2b[i].byte1 << 8) | s->char2b[i].byte2;
+
+      if (s->font_info->vertical_centering)
+       boff = VCENTER_BASELINE_OFFSET (s->font, s->f) - boff;
+
+      y = s->ybase - boff;
+      if (s->for_overlaps
+         || (s->background_filled_p && s->hl != DRAW_CURSOR))
+       font->driver->draw (s, 0, s->nchars, x, y, 0);
+      else
+       font->driver->draw (s, 0, s->nchars, x, y, 1);
+      if (s->face->overstrike)
+       font->driver->draw (s, 0, s->nchars, x + 1, y, 0);
+    }
+#endif /* USE_FONT_BACKEND */
   else
     {
       char *char1b = (char *) s->char2b;
@@ -1389,6 +1459,60 @@
        XDrawRectangle (s->display, s->window, s->gc, x, s->y,
                        s->width - 1, s->height - 1);
     }
+#ifdef USE_FONT_BACKEND
+  else if (enable_font_backend)
+    {
+      struct font *font = (struct font *) s->font_info;
+      int y = s->ybase;
+      int width = 0;
+
+      if (s->cmp->method == COMPOSITION_WITH_GLYPH_STRING)
+       {
+         Lisp_Object gstring = AREF (XHASH_TABLE (composition_hash_table)
+                                     ->key_and_value,
+                                     s->cmp->hash_index * 2);
+         int from;
+
+         for (i = from = 0; i < s->nchars; i++)
+           {
+             Lisp_Object g = LGSTRING_GLYPH (gstring, i);
+
+             if (XINT (LGLYPH_XOFF (4)) == 0 && XINT (LGLYPH_YOFF (g)) == 0
+                 && XINT (LGLYPH_WADJUST (g)) == 0)
+               {
+                 width += XINT (LGLYPH_WIDTH (g));
+                 continue;
+               }
+             if (from < i)
+               {
+                 font->driver->draw (s, from, i, x, y, 0);
+                 x += width;
+               }
+             font->driver->draw (s, i, i + 1,
+                                 x + XINT (LGLYPH_XOFF (g)),
+                                 y + XINT (LGLYPH_XOFF (g)),
+                                 0);
+             x += XINT (LGLYPH_WIDTH (g)) + XINT (LGLYPH_WADJUST (g));
+             from = i + 1;
+             width = 0;
+           }
+         if (from < i)
+           font->driver->draw (s, from, i, x, y, 0);
+       }
+      else
+       {
+         for (i = 0; i < s->nchars; i++, ++s->gidx)
+           {
+             int xx = x + s->cmp->offsets[s->gidx * 2];
+             int yy = y - s->cmp->offsets[s->gidx * 2 + 1];
+
+             font->driver->draw (s, i, i + 1, xx, yy, 0);
+             if (s->face->overstrike)
+               font->driver->draw (s, i, i + 1, xx + 1, yy, 0);
+           }
+       }
+    }
+#endif /* USE_FONT_BACKEND */
   else
     {
       for (i = 0; i < s->nchars; i++, ++s->gidx)
@@ -2643,6 +2767,9 @@
            x_set_glyph_string_gc (next);
            x_set_glyph_string_clipping (next);
            x_draw_glyph_string_background (next, 1);
+#ifdef USE_FONT_BACKEND
+           next->clip_width = 0;
+#endif /* USE_FONT_BACKEND */
          }
     }
 
@@ -2711,6 +2838,12 @@
          int y;
 
          /* Get the underline thickness.  Default is 1 pixel.  */
+#ifdef USE_FONT_BACKEND
+         if (enable_font_backend)
+           /* In the future, we must use information of font.  */
+           h = 1;
+         else
+#endif /* USE_FONT_BACKEND */
          if (!XGetFontProperty (s->font, XA_UNDERLINE_THICKNESS, &h))
            h = 1;
 
@@ -2722,6 +2855,12 @@
             ROUND ((maximum descent) / 2), with
             ROUND(x) = floor (x + 0.5)  */
 
+#ifdef USE_FONT_BACKEND
+         if (enable_font_backend)
+           /* In the future, we must use information of font.  */
+           y = s->ybase + (s->face->font->max_bounds.descent + 1) / 2;
+         else
+#endif
          if (x_use_underline_position_properties
              && XGetFontProperty (s->font, XA_UNDERLINE_POSITION, &tem))
            y = s->ybase + (long) tem;
@@ -2802,9 +2941,15 @@
                prev->hl = s->hl;
                x_set_glyph_string_gc (prev);
                x_set_glyph_string_clipping_exactly (s, prev);
+               if (prev->first_glyph->type == CHAR_GLYPH)
                x_draw_glyph_string_foreground (prev);
+               else
+                 x_draw_composite_glyph_string_foreground (prev);
                XSetClipMask (prev->display, prev->gc, None);
                prev->hl = save;
+#ifdef USE_FONT_BACKEND
+               prev->clip_width = 0;
+#endif /* USE_FONT_BACKEND */
              }
        }
 
@@ -2814,7 +2959,7 @@
 
          for (next = s->next; next; next = next->next)
            if (next->hl != s->hl
- -             && next->x - next->left_overhang && s->next->hl != s->hl)
+               && next->x - next->left_overhang < s->x + s->width)
              {
                /* As next will be drawn while clipped to its own area,
                   we must draw the left_overhang part using s->hl now.  */
@@ -2823,15 +2968,24 @@
                next->hl = s->hl;
                x_set_glyph_string_gc (next);
                x_set_glyph_string_clipping_exactly (s, next);
+               if (next->first_glyph->type == CHAR_GLYPH)
                x_draw_glyph_string_foreground (next);
+               else
+                 x_draw_composite_glyph_string_foreground (next);
                XSetClipMask (next->display, next->gc, None);
                next->hl = save;
+#ifdef USE_FONT_BACKEND
+               next->clip_width = 0;
+#endif /* USE_FONT_BACKEND */
              }
        }
     }
 
   /* Reset clipping.  */
   XSetClipMask (s->display, s->gc, None);
+#ifdef USE_FONT_BACKEND
+  s->clip_width = 0;
+#endif /* USE_FONT_BACKEND */
 }
 
 /* Shift display to make room for inserted glyphs.   */
@@ -8007,6 +8161,90 @@
   return fontset_name (fontset);
 }
 
+#ifdef USE_FONT_BACKEND
+Lisp_Object
+x_new_fontset2 (f, fontsetname)
+     struct frame *f;
+     Lisp_Object fontsetname;
+{
+  int fontset;
+  struct font *font;
+  XFontStruct *xfont;
+
+  if (STRINGP (fontsetname))
+    {
+      fontset = fs_query_fontset (fontsetname, 0);
+      if (fontset > 0 && f->output_data.x->fontset == fontset)
+       /* This fontset is already set in frame F.  There's nothing more
+          to do.  */
+       return fontset_name (fontset);
+      if (fontset == 0)
+       /* The default fontset can't be the default font.   */
+       return Qt;
+      if (fontset < 0)
+       fontset = new_fontset_from_font_name (fontsetname);
+    }
+  else
+    fontset = new_fontset_from_font (f, fontsetname);
+
+  if (fontset < 0)
+    return Qnil;
+
+  font = fontset_ascii_font (f, fontset);
+  xfont = font->font.font;
+
+  if (FRAME_FONT (f) == xfont)
+    /* This font is already set in frame F.  There's nothing more to
+       do.  */
+    return fontset_name (fontset);
+
+  BLOCK_INPUT;
+
+  FRAME_FONT (f) = xfont;
+  FRAME_BASELINE_OFFSET (f) = font->font.baseline_offset;
+  FRAME_FONTSET (f) = fontset;
+
+  FRAME_COLUMN_WIDTH (f) = font->font.average_width;
+  FRAME_SPACE_WIDTH (f) = font->font.space_width;
+  FRAME_LINE_HEIGHT (f) = font->font.height;
+
+  compute_fringe_widths (f, 1);
+
+  /* Compute the scroll bar width in character columns.  */
+  if (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) > 0)
+    {
+      int wid = FRAME_COLUMN_WIDTH (f);
+      FRAME_CONFIG_SCROLL_BAR_COLS (f)
+       = (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) + wid - 1) / wid;
+    }
+  else
+    {
+      int wid = FRAME_COLUMN_WIDTH (f);
+      FRAME_CONFIG_SCROLL_BAR_COLS (f) = (14 + wid - 1) / wid;
+    }
+
+  /* Now make the frame display the given font.  */
+  if (FRAME_X_WINDOW (f) != 0)
+    {
+      /* Don't change the size of a tip frame; there's no point in
+        doing it because it's done in Fx_show_tip, and it leads to
+        problems because the tip frame has no widget.  */
+      if (NILP (tip_frame) || XFRAME (tip_frame) != f)
+       x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f));
+    }
+
+#ifdef HAVE_X_I18N
+  if (FRAME_XIC (f)
+      && (FRAME_XIC_STYLE (f) & (XIMPreeditPosition | XIMStatusArea)))
+    xic_set_xfontset (f, SDATA (fontset_ascii (fontset)));
+#endif
+
+  UNBLOCK_INPUT;
+
+  return fontset_name (fontset);
+}
+#endif /* USE_FONT_BACKEND */
+
 
 /***********************************************************************
                           X Input Methods
@@ -9008,6 +9246,15 @@
      commands to the X server.  */
   if (dpyinfo->display)
     {
+#ifdef USE_FONT_BACKEND
+      /* We must free faces before destroying windows because some
+        font-driver (e.g. xft) access a window while finishing a
+        face.  */
+      if (enable_font_backend
+         && FRAME_FACE_CACHE (f))
+       free_frame_faces (f);
+#endif /* USE_FONT_BACKEND */
+
       if (f->output_data.x->icon_desc)
        XDestroyWindow (FRAME_X_DISPLAY (f), f->output_data.x->icon_desc);
 




- ------------------------------

Message: 3
Date: Tue, 06 Jun 2006 03:53:04 +0000
From: Kenichi Handa <address@hidden>
Subject: [Emacs-diffs] Changes to emacs/src/Attic/ChangeLog.unicode,    v
        [emacs]
To: address@hidden
Message-ID: <address@hidden>

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

Index: ChangeLog.unicode
===================================================================
RCS file: /cvsroot/emacs/emacs/src/Attic/ChangeLog.unicode,v
retrieving revision 1.1.2.49
retrieving revision 1.1.2.50
diff -u -b -r1.1.2.49 -r1.1.2.50
- --- ChangeLog.unicode 15 May 2006 02:49:54 -0000      1.1.2.49
+++ ChangeLog.unicode   6 Jun 2006 03:53:04 -0000       1.1.2.50
@@ -1,3 +1,109 @@
+2006-06-06  Kenichi Handa  <address@hidden>
+
+       These changes are for the new font handling codes.
+
+       * Makefile.in (ALL_CFLAGS): Add @FREETYPE_CFLAGS@,
+       @FONTCONFIG_CFLAGS@, and @address@hidden
+       (LIB_X11_LIB): If HAVE_XFT is defined, set to @address@hidden
+       (FONTSRC, FONTOBJ): New variables.
+       (obj): Add $(FONTOBJ).
+       (SOME_MACHINE_OBJECTS): Lib_X11_Lib.
+       (LIBES): Add @FREETYPE_LIBS@, @FONTCONFIG_LIBS@, and
+       @address@hidden
+       (font.o, ftfont.o, xfont.o, xftfont.o, ftxfont.o): New targets.
+       (fontset.o, xdisp.o, xfaces.o, xfns.o, xterm.o): Depends on
+       $(FONTSRC).
+
+       * font.h, font.c, xfont.c, ftfont.c, xftfont.c, ftxfont.c: New
+       files.
+
+       * character.h (Vscript_representative_chars): Extern it.
+
+       * character.c (Vscript_representative_chars): New variable.
+       (syms_of_character): Declare it as a Lisp variable.
+
+       * composite.c (get_composition_id) [USE_FONT_BACKEND]: If
+       enable_font_backend is nonzero, accept the composition method
+       COMPOSITION_WITH_GLYPH_STRING.
+
+       * composite.h (enum composition_method) [USE_FONT_BACKEND]: New
+       enumeration COMPOSITION_WITH_GLYPH_STRING.
+
+       * config.in: Re-generated.
+
+       * dispextern.h (struct glyph_string) [USE_FONT_BACKEND]: New
+       members clip_x, clip_y, clip_width, and clip_height.
+       (struct face) [USE_FONT_BACKEND]: New members font_info and extra.
+
+       * emacs.c (main) [USE_FONT_BACKEND]: Handle arg
+       --enable-font-backend.  Call syms_of_font.
+
+       * fns.c (assoc_no_quit): New function.
+
+       * fontset.h (FONT_INFO_FROM_FACE): New macro.
+       (face_for_font, new_fontset_from_font)
+       (fontset_ascii_font) [USE_FONT_BACKEND]: Extern them.
+
+       * fontset.c [USE_FONT_BACKEND]: Include "font.h".
+       (fontset_font, fontset_ascii, face_for_char)
+       (make_fontset_for_ascii_face, Ffont_info)
+       (Finternal_char_font) [USE_FONT_BACKEND]: If enable_font_backend
+       is nonzero, use font-backend mechanism.
+       (find_font_encoding): Make it non-static.
+       (new_fontset_from_font, fontset_ascii_font) [USE_FONT_BACKEND]:
+       New functions.
+
+       * frame.h (struct frame): New members resx and resy.
+       (struct frame) [USE_FONT_BACKEND]: New member font_driver_list.
+       (x_new_fontset2) [USE_FONT_BACKEND]: Extern it.
+
+       * frame.c [USE_FONT_BACKEND]: Include "font.h".
+       (make_frame, x_set_font) [USE_FONT_BACKEND]: Use font-backend
+       mechanism.
+
+       * xdisp.c: If USE_FONT_BACKEND is defined, include "font.h".
+       Through out the file, use FONT_INFO_FROM_FACE instead of
+       FONT_INFO_FROM_ID, use get_per_char_metric instead of
+       rif->per_char_metric.
+       (handle_composition_prop) [USE_FONT_BACKEND]: If the composition
+       method is COMPOSITION_WITH_GLYPH_STRING, just set it->c to ' '.
+       (get_glyph_face_and_encoding, fill_composite_glyph_string)
+       (get_char_face_and_encoding, BUILD_COMPOSITE_GLYPH_STRING)
+       (x_produce_glyphs) [USE_FONT_BACKEND]: If enable_font_backend is
+       nonzero, use font-backend mechanism.
+       (get_per_char_metric): New function.
+
+       * xfaces.c [USE_FONT_BACKEND]: Include "font.h".
+       (set_lface_from_font_name)
+       (set_font_frame_param, free_realized_face)
+       (prepare_face_for_display, clear_face_gcs)
+       (Finternal_set_font_selection_order, realize_x_face)
+       [USE_FONT_BACKEND]: If enable_font_backend is nonzero, use
+       font-backend mechanism.
+       (clear_face_cache) [USE_FONT_BACKEND]: Don't call
+       clear_font_table.
+       (load_face_font) [USE_FONT_BACKEND]: Abort.
+       (face_symbolic_value, face_symbolic_weight, face_symbolic_slant)
+       (face_symbolic_swidth, face_for_font) [USE_FONT_BACKEND]: New
+       functions.
+
+       * xfns.c [USE_FONT_BACKEND]: Include "font.h".
+       (x_default_font_parameter) [USE_FONT_BACKEND]: New function.
+       (Fx_create_frame) [USE_FONT_BACKEND]: If enable_font_backend is
+       nonzero, register all available font drivers.  Call
+       x_default_font_parameter for deciding a font.
+       (x_create_tip_frame) [USE_FONT_BACKEND]: Likewise.
+
+       * xterm.c [USE_FONT_BACKEND]: Include "font.h".
+       (x_set_mouse_face_gc, x_set_glyph_string_clipping)
+       (x_set_glyph_string_clipping_exactly)
+       (x_compute_glyph_string_overhangs)
+       (x_draw_glyph_string_foreground)
+       (x_draw_composite_glyph_string_foreground, x_draw_glyph_string)
+       (x_free_frame_resources) [USE_FONT_BACKEND]: If
+       enable_font_backend is nonzero, use font-backend mechanism.
+       (x_new_fontset2) [USE_FONT_BACKEND]: New function.
+
 2006-05-15  Kenichi Handa  <address@hidden>
 
        * coding.h (system_eol_type): Fix synching with HEAD.




- ------------------------------

Message: 4
Date: Tue, 06 Jun 2006 03:53:23 +0000
From: Kenichi Handa <address@hidden>
Subject: [Emacs-diffs] Changes to emacs/configure.in,v [emacs]
To: address@hidden
Message-ID: <address@hidden>

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

Index: configure.in
===================================================================
RCS file: /cvsroot/emacs/emacs/configure.in,v
retrieving revision 1.351.2.28
retrieving revision 1.351.2.29
diff -u -b -r1.351.2.28 -r1.351.2.29
- --- configure.in      2 Apr 2006 01:09:59 -0000       1.351.2.28
+++ configure.in        6 Jun 2006 03:53:23 -0000       1.351.2.29
@@ -109,6 +109,10 @@
 [  --with-gif              use -lungif for displaying GIF images])
 AC_ARG_WITH(png,
 [  --with-png              use -lpng for displaying PNG images])
+AC_ARG_WITH(freetype,
+[  --with-freetype         use -lfreetype for local fonts support])
+AC_ARG_WITH(xft,
+[  --with-xft              use -lXft for anti aliased fonts])
 AC_ARG_WITH(gtk,
 [  --with-gtk              use GTK (same as --with-x-toolkit=gtk)])
 AC_ARG_WITH(pkg-config-prog,
@@ -125,6 +129,11 @@
                           specify install directory for Emacs.app on Mac OS 
X]],
 [ carbon_appdir_x=${enableval}])
 
+AC_ARG_ENABLE(font-backend,
+[  --enable-font-backend   compile code of font-backend support],
+      USE_FONT_BACKEND=$enableval,
+      USE_FONT_BACKEND=no)
+
 AC_ARG_ENABLE(asserts,
 [  --enable-asserts        compile code with asserts enabled],
       USE_XASSERTS=$enableval,
@@ -2269,6 +2278,90 @@
   CFLAGS=$late_CFLAGS
 fi
 
+### For font-backend
+if test "${USE_FONT_BACKEND}" = "yes"; then
+
+AC_DEFINE(USE_FONT_BACKEND, 1,
+          [Define to 1 if we should use font-backend.])
+
+### Use -lXft if available, unless `--with-freetype=no' nor `--with-xft=no'.
+HAVE_XFT=maybe
+if test "${HAVE_X11}" = "yes"; then
+  if test "x${with_freetype}" = "xno"; then
+    with_xft="no";
+  fi
+  if test "x${with_xft}" != "xno"; then
+
+    dnl Check if --with-pkg-config-prog has been given.
+    if test "X${with_pkg_config_prog}" != X; then
+      PKG_CONFIG="${with_pkg_config_prog}"
+    fi
+
+    PKG_CHECK_MODULES(XFT, xft >= 0.13.0, , HAVE_XFT=no)
+    if test "$HAVE_XFT" != no; then
+      OLD_CPPFLAGS="$CPPFLAGS"
+      OLD_CFLAGS="$CFLAGS"
+      OLD_LIBS="$LIBS"
+      CPPFLAGS="$CPPFLAGS $XFT_CFLAGS"
+      CFLAGS="$CFLAGS $XFT_CFLAGS"
+      LIBS="$XFT_LIBS $LIBS"
+      AC_CHECK_HEADER(X11/Xft/Xft.h,
+        AC_CHECK_LIB(Xft, XftFontOpen, HAVE_XFT=yes, , $XFT_LIBS))
+
+      if test "${HAVE_XFT}" = "yes"; then
+        AC_DEFINE(HAVE_XFT, 1, [Define to 1 if you have the Xft library.])
+       AC_SUBST(XFT_LIBS)
+        C_SWITCH_X_SITE="$C_SWITCH_X_SITE $XFT_CFLAGS"
+      else
+        CFLAGS="$OLD_CPPFLAGS"
+        CFLAGS="$OLD_CFLAGS"
+        LIBS="$OLD_LIBS"
+      fi
+    fi
+  fi
+fi
+
+HAVE_FREETYPE=no
+### Use -lfreetype if available, unless `--with-freetype=no'.
+if test "${HAVE_XFT}" = "yes"; then
+  dnl As we use Xft, we anyway use freetype.
+  dnl In this case, there's no need of additional CFLAGS and LIBS.
+  HAVE_FREETYPE=yes
+elif test "x${with_freetype}" != "xno"; then
+  dnl Check if --with-pkg-config-prog has been given.
+  if test "X${with_pkg_config_prog}" != X; then
+    PKG_CONFIG="${with_pkg_config_prog}"
+  fi
+
+  PKG_CHECK_MODULES(FREETYPE, freetype2, HAVE_FREETYPE=yes, HAVE_FREETYPE=no)
+  if test "${HAVE_FREETYPE}" = "yes"; then
+    PKG_CHECK_MODULES(FONTCONFIG, fontconfig, HAVE_FC=yes, HAVE_FC=no)
+    if test "${HAVE_FC}" = "no"; then
+      dnl Witout fontconfig, we can't use freetype at the moment.
+      HAVE_FREETYPE=no
+    fi
+  fi
+fi
+if test "${HAVE_FREETYPE}" = "yes"; then
+  AC_DEFINE(HAVE_FREETYPE, 1,
+           [Define to 1 if you have freetype and fontconfig libraries.])
+  AC_CHECK_PROG(HAVE_LIBOTF, libotf-config, yes, no)
+  if test "${HAVE_LIBOTF}" = "yes"; then
+    AC_DEFINE(HAVE_LIBOTF, 1,
+             [Define to 1 if you have libotf library.])
+    LIBOTF_CFLAGS=`libotf-config --cflags`
+    LIBOTF_LIBS=`libotf-config --libs`
+  fi
+fi
+AC_SUBST(FREETYPE_CFLAGS)
+AC_SUBST(FREETYPE_LIBS)
+AC_SUBST(FONTCONFIG_CFLAGS)
+AC_SUBST(FONTCONFIG_LIBS)
+AC_SUBST(LIBOTF_CFLAGS)
+AC_SUBST(LIBOTF_LIBS)
+
+fi
+
 ### Use -lXpm if available, unless `--with-xpm=no'.
 HAVE_XPM=no
 if test "${HAVE_X11}" = "yes"; then




- ------------------------------

_______________________________________________
Emacs-diffs mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/emacs-diffs


End of Emacs-diffs Digest, Vol 43, Issue 24
*******************************************
------- End of forwarded message -------




reply via email to

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