(mdatabase__dir_list, M_database_hook)
[m17n/m17n-lib.git] / src / face.c
index f8bfca5..9e7ecc7 100644 (file)
 
 /***ja
     @addtogroup m17nFace
-    @brief ¥Õ¥§¡¼¥¹¤È¤Ï¡¢M-text ¤Îɽ¼¨¤òÀ©¸æ¤¹¤ë¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤¢¤ë.
+    @brief ¥Õ¥§¡¼¥¹¤È¤Ï¡¢M-text ¤Î¸«±É¤¨¤òÀ©¸æ¤¹¤ë¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤¢¤ë.
 
     @e ¥Õ¥§¡¼¥¹ ¤Ï #MFace ·¿¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤¢¤ê¡¢M-text ¤Îɽ¼¨ÊýË¡
     ¤òÀ©¸æ¤¹¤ë¡£¥Õ¥§¡¼¥¹¤Ï¸ÇÄê¸Ä¿ô¤Î @e ¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£ ¤ò»ý¤Ä¡£
-    ¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Ï¥­¡¼¤ÈÃͤ«¤é¤Ê¤ë¡£¥­¡¼¤Ï¥·¥ó¥Ü¥ë¤Ç¤¢¤ê¡¢
+    ¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Ï¥­¡¼¤ÈÃͤ«¤é¤Ê¤ë¡£¥­¡¼¤Ï°Ê²¼¤Î¥·¥ó¥Ü¥ë¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë¡£
 
     #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox, 
     #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle, 
@@ -86,6 +86,7 @@
 #include <string.h>
 #include <ctype.h>
 
+#include "config.h"
 #include "m17n-gui.h"
 #include "m17n-misc.h"
 #include "internal.h"
 
 static M17NObjectArray face_table;
 
-static MSymbol Mlatin;
+MSymbol Mlatin;
 
 static MSymbol M_face_prop_index;
 
-/** Find a realized face registered on FRAME that is realized from
-    FACE and using font RFONT.  If RFONT is NULL, find any that
-    matches FACE.  */
+static MPlist *hline_prop_list;
+static MPlist *box_prop_list;
+
+/** Special hook function pointer that does nothing.  */
+static MFaceHookFunc noop_hook;
+
+/**  */
+static MFaceHLineProp *
+get_hline_create (MFaceHLineProp *prop)
+{
+  MPlist *plist;
+  MFaceHLineProp *hline;
+
+  if (prop->width == 0)
+    return MPLIST_VAL (hline_prop_list);
+  MPLIST_DO (plist, MPLIST_NEXT (hline_prop_list))
+    {
+      hline = MPLIST_VAL (plist);
+      if (prop->type == hline->type
+         && prop->width == hline->width
+         && prop->color == hline->color)
+       return hline;
+    }
+  MSTRUCT_MALLOC (hline, MERROR_FACE);
+  *hline = *prop;
+  mplist_push (plist, Mt, hline);
+  return hline;
+}
+
+static MFaceBoxProp *
+get_box_create (MFaceBoxProp *prop)
+{
+  MPlist *plist;
+  MFaceBoxProp *box;
+
+  if (prop->width == 0)
+    return MPLIST_VAL (box_prop_list);
+  MPLIST_DO (plist, MPLIST_NEXT (box_prop_list))
+    {
+      box = MPLIST_VAL (plist);
+      if (prop->width == box->width
+         && prop->color_top == box->color_top
+         && prop->color_bottom == box->color_bottom
+         && prop->color_left == box->color_left
+         && prop->color_right == box->color_right
+         && prop->inner_hmargin == box->inner_hmargin
+         && prop->inner_vmargin == box->inner_vmargin
+         && prop->outer_hmargin == box->inner_hmargin
+         && prop->inner_vmargin == box->inner_vmargin)
+       return box;
+    }
+  MSTRUCT_MALLOC (box, MERROR_FACE);
+  *box = *prop;
+  mplist_push (plist, Mt, box);
+  return box;
+}
+
+/** From FRAME->realized_face_list, find a realized face based on
+    FACE.  */
 
 static MRealizedFace *
-find_realized_face (MFrame *frame, MFace *face, MRealizedFont *rfont)
+find_realized_face (MFrame *frame, MFace *face)
 {
-  MPlist *rface_list;
-  MRealizedFace *rface;
-  int i;
+  MPlist *plist;
 
-  MPLIST_DO (rface_list, frame->realized_face_list)
+  MPLIST_DO (plist, frame->realized_face_list)
     {
-      rface = MPLIST_VAL (rface_list);
-      if (! rfont
-         || rface->rfont == rfont)
-       {
-         for (i = 0; i < MFACE_RATIO; i++)
-           if (rface->face.property[i] != face->property[i])
-             break;
-         if (i == MFACE_RATIO)
-           return rface;
-       }
+      MRealizedFace *rface = MPLIST_VAL (plist);
+
+      if (memcmp (rface->face.property, face->property, sizeof face->property)
+         == 0)
+       return rface;
     }
   return NULL;
 }
@@ -139,10 +189,7 @@ free_face (void *object)
 
   if (face->property[MFACE_FONTSET])
     M17N_OBJECT_UNREF (face->property[MFACE_FONTSET]);
-  if (face->property[MFACE_HLINE])
-    free (face->property[MFACE_HLINE]);
-  if (face->property[MFACE_BOX])
-    free (face->property[MFACE_BOX]);
+  M17N_OBJECT_UNREF (face->frame_list);
   M17N_OBJECT_UNREGISTER (face_table, face);
   free (object);
 }
@@ -151,32 +198,38 @@ free_face (void *object)
 static MPlist *
 serialize_hline (MPlist *plist, MFaceHLineProp *hline)
 {
-  MPlist *pl = mplist ();
+  if (hline->width > 0)
+    {
+      MPlist *pl = mplist ();
 
-  mplist_add (pl, Minteger, (void *) hline->type);
-  mplist_add (pl, Minteger, (void *) hline->width);
-  mplist_add (pl, Msymbol, hline->color);
-  plist = mplist_add (plist, Mplist, pl);
-  M17N_OBJECT_UNREF (pl);
+      mplist_add (pl, Minteger, (void *) hline->type);
+      mplist_add (pl, Minteger, (void *) hline->width);
+      mplist_add (pl, Msymbol, hline->color);
+      plist = mplist_add (plist, Mplist, pl);
+      M17N_OBJECT_UNREF (pl);
+    }
   return plist;
 }
 
 static MPlist *
 serialize_box (MPlist *plist, MFaceBoxProp *box)
 {
-  MPlist *pl = mplist ();
-
-  mplist_add (pl, Minteger, (void *) box->width);
-  mplist_add (pl, Minteger, (void *) box->inner_hmargin);
-  mplist_add (pl, Minteger, (void *) box->inner_vmargin);
-  mplist_add (pl, Minteger, (void *) box->outer_hmargin);
-  mplist_add (pl, Minteger, (void *) box->outer_vmargin);
-  mplist_add (pl, Msymbol, box->color_top);
-  mplist_add (pl, Msymbol, box->color_bottom);
-  mplist_add (pl, Msymbol, box->color_left);
-  mplist_add (pl, Msymbol, box->color_right);
-  plist = mplist_add (plist, Mplist, pl);
-  M17N_OBJECT_UNREF (pl);
+  if (box->width > 0)
+    {
+      MPlist *pl = mplist ();
+
+      mplist_add (pl, Minteger, (void *) box->width);
+      mplist_add (pl, Minteger, (void *) box->inner_hmargin);
+      mplist_add (pl, Minteger, (void *) box->inner_vmargin);
+      mplist_add (pl, Minteger, (void *) box->outer_hmargin);
+      mplist_add (pl, Minteger, (void *) box->outer_vmargin);
+      mplist_add (pl, Msymbol, box->color_top);
+      mplist_add (pl, Msymbol, box->color_bottom);
+      mplist_add (pl, Msymbol, box->color_left);
+      mplist_add (pl, Msymbol, box->color_right);
+      plist = mplist_add (plist, Mplist, pl);
+      M17N_OBJECT_UNREF (pl);
+    }
   return plist;
 }
 
@@ -361,6 +414,8 @@ int
 mface__init ()
 {
   int i;
+  MFaceHLineProp *hline;
+  MFaceBoxProp *box;
 
   face_table.count = 0;
   Mface = msymbol_as_managing_key ("face");
@@ -412,15 +467,28 @@ mface__init ()
                   (void *) (mface_prop_data[i].index + 1));
   }
 
+  hline_prop_list = mplist ();
+  MSTRUCT_CALLOC (hline, MERROR_FACE);
+  mplist_push (hline_prop_list, Mt, hline);
+  box_prop_list = mplist ();
+  MSTRUCT_CALLOC (box, MERROR_FACE);
+  mplist_push (box_prop_list, Mt, box);
+
   mface__default = mface ();
+  mface__default->property[MFACE_FOUNDRY] = msymbol ("misc");
+  mface__default->property[MFACE_FAMILY] = msymbol ("fixed");
   mface__default->property[MFACE_WEIGHT] = msymbol ("medium");
   mface__default->property[MFACE_STYLE] = msymbol ("r");
   mface__default->property[MFACE_STRETCH] = msymbol ("normal");
+  mface__default->property[MFACE_ADSTYLE] = msymbol ("");
   mface__default->property[MFACE_SIZE] = (void *) 120;
   mface__default->property[MFACE_FONTSET] = mfontset (NULL);
-  M17N_OBJECT_REF (mface__default->property[MFACE_FONTSET]);
-  /* mface__default->property[MFACE_FOREGROUND] =msymbol ("black"); */
-  /* mface__default->property[MFACE_BACKGROUND] =msymbol ("white"); */
+  mface__default->property[MFACE_FOREGROUND] = msymbol ("black");
+  mface__default->property[MFACE_BACKGROUND] = msymbol ("white");
+  mface__default->property[MFACE_HLINE] = hline;
+  mface__default->property[MFACE_BOX] = box;
+  mface__default->property[MFACE_VIDEOMODE] = Mnormal;
+  mface__default->property[MFACE_HOOK_FUNC] = (void *) noop_hook;
 
   mface_normal_video = mface ();
   mface_normal_video->property[MFACE_VIDEOMODE] = (void *) Mnormal;
@@ -429,14 +497,13 @@ mface__init ()
   mface_reverse_video->property[MFACE_VIDEOMODE] = (void *) Mreverse;
 
   {
-    MFaceHLineProp *hline_prop;
+    MFaceHLineProp hline_prop;
 
-    MSTRUCT_MALLOC (hline_prop, MERROR_FACE);
-    hline_prop->type = MFACE_HLINE_UNDER;
-    hline_prop->width = 1;
-    hline_prop->color = Mnil;
+    hline_prop.type = MFACE_HLINE_UNDER;
+    hline_prop.width = 1;
+    hline_prop.color = Mnil;
     mface_underline = mface ();
-    mface_underline->property[MFACE_HLINE] = (void *) hline_prop;
+    mface_put_prop (mface_underline, Mhline, &hline_prop);
   }
 
   mface_medium = mface ();
@@ -491,6 +558,8 @@ mface__init ()
 void
 mface__fini ()
 {
+  MPlist *plist;
+
   M17N_OBJECT_UNREF (mface__default);
   M17N_OBJECT_UNREF (mface_normal_video);
   M17N_OBJECT_UNREF (mface_reverse_video);
@@ -514,6 +583,14 @@ mface__fini ()
   M17N_OBJECT_UNREF (mface_cyan);
   M17N_OBJECT_UNREF (mface_yellow);
   M17N_OBJECT_UNREF (mface_magenta);
+
+  MPLIST_DO (plist, hline_prop_list)
+    free (MPLIST_VAL (plist));
+  M17N_OBJECT_UNREF (hline_prop_list);
+  MPLIST_DO (plist, box_prop_list)
+    free (MPLIST_VAL (plist));
+  M17N_OBJECT_UNREF (box_prop_list);
+
   free (work_gstring.glyphs);
 
   mdebug__report_object ("Face", &face_table);
@@ -523,18 +600,17 @@ mface__fini ()
     base faces pointed by FACES on the frame FRAME.  */
 
 MRealizedFace *
-mface__realize (MFrame *frame, MFace **faces, int num,
-               MSymbol language, MSymbol charset, int size)
+mface__realize (MFrame *frame, MFace **faces, int num, int size)
 {
   MRealizedFace *rface;
   MRealizedFont *rfont;
   MFace merged_face = *(frame->face);
   void **props;
   int i, j;
-  unsigned tick;
   MGlyph g;
+  MFaceHookFunc func;
 
-  if (num == 0 && language == Mnil && charset == Mnil && frame->rface)
+  if (num == 0 && frame->rface)
     return frame->rface;
 
   for (i = 0; i < MFACE_PROPERTY_MAX; i++)
@@ -545,8 +621,11 @@ mface__realize (MFrame *frame, MFace **faces, int num,
          break;
        }
 
-  for (i = 0, tick = 0; i < num; i++)
-    tick += faces[i]->tick;
+  if (! mplist_find_by_value (frame->face->frame_list, frame))
+    mplist_push (frame->face->frame_list, Mt, frame);
+  for (i = 0; i < num; i++)
+    if (! mplist_find_by_value (faces[i]->frame_list, frame))
+      mplist_push (faces[i]->frame_list, Mt, frame);
 
   if (merged_face.property[MFACE_RATIO])
     {
@@ -555,31 +634,31 @@ mface__realize (MFrame *frame, MFace **faces, int num,
       font_size *= (int) merged_face.property[MFACE_RATIO];
       font_size /= 100;
       merged_face.property[MFACE_SIZE] = (void *) font_size;
+      merged_face.property[MFACE_RATIO] = 0;
     }
 
-  rface = find_realized_face (frame, &merged_face, NULL);
-  if (rface && rface->tick == tick)
-    return rface->ascii_rface;
+  rface = find_realized_face (frame, &merged_face);
+  if (rface)
+    return rface;
 
   MSTRUCT_CALLOC (rface, MERROR_FACE);
+  mplist_push (frame->realized_face_list, Mt, rface);
   rface->frame = frame;
   rface->face = merged_face;
-  rface->tick = tick;
   props = rface->face.property;
-
   rface->rfontset = mfont__realize_fontset (frame,
                                            (MFontset *) props[MFACE_FONTSET],
                                            &merged_face);
+  g.type = GLYPH_SPACE;
   g.c = ' ';
   num = 1;
   rfont = mfont__lookup_fontset (rface->rfontset, &g, &num,
-                                msymbol ("latin"), language, Mnil,
-                                size);
-
+                                Mlatin, Mnil, Mnil, size);
   if (rfont)
     {
       rface->rfont = rfont;
       g.otf_encoded = 0;
+      work_gstring.frame = frame;
       work_gstring.glyphs[0] = g;
       work_gstring.glyphs[0].rface = rface;
       work_gstring.glyphs[1].code = MCHAR_INVALID_CODE;
@@ -596,20 +675,29 @@ mface__realize (MFrame *frame, MFace **faces, int num,
     }
 
   rface->hline = (MFaceHLineProp *) props[MFACE_HLINE];
+  if (rface->hline && rface->hline->width == 0)
+    rface->hline = NULL;
   rface->box = (MFaceBoxProp *) props[MFACE_BOX];
+  if (rface->box && rface->box->width == 0)
+    rface->box = NULL;
   rface->ascii_rface = rface;
-  mwin__realize_face (rface);
+  (*frame->driver->realize_face) (rface);
 
-  mplist_add (frame->realized_face_list, Mt, rface);
+  func = (MFaceHookFunc) rface->face.property[MFACE_HOOK_FUNC];
+  if (func && func != noop_hook)
+    (func) (&(rface->face), rface->info, rface->face.property[MFACE_HOOK_ARG]);
 
+  rface->non_ascii_list = mplist ();
   if (rface->rfont)
     {
-      MSTRUCT_CALLOC (rface->nofont_rface, MERROR_FACE);
-      *rface->nofont_rface = *rface;
-      rface->nofont_rface->rfont = NULL;
+      MRealizedFace *nofont;
+
+      MSTRUCT_CALLOC (nofont, MERROR_FACE);
+      *nofont = *rface;
+      nofont->non_ascii_list = NULL;
+      nofont->rfont = NULL;
+      mplist_add (rface->non_ascii_list, Mt, nofont);
     }
-  else
-    rface->nofont_rface = rface;
 
   return rface;
 }
@@ -619,56 +707,70 @@ MGlyph *
 mface__for_chars (MSymbol script, MSymbol language, MSymbol charset,
                  MGlyph *from_g, MGlyph *to_g, int size)
 {
-  MRealizedFace *rface;
   MRealizedFont *rfont;
-  int num = to_g - from_g, i;
+  int num = to_g - from_g;
 
   rfont = mfont__lookup_fontset (from_g->rface->rfontset, from_g, &num,
                                 script, language, charset, size);
   if (! rfont)
+    num = 1;
+  
+  to_g = from_g + num;
+  while (from_g < to_g)
     {
-      from_g->rface = from_g->rface->nofont_rface;
-      return (from_g + 1);
-    }
-  rface = find_realized_face (from_g->rface->frame, &(from_g->rface->face),
-                             rfont);
-  if (! rface)
-    {
-      MSTRUCT_MALLOC (rface, MERROR_FACE);
-      *rface = *from_g->rface->ascii_rface;
-      rface->rfont = rfont;
-      {
-       work_gstring.glyphs[0].code = MCHAR_INVALID_CODE;
-       work_gstring.glyphs[0].rface = rface;
-       mfont__get_metric (&work_gstring, 0, 1);
-       rface->ascent = work_gstring.glyphs[0].ascent;
-       rface->descent = work_gstring.glyphs[0].descent;
-      }
-      mwin__realize_face (rface);
-      mplist_add (from_g->rface->frame->realized_face_list, Mt, rface);
-    }
+      MGlyph *g = from_g;
+      MRealizedFace *rface = from_g++->rface;
 
-  for (i = 0; i < num; i++, from_g++)
-    from_g->rface = rface;
-  return from_g;
+      while (from_g < to_g && rface == from_g->rface) from_g++;
+      if (rface->rfont != rfont)
+       {
+         MPlist *plist = mplist_find_by_value (rface->non_ascii_list, rfont);
+         MRealizedFace *new;
+
+         if (plist)
+           new = MPLIST_VAL (plist);
+         else
+           {
+             MSTRUCT_MALLOC (new, MERROR_FACE);
+             mplist_push (rface->non_ascii_list, Mt, new);
+             *new = *rface;
+             new->rfont = rfont;
+             new->non_ascii_list = NULL;
+             if (rfont)
+               {
+                 new->ascent = rfont->ascent;
+                 new->descent = rfont->descent;
+               }
+           }
+         while (g < from_g)
+           g++->rface = new;
+       }
+    }
+  return to_g;
 }
 
 
 void
 mface__free_realized (MRealizedFace *rface)
 {
-  mwin__free_realized_face (rface);
-  if (rface == rface->ascii_rface)
-    {
-      if (! rface->nofont_rface)
-       mdebug_hook ();
-      else
-       free (rface->nofont_rface);
-      rface->nofont_rface = NULL;
-    }
+  MPlist *plist;
+
+  MPLIST_DO (plist, rface->non_ascii_list)
+    free (MPLIST_VAL (plist));
+  M17N_OBJECT_UNREF (rface->non_ascii_list);
   free (rface);
 }
 
+void
+mface__update_frame_face (MFrame *frame)
+{
+  frame->rface = NULL;
+  frame->rface = mface__realize (frame, NULL, 0, 0);
+  frame->space_width = frame->rface->space_width;
+  frame->ascent = frame->rface->ascent;
+  frame->descent = frame->rface->descent;
+}
+
 /*** @} */
 #endif /* !FOR_DOXYGEN || DOXYGEN_INTERNAL_MODULE */
 
@@ -684,7 +786,7 @@ mface__free_realized (MRealizedFace *rface)
 /*=*/
 
 /***en
-    @brief Key of a face property specifying foreground color
+    @brief Key of a face property specifying foreground color.
 
     The variable #Mforeground is used as a key of face property.  The
     property value must be a symbol whose name is a color name, or
@@ -695,18 +797,18 @@ mface__free_realized (MRealizedFace *rface)
     color.  */
 
 /***ja
-    @brief Á°·Ê¿§¤ò»ØÄꤹ¤ë¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥­¡¼
+    @brief Á°·Ê¿§¤ò»ØÄꤹ¤ë¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥­¡¼.
 
     ÊÑ¿ô #Mforeground ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥­¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£
     ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢¿§Ì¾¤ò̾Á°¤È¤·¤Æ»ý¤Ä¥·¥ó¥Ü¥ë¤« #Mnil ¤Ç¤¢¤ë¡£
 
-    #Mnil ¤Î¾ì¹ç¡¢Á°·Ê¿§¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤ì¤Ê¤±¤ì¤Ð M-text ¤ÎÁ°·Ê¤Ï
+    #Mnil ¤Î¾ì¹ç¡¢Á°·Ê¿§¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð M-text ¤ÎÁ°·Ê¤Ï
     »ØÄꤵ¤ì¤¿¿§¤Çɽ¼¨¤µ¤ì¤ë¡£  */
 
 MSymbol Mforeground;
 
 /***en
-    @brief Key of a face property specifying background color
+    @brief Key of a face property specifying background color.
 
     The variable #Mbackground is used as a key of face property.  The
     property value must be a symbol whose name is a color name, or
@@ -717,18 +819,18 @@ MSymbol Mforeground;
     color.  */
 
 /***ja
-    @brief ÇØ·Ê¿§¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥­¡¼
+    @brief ÇØ·Ê¿§¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥­¡¼.
 
     ÊÑ¿ô #Mbackground ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥­¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£
     ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢¿§Ì¾¤ò̾Á°¤È¤·¤Æ»ý¤Ä¥·¥ó¥Ü¥ë¤« #Mnil ¤Ç¤¢¤ë¡£
 
-    #Mnil ¤Î¾ì¹ç¡¢ÇØ·Ê¿§¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤ì¤Ê¤±¤ì¤Ð M-text ¤ÎÇطʤÏ
+    #Mnil ¤Î¾ì¹ç¡¢ÇØ·Ê¿§¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð M-text ¤ÎÇطʤÏ
     »ØÄꤵ¤ì¤¿¿§¤Çɽ¼¨¤µ¤ì¤ë¡£  */
 
 MSymbol Mbackground;
 
 /***en
-    @brief Key of a face property specifying video mode
+    @brief Key of a face property specifying video mode.
 
     The variable #Mvideomode is used as a key of face property.  The
     property value must be #Mnormal, #Mreverse, or #Mnil.
@@ -744,7 +846,7 @@ MSymbol Mbackground;
     #Mnil means that the face does not specify a video mode.  */
 
 /***ja
-    @brief ¥Ó¥Ç¥ª¥â¡¼¥É¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥­¡¼
+    @brief ¥Ó¥Ç¥ª¥â¡¼¥É¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥­¡¼.
 
     ÊÑ¿ô #Mvideomode ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥­¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£
     ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢#Mnormal, #Mreverse, #Mnil ¤Î¤¤¤º¤ì¤«¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
@@ -761,7 +863,7 @@ MSymbol Mbackground;
 MSymbol Mvideomode;
 
 /***en
-    @brief Key of a face property specifying font size ratio
+    @brief Key of a face property specifying font size ratio.
 
     The variable #Mratio is used as a key of face property.  The value
     RATIO must be an integer.
@@ -771,7 +873,7 @@ MSymbol Mvideomode;
     * RATIO / 100) where FONTSIZE is a font size specified by the face
     property #Msize.  */
 /***ja
-    @brief ¥µ¥¤¥º¤ÎÈæΨ¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥­¡¼
+    @brief ¥Õ¥©¥ó¥È¤Î¥µ¥¤¥º¤ÎÈæΨ¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥­¡¼.
 
     ÊÑ¿ô #Mratio ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥­¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃÍ RATIO 
     ¤ÏÀ°¿ôÃͤǤʤ¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
@@ -784,7 +886,7 @@ MSymbol Mvideomode;
 MSymbol Mratio;
 
 /***en
-    @brief Key of a face property specifying horizontal line
+    @brief Key of a face property specifying horizontal line.
 
     The variable #Mhline is used as a key of face property.  The value
     must be a pointer to an object of type #MFaceHLineProp, or @c
@@ -795,20 +897,20 @@ MSymbol Mratio;
     a way specified by the object that the value points to.  */
 
 /***ja
-    @brief ¿åÊ¿Àþ¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥­¡¼
+    @brief ¿åÊ¿Àþ¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥­¡¼.
 
     ÊÑ¿ô #Mhline ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥­¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃͤϠ
     #MFaceHLineProp ·¿¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤« @c NULL ¤Ç¤Ê¤¯¤Æ¤Ï¤Ê
     ¤é¤Ê¤¤¡£
 
-    Ãͤ¬ @c NULL ¤Ê¤é¤Ð¡¢¤³¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤±¤ì¤ÐÃÍ
+    Ãͤ¬ @c NULL ¤Ê¤é¤Ð¡¢¤³¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤Ê¤±¤ì¤ÐÃÍ
    ¤¬»Ø¤¹¥ª¥Ö¥¸¥§¥¯¥È¤Ë»ØÄꤵ¤ì¤¿¤è¤¦¤Ë¿åÊ¿Àþ¤òÉղ䷤ƠM-text ¤òɽ¼¨
    ¤¹¤ë¡£*/
 
 MSymbol Mhline;
 
 /***en
-    @brief Key of a face property specifying box
+    @brief Key of a face property specifying box.
 
     The variable #Mbox is used as a key of face property.  The value
     must be a pointer to an object of type #MFaceBoxProp, or @c NULL.
@@ -818,20 +920,20 @@ MSymbol Mhline;
     specified by the object that the value points to.  */
 
 /***ja
-    @brief °Ï¤ßÏȤò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥­¡¼
+    @brief °Ï¤ßÏȤò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥­¡¼.
 
     ÊÑ¿ô #Mbox ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥­¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃͤϠ
     #MFaceBoxProp ·¿¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤« @c NULL ¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é
     ¤Ê¤¤¡£
 
-    Ãͤ¬ @c NULL ¤Ê¤é¤Ð¡¢¤³¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤±¤ì¤ÐÃÍ
+    Ãͤ¬ @c NULL ¤Ê¤é¤Ð¡¢¤³¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤Ê¤±¤ì¤ÐÃÍ
     ¤¬»Ø¤¹¥ª¥Ö¥¸¥§¥¯¥È¤Ë»ØÄꤵ¤ì¤¿¤è¤¦¤Ë°Ï¤ßÏȤòÉղ䷤ƠM-text ¤òɽ¼¨
     ¤¹¤ë¡£*/
 
 MSymbol Mbox;
 
 /***en
-    @brief Key of a face property specifying fontset 
+    @brief Key of a face property specifying fontset.
 
     The variable #Mfontset is used as a key of face property.  The
     value must be a pointer to an object of type #Mfontset, or @c
@@ -842,19 +944,19 @@ MSymbol Mbox;
     specified in the fontset.  */
 
 /***ja
-    @brief ¥Õ¥©¥ó¥È¥»¥Ã¥È¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥­¡¼
+    @brief ¥Õ¥©¥ó¥È¥»¥Ã¥È¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥­¡¼.
 
     ÊÑ¿ô #Mfontset ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥­¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃͤϠ
     #Mfontset ·¿¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤« @c NULL ¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
 
-    Ãͤ¬ @c NULL ¤Ê¤é¤Ð¡¢¥Õ¥©¥ó¥È¥»¥Ã¥È¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤±¤ì¤ÐÃÍ
+    Ãͤ¬ @c NULL ¤Ê¤é¤Ð¡¢¥Õ¥©¥ó¥È¥»¥Ã¥È¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤Ê¤±¤ì¤ÐÃÍ
     ¤¬»Ø¤¹¥ª¥Ö¥¸¥§¥¯¥È¤Ë»ØÄꤵ¤ì¤¿¥Õ¥©¥ó¥È¥»¥Ã¥È¤«¤éÁª¤ó¤À¥Õ¥©¥ó¥È¤Ç 
     M-text ¤òɽ¼¨¤¹¤ë¡£*/
     
 MSymbol Mfontset;
 
 /***en
-    @brief Key of a face property specifying hook
+    @brief Key of a face property specifying hook.
 
     The variable #Mhook_func is used as a key of face property.  The
     value must be a function of type #MFaceHookFunc, or @c NULL.
@@ -863,23 +965,23 @@ MSymbol Mfontset;
     Otherwise, the specified function is called before the face is
     realized.  */
 /***ja
-    @brief ¥Õ¥Ã¥¯¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥­¡¼
+    @brief ¥Õ¥Ã¥¯¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥­¡¼.
 
     ÊÑ¿ô #Mhook_func ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥­¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃͤϠ
     #MFaceHookFunc ·¿¤Î´Ø¿ô¤« @c NULL ¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
 
-    Ãͤ¬ @c NULL ¤Ê¤é¤Ð¡¢¥Õ¥Ã¥¯¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤±¤ì¤Ð¥Õ¥§¡¼¥¹¤ò
+    Ãͤ¬ @c NULL ¤Ê¤é¤Ð¡¢¥Õ¥Ã¥¯¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¥Õ¥§¡¼¥¹¤ò
     ¼Â¸½¤¹¤ëÁ°¤Ë»ØÄꤷ¤¿´Ø¿ô¤¬¸Æ¤Ð¤ì¤ë¡£      */
 MSymbol Mhook_func;
 
 /***en
-    @brief Key of a face property specifying argument of hook
+    @brief Key of a face property specifying argument of hook.
 
     The variable #Mhook_arg is used as a key of face property.  The
     value can be anything that is passed a hook function specified by
     the face property #Mhook_func.  */
 /***ja
-    @brief ¥Õ¥Ã¥¯¤Î°ú¿ô¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥­¡¼
+    @brief ¥Õ¥Ã¥¯¤Î°ú¿ô¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥­¡¼.
 
     ÊÑ¿ô #Mhook_arg ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥­¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃͤϠ
     ²¿¤Ç¤â¤è¤¯¡¢¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£ #Mhook_func ¤Ç»ØÄꤵ¤ì¤ë´Ø¿ô¤ËÅϤµ
@@ -911,15 +1013,15 @@ MSymbol Mreverse;
 /*=*/
 
 /***en
-    @brief Normal video face
+    @brief Normal video face.
 
     The variable #mface_normal_video points to a face that has the
     #Mvideomode property with value #Mnormal.  The other properties
     are not specified.  An M-text drawn with this face appear normal
     colors (i.e. the foreground is drawn by foreground color, and
     background is drawn by background color).  */
-/***en
-    @brief É¸½à¥Ó¥Ç¥ª¥Õ¥§¡¼¥¹
+/***ja
+    @brief É¸½à¥Ó¥Ç¥ª¥Õ¥§¡¼¥¹.
 
     ÊÑ¿ô #mface_normal_video ¤Ï #Mvideomode ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ #Mnormal 
     ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
@@ -929,7 +1031,7 @@ MSymbol Mreverse;
 MFace *mface_normal_video;
 
 /***en
-    @brief Reverse video face
+    @brief Reverse video face.
 
     The variable #mface_reverse_video points to a face that has the
     #Mvideomode property with value #Mreverse.  The other properties
@@ -937,7 +1039,7 @@ MFace *mface_normal_video;
     reversed colors (i.e. the foreground is drawn by background
     color, and background is drawn by foreground color).  */
 /***ja
-    @brief ¥ê¥Ð¡¼¥¹¥Ó¥Ç¥ª¥Õ¥§¡¼¥¹
+    @brief ¥ê¥Ð¡¼¥¹¥Ó¥Ç¥ª¥Õ¥§¡¼¥¹.
 
     ÊÑ¿ô #mface_reverse_video ¤Ï #Mvideomode ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 
     #Mreverse ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄê
@@ -947,7 +1049,7 @@ MFace *mface_normal_video;
 MFace *mface_reverse_video;
 
 /***en
-    @brief Underline face
+    @brief Underline face.
 
     The variable #mface_underline points to a face that has the
     #Mhline property with value a pointer to an object of type
@@ -964,7 +1066,7 @@ MFace *mface_reverse_video;
     The other properties are not specified.  An M-text that has this
     face is drawn with an underline.  */ 
 /***ja
-    @brief ²¼Àþ¥Õ¥§¡¼¥¹
+    @brief ²¼Àþ¥Õ¥§¡¼¥¹.
 
     ÊÑ¿ô #mface_underline ¤Ï #Mhline ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ #MFaceHLineProp 
     ·¿¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£¥ª¥Ö
@@ -984,14 +1086,14 @@ MFace *mface_reverse_video;
 MFace *mface_underline;
 
 /***en
-    @brief Medium face
+    @brief Medium face.
 
     The variable #mface_medium points to a face that has the #Mweight
     property with value a symbol of name "medium".  The other
     properties are not specified.  An M-text that has this face is
     drawn with a font of medium weight.  */
 /***ja
-    @brief ¥ß¥Ç¥£¥¢¥à¥Õ¥§¡¼¥¹
+    @brief ¥ß¥Ç¥£¥¢¥à¥Õ¥§¡¼¥¹.
 
     ÊÑ¿ô #mface_medium ¤Ï #Mweight ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "medium" ¤È¤¤¤¦Ì¾
     Á°¤ò¤â¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í
@@ -1000,7 +1102,7 @@ MFace *mface_underline;
 MFace *mface_medium;
 
 /***en
-    @brief Bold face
+    @brief Bold face.
 
     The variable #mface_bold points to a face that has the #Mweight
     property with value a symbol of name "bold".  The other properties
@@ -1008,7 +1110,7 @@ MFace *mface_medium;
     font of bold weight.  */
 
 /***ja
-    @brief ¥Ü¡¼¥ë¥É¥Õ¥§¡¼¥¹
+    @brief ¥Ü¡¼¥ë¥É¥Õ¥§¡¼¥¹.
 
     ÊÑ¿ô #mface_bold ¤Ï #Mweight ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "bold" ¤È¤¤¤¦Ì¾Á°¤ò
     ¤â¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£
@@ -1019,7 +1121,7 @@ MFace *mface_medium;
 MFace *mface_bold;
 
 /***en
-    @brief Italic face
+    @brief Italic face.
 
     The variable #mface_italic points to a face that has the #Mstyle
     property with value a symbol of name "italic".  The other
@@ -1027,7 +1129,7 @@ MFace *mface_bold;
     drawn with a font of italic style.  */
 
 /***ja
-    @brief ¥¤¥¿¥ê¥Ã¥¯¥Õ¥§¡¼¥¹
+    @brief ¥¤¥¿¥ê¥Ã¥¯¥Õ¥§¡¼¥¹.
 
     ÊÑ¿ô #mface_italic ¤Ï #Mstyle ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "italic" ¤È¤¤¤¦Ì¾Á°
     ¤ò¤â¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ
@@ -1038,7 +1140,7 @@ MFace *mface_bold;
 MFace *mface_italic;
 
 /***en
-    @brief Bold italic face
+    @brief Bold italic face.
 
     The variable #mface_bold_italic points to a face that has the
     #Mweight property with value a symbol of name "bold", and #Mstyle
@@ -1047,7 +1149,7 @@ MFace *mface_italic;
     drawn with a font of bold weight and italic style.  */
 
 /***ja
-    @brief ¥Ü¡¼¥ë¥É¥¤¥¿¥ê¥Ã¥¯¥Õ¥§¡¼¥¹
+    @brief ¥Ü¡¼¥ë¥É¥¤¥¿¥ê¥Ã¥¯¥Õ¥§¡¼¥¹.
 
     ÊÑ¿ô #mface_bold_italic ¤Ï¡¢#Mweight ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "bold" ¤È¤¤
     ¤¦Ì¾Á°¤ò¤â¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ê¡¢¤«¤Ä #Mstyle ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "italic" 
@@ -1059,7 +1161,7 @@ MFace *mface_italic;
 MFace *mface_bold_italic;
 
 /***en
-    @brief Smallest face
+    @brief Smallest face.
 
     The variable #mface_xx_small points to a face that has the #Mratio
     property with value 50.  The other properties are not specified.
@@ -1067,7 +1169,7 @@ MFace *mface_bold_italic;
     50% of a normal font.  */
 
 /***ja
-    @brief ºÇ¾®¤Î¥Õ¥§¡¼¥¹
+    @brief ºÇ¾®¤Î¥Õ¥§¡¼¥¹.
 
     ÊÑ¿ô #mface_xx_small ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 50 ¤Ç¤¢¤ë¥Õ¥§¡¼
     ¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹
@@ -1077,7 +1179,7 @@ MFace *mface_bold_italic;
 MFace *mface_xx_small;
 
 /***en
-    @brief Smaller face
+    @brief Smaller face.
 
     The variable #mface_x_small points to a face that has the #Mratio
     property with value 66.  The other properties are not specified.
@@ -1085,7 +1187,7 @@ MFace *mface_xx_small;
     66% of a normal font.  */
 
 /***ja
-    @brief ¤â¤Ã¤È¾®¤µ¤¤¥Õ¥§¡¼¥¹
+    @brief ¤â¤Ã¤È¾®¤µ¤¤¥Õ¥§¡¼¥¹.
 
     ÊÑ¿ô #mface_x_small ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 66 ¤Ç¤¢¤ë¥Õ¥§¡¼
     ¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹
@@ -1095,7 +1197,7 @@ MFace *mface_xx_small;
 MFace *mface_x_small;
 
 /***en
-    @brief Small face
+    @brief Small face.
 
     The variable #mface_x_small points to a face that has the #Mratio
     property with value 75.  The other properties are not specified.
@@ -1103,7 +1205,7 @@ MFace *mface_x_small;
     75% of a normal font.  */
 
 /***ja
-    @brief ¾®¤µ¤¤¥Õ¥§¡¼¥¹
+    @brief ¾®¤µ¤¤¥Õ¥§¡¼¥¹.
 
     ÊÑ¿ô #mface_small ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 75 ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò
     »Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý
@@ -1113,7 +1215,7 @@ MFace *mface_x_small;
 MFace *mface_small;
 
 /***en
-    @brief Normalsize face
+    @brief Normalsize face.
 
     The variable #mface_normalsize points to a face that has the
     #Mratio property with value 100.  The other properties are not
@@ -1121,7 +1223,7 @@ MFace *mface_small;
     whose size is the same as a normal font.  */
 
 /***ja
-    @brief É¸½à¤ÎÂ礭¤µ¤Î¥Õ¥§¡¼¥¹
+    @brief É¸½à¤ÎÂ礭¤µ¤Î¥Õ¥§¡¼¥¹.
 
     ÊÑ¿ô #mface_normalsize ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 100 ¤Ç¤¢¤ë¥Õ¥§¡¼
     ¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹
@@ -1131,7 +1233,7 @@ MFace *mface_small;
 MFace *mface_normalsize;
 
 /***en
-    @brief Large face
+    @brief Large face.
 
     The variable #mface_large points to a face that has the #Mratio
     property with value 120.  The other properties are not specified.
@@ -1139,7 +1241,7 @@ MFace *mface_normalsize;
     120% of a normal font.  */
 
 /***ja
-    @brief Â礭¤¤¥Õ¥§¡¼¥¹
+    @brief Â礭¤¤¥Õ¥§¡¼¥¹.
 
     ÊÑ¿ô #mface_large ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 120 ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹
     ¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò
@@ -1149,7 +1251,7 @@ MFace *mface_normalsize;
 MFace *mface_large;
 
 /***en
-    @brief Larger face
+    @brief Larger face.
 
     The variable #mface_x_large points to a face that has the #Mratio
     property with value 150.  The other properties are not specified.
@@ -1157,7 +1259,7 @@ MFace *mface_large;
     150% of a normal font.  */
 
 /***ja
-    @brief ¤â¤Ã¤ÈÂ礭¤¤¥Õ¥§¡¼¥¹
+    @brief ¤â¤Ã¤ÈÂ礭¤¤¥Õ¥§¡¼¥¹.
 
     ÊÑ¿ô #mface_x_large ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 150 ¤Ç¤¢¤ë¥Õ¥§¡¼
     ¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹
@@ -1167,7 +1269,7 @@ MFace *mface_large;
 MFace *mface_x_large;
 
 /***en
-    @brief Largest face
+    @brief Largest face.
 
     The variable #mface_xx_large points to a face that has the #Mratio
     property with value 200.  The other properties are not specified.
@@ -1175,7 +1277,7 @@ MFace *mface_x_large;
     200% of a normal font.  */
 
 /***ja
-    @brief ºÇÂç¤Î¥Õ¥§¡¼¥¹
+    @brief ºÇÂç¤Î¥Õ¥§¡¼¥¹.
 
     ÊÑ¿ô #mface_xx_large ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 200 ¤Ç¤¢¤ë¥Õ¥§¡¼
     ¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹
@@ -1185,14 +1287,15 @@ MFace *mface_x_large;
 MFace *mface_xx_large;
 
 /***en
-    @brief Black face
+    @brief Black face.
 
     The variable #mface_black points to a face that has the
     #Mforeground property with value a symbol of name "black".  The
     other properties are not specified.  An M-text that has this face
     is drawn with black foreground.  */
 
-/***ja @brief ¹õ¥Õ¥§¡¼¥¹
+/***ja 
+    @brief ¹õ¥Õ¥§¡¼¥¹.
 
     ÊÑ¿ô #mface_black ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "black" ¤È
     ¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×
@@ -1202,7 +1305,7 @@ MFace *mface_xx_large;
 MFace *mface_black;
 
 /***en
-    @brief White face
+    @brief White face.
 
     The variable #mface_white points to a face that has the
     #Mforeground property with value a symbol of name "white".  The
@@ -1210,7 +1313,7 @@ MFace *mface_black;
     is drawn with white foreground.  */
 
 /***ja
-    @brief Çò¥Õ¥§¡¼¥¹
+    @brief Çò¥Õ¥§¡¼¥¹.
 
     ÊÑ¿ô #mface_white ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "white" ¤È
     ¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×
@@ -1220,7 +1323,7 @@ MFace *mface_black;
 MFace *mface_white;
 
 /***en
-    @brief Red face
+    @brief Red face.
 
     The variable #mface_red points to a face that has the
     #Mforeground property with value a symbol of name "red".  The
@@ -1228,7 +1331,7 @@ MFace *mface_white;
     is drawn with red foreground.  */
 
 /***ja
-    @brief ÀÖ¥Õ¥§¡¼¥¹
+    @brief ÀÖ¥Õ¥§¡¼¥¹.
 
     ÊÑ¿ô #mface_red ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "red" ¤È¤¤¤¦
     Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ
@@ -1238,7 +1341,7 @@ MFace *mface_white;
 MFace *mface_red;
 
 /***en
-    @brief Green face
+    @brief Green face.
 
     The variable #mface_green points to a face that has the
     #Mforeground property with value a symbol of name "green".  The
@@ -1246,7 +1349,7 @@ MFace *mface_red;
     is drawn with green foreground.  */
 
 /***ja
-    @brief ÎÐ¥Õ¥§¡¼¥¹
+    @brief ÎÐ¥Õ¥§¡¼¥¹.
 
     ÊÑ¿ô #mface_green ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "green" ¤È
     ¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×
@@ -1256,7 +1359,7 @@ MFace *mface_red;
 MFace *mface_green;
 
 /***en
-    @brief Blue face
+    @brief Blue face.
 
     The variable #mface_blue points to a face that has the
     #Mforeground property with value a symbol of name "blue".  The
@@ -1264,7 +1367,7 @@ MFace *mface_green;
     is drawn with blue foreground.  */
 
 /***ja
-    @brief ÀÄ¥Õ¥§¡¼¥¹
+    @brief ÀÄ¥Õ¥§¡¼¥¹.
 
     ÊÑ¿ô #mface_blue ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "blue" ¤È¤¤
     ¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í
@@ -1274,7 +1377,7 @@ MFace *mface_green;
 MFace *mface_blue;
 
 /***en
-    @brief Cyan face
+    @brief Cyan face.
 
     The variable #mface_cyan points to a face that has the
     #Mforeground property with value a symbol of name "cyan".  The
@@ -1282,7 +1385,7 @@ MFace *mface_blue;
     is drawn with cyan foreground.  */
 
 /***ja
-    @brief ¥·¥¢¥ó¥Õ¥§¡¼¥¹
+    @brief ¥·¥¢¥ó¥Õ¥§¡¼¥¹.
 
     ÊÑ¿ô #mface_cyan ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "cyan" ¤È¤¤
     ¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í
@@ -1292,7 +1395,7 @@ MFace *mface_blue;
 MFace *mface_cyan;
 
 /***en
-    @brief yellow face
+    @brief yellow face.
 
     The variable #mface_yellow points to a face that has the
     #Mforeground property with value a symbol of name "yellow".  The
@@ -1300,7 +1403,7 @@ MFace *mface_cyan;
     is drawn with yellow foreground.  */
 
 /***ja
-    @brief ²«¥Õ¥§¡¼¥¹
+    @brief ²«¥Õ¥§¡¼¥¹.
 
     ÊÑ¿ô #mface_yellow ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "yellow" 
     ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î
@@ -1310,7 +1413,7 @@ MFace *mface_cyan;
 MFace *mface_yellow;
 
 /***en
-    @brief Magenta face
+    @brief Magenta face.
 
     The variable #mface_magenta points to a face that has the
     #Mforeground property with value a symbol of name "magenta".  The
@@ -1318,7 +1421,7 @@ MFace *mface_yellow;
     is drawn with magenta foreground.  */
 
 /***ja
-    @brief ¥Þ¥¼¥ó¥¿¥Õ¥§¡¼¥¹
+    @brief ¥Þ¥¼¥ó¥¿¥Õ¥§¡¼¥¹.
 
     ÊÑ¿ô #mface_magenta ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ 
     "magenta" ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç
@@ -1339,11 +1442,13 @@ MFace *mface_magenta;
     @brief Key of a text property specifying a face.
 
     The variable #Mface is a symbol of name <tt>"face"</tt>.  A text
-    property whose key is this symbol must have a pointer to an object
-    of type #MFace.  This is a managing key.  */
+    property whose key is
+    this symbol must have a pointer to an object
+    of type #MFace
+.  This is a managing key.  */
 
 /***ja
-    @brief ¥Õ¥§¡¼¥¹¤ò»ØÄꤹ¤ë¥Æ¥­¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Î¥­¡¼
+    @brief ¥Õ¥§¡¼¥¹¤ò»ØÄꤹ¤ë¥Æ¥­¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Î¥­¡¼.
 
     ÊÑ¿ô #Mface ¤Ï <tt>"face"</tt> ¤È¤¤¤¦Ì¾Á°¤ò»ý¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¡£¤³
     ¤Î¥·¥ó¥Ü¥ë¤ò¥­¡¼¤È¤¹¤ë¥Æ¥­¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Ï¡¢#MFace ·¿¤Î¥ª¥Ö¥¸¥§¥¯
@@ -1364,7 +1469,7 @@ MSymbol Mface;
     This function returns a pointer to the created face.  */
 
 /***ja
-    @brief ¿·¤·¤¤¥Õ¥§¡¼¥¹¤ò¤Ä¤¯¤ë 
+    @brief ¿·¤·¤¤¥Õ¥§¡¼¥¹¤ò¤Ä¤¯¤ë.
 
     ´Ø¿ô mface () ¤Ï¥×¥í¥Ñ¥Æ¥£¤ò°ìÀÚ»ý¤¿¤Ê¤¤¿·¤·¤¤¥Õ¥§¡¼¥¹¥ª¥Ö¥¸¥§¥¯¥È
     ¤òºî¤ë¡£
@@ -1378,6 +1483,7 @@ mface ()
   MFace *face;
 
   M17N_OBJECT (face, free_face, MERROR_FACE);
+  face->frame_list = mplist ();
   M17N_OBJECT_REGISTER (face_table, face);
   return face;
 }
@@ -1405,25 +1511,9 @@ mface_copy (MFace *face)
   *copy = *face;
   copy->control.ref_count = 1;
   M17N_OBJECT_REGISTER (face_table, copy);
+  copy->frame_list = mplist ();
   if (copy->property[MFACE_FONTSET])
     M17N_OBJECT_REF (copy->property[MFACE_FONTSET]);
-  if (copy->property[MFACE_HLINE])
-    {
-      MFaceHLineProp *val;
-
-      MSTRUCT_MALLOC (val, MERROR_FACE); 
-      *val = *((MFaceHLineProp *) copy->property[MFACE_HLINE]);
-      copy->property[MFACE_HLINE] = val;
-    }
-  if (copy->property[MFACE_BOX])
-    {
-      MFaceBoxProp *val;
-
-      MSTRUCT_MALLOC (val, MERROR_FACE); 
-      *val = *((MFaceBoxProp *) copy->property[MFACE_BOX]);
-      copy->property[MFACE_BOX] = val;
-    }
-
   return copy;
 }
 
@@ -1450,30 +1540,28 @@ MFace *
 mface_merge (MFace *dst, MFace *src)
 {
   int i;
+  MPlist *plist;
 
   for (i = 0; i < MFACE_PROPERTY_MAX; i++)
     if (src->property[i])
       {
-       dst->property[i] = src->property[i];
        if (i == MFACE_FONTSET)
-         M17N_OBJECT_REF (dst->property[i]);
-       else if (i == MFACE_HLINE)
-         {
-           MFaceHLineProp *val;
-
-           MSTRUCT_MALLOC (val, MERROR_FACE); 
-           *val = *((MFaceHLineProp *) dst->property[MFACE_HLINE]);
-           dst->property[MFACE_HLINE] = val;
-         }
-       else if (i == MFACE_BOX)
          {
-           MFaceBoxProp *val;
-
-           MSTRUCT_MALLOC (val, MERROR_FACE); 
-           *val = *((MFaceBoxProp *) dst->property[MFACE_BOX]);
-           dst->property[MFACE_BOX] = val;
+           M17N_OBJECT_UNREF (dst->property[i]);
+           M17N_OBJECT_REF (src->property[i]);
          }
+       dst->property[i] = src->property[i];
       }
+
+  MPLIST_DO (plist, dst->frame_list)
+    {
+      MFrame *frame = MPLIST_VAL (plist);
+
+      frame->tick++;
+      if (dst == frame->face)
+       mface__update_frame_face (frame);
+    }
+
   return dst;
 }
 
@@ -1526,7 +1614,7 @@ mface_from_font (MFont *font)
     #merror_code.  */
 
 /***ja
-    @brief ¥Õ¥§¡¼¥¹¤Î¥×¥í¥Ñ¥Æ¥£¤ÎÃͤòÆÀ¤ë
+    @brief ¥Õ¥§¡¼¥¹¤Î¥×¥í¥Ñ¥Æ¥£¤ÎÃͤòÆÀ¤ë.
 
     ´Ø¿ô mface_get_prop () ¤Ï¡¢¥Õ¥§¡¼¥¹ $FACE ¤¬»ý¤Ä¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£
     ¤ÎÆâ¡¢¥­¡¼¤¬ $KEY ¤Ç¤¢¤ë¤â¤Î¤ÎÃͤòÊÖ¤¹¡£$KEY ¤Ï²¼µ­¤Î¤¤¤º¤ì¤«¤Ç¤Ê
@@ -1578,12 +1666,12 @@ mface_get_prop (MFace *face, MSymbol key)
     documentation of the above keys.
 
     @return
-    If the operation was successful, mface_put_prop returns () 0.
+    If the operation was successful, mface_put_prop () returns 0.
     Otherwise it returns -1 and assigns an error code to the external
     variable #merror_code.  */
 
 /***ja
-    @brief ¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤòÀßÄꤹ¤ë
+    @brief ¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤòÀßÄꤹ¤ë.
 
     ´Ø¿ô mface_put_prop () ¤Ï¡¢¥Õ¥§¡¼¥¹ $FACE Æâ¤Ç¥­¡¼¤¬ $KEY ¤Ç¤¢¤ë¥×
     ¥í¥Ñ¥Æ¥£¤ÎÃͤò $VAL ¤ËÀßÄꤹ¤ë¡£$KEY ¤Ï°Ê²¼¤Î¤¤¤º¤ì¤«¤Ç¤Ê¤¯¤Æ¤Ï¤Ê
@@ -1614,29 +1702,33 @@ int
 mface_put_prop (MFace *face, MSymbol key, void *val)
 {
   int index = (int) msymbol_get (key, M_face_prop_index) - 1;
+  MPlist *plist;
 
   if (index < 0)
     MERROR (MERROR_FACE, -1);
   if (key == Mfontset)
-    M17N_OBJECT_REF (val);
-  else if (key == Mhline)
     {
-      MFaceHLineProp *newval;
-
-      MSTRUCT_MALLOC (newval, MERROR_FACE);
-      *newval = *((MFaceHLineProp *) val);
-      val = newval;
+      if (face->property[index])
+       M17N_OBJECT_UNREF (face->property[index]);
+      M17N_OBJECT_REF (val);
     }
+  else if (key == Mhline)
+    val = get_hline_create (val);
   else if (key == Mbox)
+    val = get_box_create (val);
+
+  if (face->property[index] == val)
+    return 0;
+  face->property[index] = val;
+
+  MPLIST_DO (plist, face->frame_list)
     {
-      MFaceBoxProp *newval;
+      MFrame *frame = MPLIST_VAL (plist);
 
-      MSTRUCT_MALLOC (newval, MERROR_FACE);
-      *newval = *((MFaceBoxProp *) val);
-      val = newval;
+      frame->tick++;
+      if (face == frame->face)
+       mface__update_frame_face (frame);
     }
-  face->property[index] = val;
-  face->tick++;
 
   return 0;
 }
@@ -1662,7 +1754,7 @@ mface_update (MFrame *frame, MFace *face)
   MPlist *rface_list;
   MRealizedFace *rface;
 
-  if (func)
+  if (func && func != noop_hook)
     {
       MPLIST_DO (rface_list, frame->realized_face_list)
        {