*** empty log message ***
[m17n/m17n-lib.git] / src / face.c
1 /* face.c -- face module.
2    Copyright (C) 2003, 2004
3      National Institute of Advanced Industrial Science and Technology (AIST)
4      Registration Number H15PRO112
5
6    This file is part of the m17n library.
7
8    The m17n library is free software; you can redistribute it and/or
9    modify it under the terms of the GNU Lesser General Public License
10    as published by the Free Software Foundation; either version 2.1 of
11    the License, or (at your option) any later version.
12
13    The m17n library is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16    Lesser General Public License for more details.
17
18    You should have received a copy of the GNU Lesser General Public
19    License along with the m17n library; if not, write to the Free
20    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
21    02111-1307, USA.  */
22
23 /***en
24     @addtogroup m17nFace
25     @brief A face is an object to control appearance of M-text.
26
27     A @e face is an object of the type #MFace and controls how to
28     draw M-texts.  A face has a fixed number of @e face @e properties.
29     Like other types of properties, a face property consists of a key
30     and a value.  A key is one of the following symbols:
31
32     #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
33     #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
34     #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg
35
36     "The face property that belongs to face F and whose key is @c xxx"
37     may be shortened to "the xxx property of F".
38
39     The M-text drawing functions first search an M-text for the text
40     property whose key is the symbol #Mface, then draw the M-text
41     using the value of that text property.  This value must be a
42     pointer to a face object.
43
44     If there are multiple text properties whose key is @c Mface, and
45     they are not conflicting one another, properties of those faces
46     are merged and used.
47
48     If no faces specify a certain property, the value of the default
49     face is used.  */
50
51 /***ja
52     @addtogroup m17nFace
53     @brief ¥Õ¥§¡¼¥¹¤È¤Ï¡¢M-text ¤Î¸«±É¤¨¤òÀ©¸æ¤¹¤ë¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤¢¤ë.
54
55     @e ¥Õ¥§¡¼¥¹ ¤Ï #MFace ·¿¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤¢¤ê¡¢M-text 
56     ¤Îɽ¼¨ÊýË¡¤òÀ©¸æ¤¹¤ë¡£¥Õ¥§¡¼¥¹¤Ï¸ÇÄê¸Ä¤Î @e ¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£ ¤ò»ý¤Ä¡£
57     Â¾¤Î¥×¥í¥Ñ¥Æ¥£Æ±ÍÍ¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Ï¥­¡¼¤ÈÃͤ«¤é¤Ê¤ê¡¢¥­¡¼¤Ï°Ê²¼¤Î¥·¥ó¥Ü¥ë¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë¡£
58
59     #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox, 
60     #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle, 
61     #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg
62
63     ¡Ö¥Õ¥§¡¼¥¹ F ¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¤¦¤Á¥­¡¼¤¬ @c Mxxx 
64     ¤Ç¤¢¤ë¤â¤Î¡×¤Î¤³¤È¤ò´Êñ¤Ë¡ÖF ¤Î xxx ¥×¥í¥Ñ¥Æ¥£¡×¤È¸Æ¤Ö¤³¤È¤¬¤¢¤ë¡£
65
66     M-text ¤Îɽ¼¨´Ø¿ô¤Ï¡¢¤Þ¤ººÇ½é¤Ë¤½¤Î M-text ¤«¤é¥­¡¼¤¬¥·¥ó¥Ü¥ë 
67     #Mface ¤Ç¤¢¤ë¤è¤¦¤Ê¥Æ¥­¥¹¥È¥×¥í¥Ñ¥Æ¥£¤òõ¤·¡¢¼¡¤Ë¤½¤ÎÃͤ˽¾¤Ã¤Æ 
68     M-text ¤òɽ¼¨¤¹¤ë¡£¤³¤ÎÃͤϥե§¡¼¥¹¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
69
70     M-text ¤¬¡¢#Mface 
71     ¤ò¥­¡¼¤È¤¹¤ë¥Æ¥­¥¹¥È¥×¥í¥Ñ¥Æ¥£¤òÊ£¿ô»ý¤Ã¤Æ¤ª¤ê¡¢¤«¤Ä¤½¤ì¤é¤ÎÃͤ¬¾×Æͤ·¤Ê¤¤¤Ê¤é¤Ð¡¢¥Õ¥§¡¼¥¹¾ðÊó¤ÏÁȤ߹ç¤ï¤µ¤ì¤ÆÍѤ¤¤é¤ì¤ë¡£
72
73     ¤¢¤ë¥Æ¥­¥¹¥È°À­¤¬¤É¤Î¥Õ¥§¡¼¥¹¤Ë¤è¤Ã¤Æ¤â»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¥Õ¥§¡¼¥¹¤ÎÃͤ¬ÍѤ¤¤é¤ì¤ë¡£  */
74
75 /*=*/
76
77 #if !defined (FOR_DOXYGEN) || defined (DOXYGEN_INTERNAL_MODULE)
78 /*** @addtogroup m17nInternal
79      @{ */
80
81 #include <stdio.h>
82 #include <stdlib.h>
83 #include <string.h>
84 #include <ctype.h>
85
86 #include "config.h"
87 #include "m17n-gui.h"
88 #include "m17n-misc.h"
89 #include "internal.h"
90 #include "charset.h"
91 #include "symbol.h"
92 #include "plist.h"
93 #include "mtext.h"
94 #include "textprop.h"
95 #include "internal-gui.h"
96 #include "face.h"
97 #include "font.h"
98 #include "fontset.h"
99
100 static M17NObjectArray face_table;
101
102 MSymbol Mlatin;
103
104 static MSymbol M_face_prop_index;
105
106 static MPlist *hline_prop_list;
107 static MPlist *box_prop_list;
108
109 /** Special hook function pointer that does nothing.  */
110 static MFaceHookFunc noop_hook;
111
112 /**  */
113 static MFaceHLineProp *
114 get_hline_create (MFaceHLineProp *prop)
115 {
116   MPlist *plist;
117   MFaceHLineProp *hline;
118
119   if (prop->width == 0)
120     return MPLIST_VAL (hline_prop_list);
121   MPLIST_DO (plist, MPLIST_NEXT (hline_prop_list))
122     {
123       hline = MPLIST_VAL (plist);
124       if (prop->type == hline->type
125           && prop->width == hline->width
126           && prop->color == hline->color)
127         return hline;
128     }
129   MSTRUCT_MALLOC (hline, MERROR_FACE);
130   *hline = *prop;
131   mplist_push (plist, Mt, hline);
132   return hline;
133 }
134
135 static MFaceBoxProp *
136 get_box_create (MFaceBoxProp *prop)
137 {
138   MPlist *plist;
139   MFaceBoxProp *box;
140
141   if (prop->width == 0)
142     return MPLIST_VAL (box_prop_list);
143   MPLIST_DO (plist, MPLIST_NEXT (box_prop_list))
144     {
145       box = MPLIST_VAL (plist);
146       if (prop->width == box->width
147           && prop->color_top == box->color_top
148           && prop->color_bottom == box->color_bottom
149           && prop->color_left == box->color_left
150           && prop->color_right == box->color_right
151           && prop->inner_hmargin == box->inner_hmargin
152           && prop->inner_vmargin == box->inner_vmargin
153           && prop->outer_hmargin == box->inner_hmargin
154           && prop->inner_vmargin == box->inner_vmargin)
155         return box;
156     }
157   MSTRUCT_MALLOC (box, MERROR_FACE);
158   *box = *prop;
159   mplist_push (plist, Mt, box);
160   return box;
161 }
162
163 /** From FRAME->realized_face_list, find a realized face based on
164     FACE.  */
165
166 static MRealizedFace *
167 find_realized_face (MFrame *frame, MFace *face)
168 {
169   MPlist *plist;
170
171   MPLIST_DO (plist, frame->realized_face_list)
172     {
173       MRealizedFace *rface = MPLIST_VAL (plist);
174
175       if (memcmp (rface->face.property, face->property, sizeof face->property)
176           == 0)
177         return rface;
178     }
179   return NULL;
180 }
181
182 static void
183 free_face (void *object)
184 {
185   MFace *face = (MFace *) object;
186
187   if (face->property[MFACE_FONTSET])
188     M17N_OBJECT_UNREF (face->property[MFACE_FONTSET]);
189   M17N_OBJECT_UNREF (face->frame_list);
190   M17N_OBJECT_UNREGISTER (face_table, face);
191   free (object);
192 }
193
194
195 static MPlist *
196 serialize_hline (MPlist *plist, MFaceHLineProp *hline)
197 {
198   if (hline->width > 0)
199     {
200       MPlist *pl = mplist ();
201
202       mplist_add (pl, Minteger, (void *) hline->type);
203       mplist_add (pl, Minteger, (void *) hline->width);
204       mplist_add (pl, Msymbol, hline->color);
205       plist = mplist_add (plist, Mplist, pl);
206       M17N_OBJECT_UNREF (pl);
207     }
208   return plist;
209 }
210
211 static MPlist *
212 serialize_box (MPlist *plist, MFaceBoxProp *box)
213 {
214   if (box->width > 0)
215     {
216       MPlist *pl = mplist ();
217
218       mplist_add (pl, Minteger, (void *) box->width);
219       mplist_add (pl, Minteger, (void *) box->inner_hmargin);
220       mplist_add (pl, Minteger, (void *) box->inner_vmargin);
221       mplist_add (pl, Minteger, (void *) box->outer_hmargin);
222       mplist_add (pl, Minteger, (void *) box->outer_vmargin);
223       mplist_add (pl, Msymbol, box->color_top);
224       mplist_add (pl, Msymbol, box->color_bottom);
225       mplist_add (pl, Msymbol, box->color_left);
226       mplist_add (pl, Msymbol, box->color_right);
227       plist = mplist_add (plist, Mplist, pl);
228       M17N_OBJECT_UNREF (pl);
229     }
230   return plist;
231 }
232
233 static MPlist *
234 serialize_face (void *val)
235 {
236   MFace *face = val;
237   MPlist *plist = mplist (), *pl = plist;
238   int i;
239   struct {
240     MSymbol *key;
241     MSymbol *type;
242     MPlist *(*func) (MPlist *plist, void *val);
243   } serializer[MFACE_PROPERTY_MAX]
244       = { { &Mfoundry,          &Msymbol },
245           { &Mfamily,           &Msymbol },
246           { &Mweight,           &Msymbol },
247           { &Mstyle,            &Msymbol },
248           { &Mstretch,          &Msymbol },
249           { &Madstyle,          &Msymbol },
250           { &Msize,             &Minteger },
251           { &Mfontset,          NULL },
252           { &Mforeground,       &Msymbol },
253           { &Mbackground,       &Msymbol },
254           { &Mhline,            NULL },
255           { &Mbox,              NULL },
256           { &Mvideomode,        &Msymbol },
257           { NULL,               NULL}, /* MFACE_HOOK_FUNC */
258           { NULL,               NULL}, /* MFACE_HOOK_ARG */
259           { &Mratio,            &Minteger } };
260   
261   for (i = 0; i < MFACE_PROPERTY_MAX; i++)
262     if (face->property[i] && serializer[i].key)
263       {
264         pl = mplist_add (pl, Msymbol, *serializer[i].key);
265         if (serializer[i].type)
266           pl = mplist_add (pl, *serializer[i].type, face->property[i]);
267         else if (i == MFACE_FONTSET)
268           pl = mplist_add (pl, Msymbol, mfontset_name ((MFontset *)
269                                                        face->property[i]));
270         else if (i == MFACE_HLINE)
271           pl = serialize_hline (pl, (MFaceHLineProp *) face->property[i]);
272         else if (i == MFACE_BOX)
273           pl = serialize_box (pl, (MFaceBoxProp *) face->property[i]);
274       }
275
276   return plist;
277 }
278
279 static void *
280 deserialize_hline (MPlist *plist)
281 {
282   MFaceHLineProp hline, *hline_ret;
283
284   if (! MPLIST_INTEGER_P (plist))
285     MERROR (MERROR_FACE, NULL);
286   hline.type = MPLIST_INTEGER_P (plist);
287   plist = MPLIST_NEXT (plist);
288   if (! MPLIST_INTEGER_P (plist))
289     MERROR (MERROR_FACE, NULL);
290   hline.width = MPLIST_INTEGER_P (plist);
291   plist = MPLIST_NEXT (plist);
292   if (! MPLIST_SYMBOL_P (plist))
293     MERROR (MERROR_FACE, NULL);
294   hline.color = MPLIST_SYMBOL (plist);
295   MSTRUCT_MALLOC (hline_ret, MERROR_FACE);
296   *hline_ret = hline;
297   return hline_ret;
298 }
299
300 static void *
301 deserialize_box (MPlist *plist)
302 {
303   MFaceBoxProp box, *box_ret;
304
305   if (! MPLIST_INTEGER_P (plist))
306     MERROR (MERROR_FACE, NULL);
307   box.width = MPLIST_INTEGER (plist);
308   plist = MPLIST_NEXT (plist);
309   if (! MPLIST_INTEGER_P (plist))
310     MERROR (MERROR_FACE, NULL);
311   box.inner_hmargin = MPLIST_INTEGER (plist);
312   plist = MPLIST_NEXT (plist);
313   if (! MPLIST_INTEGER_P (plist))
314     MERROR (MERROR_FACE, NULL);
315   box.inner_vmargin = MPLIST_INTEGER (plist);
316   plist = MPLIST_NEXT (plist);
317   if (! MPLIST_INTEGER_P (plist))
318     MERROR (MERROR_FACE, NULL);
319   box.outer_hmargin = MPLIST_INTEGER (plist);
320   plist = MPLIST_NEXT (plist);
321   if (! MPLIST_INTEGER_P (plist))
322     MERROR (MERROR_FACE, NULL);
323   box.outer_vmargin = MPLIST_INTEGER (plist);
324   plist = MPLIST_NEXT (plist);
325   if (! MPLIST_SYMBOL_P (plist))
326     MERROR (MERROR_FACE, NULL);
327   box.color_top = MPLIST_SYMBOL (plist);
328   plist = MPLIST_NEXT (plist);
329   if (! MPLIST_SYMBOL_P (plist))
330     MERROR (MERROR_FACE, NULL);
331   box.color_bottom = MPLIST_SYMBOL (plist);
332   plist = MPLIST_NEXT (plist);
333   if (! MPLIST_SYMBOL_P (plist))
334     MERROR (MERROR_FACE, NULL);
335   box.color_left = MPLIST_SYMBOL (plist);
336   plist = MPLIST_NEXT (plist);
337   if (! MPLIST_SYMBOL_P (plist))
338     MERROR (MERROR_FACE, NULL);
339   box.color_right = MPLIST_SYMBOL (plist);
340   MSTRUCT_MALLOC (box_ret, MERROR_FACE);
341   *box_ret = box;
342   return box_ret;
343 }
344
345 static void *
346 deserialize_face (MPlist *plist)
347 {
348   MFace *face = mface ();
349
350   MPLIST_DO (plist, plist)
351     {
352       MSymbol key;
353       int index;
354       void *val;
355
356       if (! MPLIST_SYMBOL_P (plist))
357         break;
358       key = MPLIST_SYMBOL (plist);
359       index = (int) msymbol_get (key, M_face_prop_index) - 1;
360       plist = MPLIST_NEXT (plist);
361       if (MPLIST_TAIL_P (plist))
362         break;
363       if (index < 0 || index >= MFACE_PROPERTY_MAX)
364         continue;
365       if (key == Mfoundry || key == Mfamily || key == Mweight || key == Mstyle
366           || key == Mstretch || key == Madstyle
367           || key == Mforeground || key == Mbackground || key == Mvideomode)
368         {
369           if (! MPLIST_SYMBOL_P (plist))
370             continue;
371           val = MPLIST_VAL (plist);
372         }
373       else if (key == Msize || key == Mratio)
374         {
375           if (! MPLIST_INTEGER_P (plist))
376             continue;
377           val = MPLIST_VAL (plist);
378         }
379       else if (key == Mfontset)
380         {
381           if (! MPLIST_SYMBOL_P (plist))
382             continue;
383           val = mfontset (MSYMBOL_NAME (MPLIST_SYMBOL (plist)));
384         }
385       else if (key == Mhline)
386         {
387           if (! MPLIST_PLIST_P (plist))
388             continue;
389           val = deserialize_hline (MPLIST_PLIST (plist));
390         }
391       else if (key == Mbox)
392         {
393           if (! MPLIST_PLIST_P (plist))
394             continue;
395           val = deserialize_box (MPLIST_PLIST (plist));
396         }
397       face->property[index] = val;
398     }
399   return face;
400 }
401
402 static MGlyphString work_gstring;
403
404 \f
405
406 /* Internal API */
407
408 MFace *mface__default;
409
410 int
411 mface__init ()
412 {
413   int i;
414   MFaceHLineProp *hline;
415   MFaceBoxProp *box;
416
417   face_table.count = 0;
418   Mface = msymbol_as_managing_key ("face");
419   msymbol_put (Mface, Mtext_prop_serializer, (void *) serialize_face);
420   msymbol_put (Mface, Mtext_prop_deserializer, (void *) deserialize_face);
421
422   Mforeground = msymbol ("foreground");
423   Mbackground = msymbol ("background");
424   Mvideomode = msymbol ("videomode");
425   Mnormal = msymbol ("normal");
426   Mreverse = msymbol ("reverse");
427   Mratio = msymbol ("ratio");
428   Mhline = msymbol ("hline");
429   Mbox = msymbol ("box");
430   Mhook_func = msymbol ("hook-func");
431   Mhook_arg = msymbol ("hook-arg");
432
433   Mlatin = msymbol ("latin");
434   M_face_prop_index = msymbol ("  face-prop-index");
435
436   {
437     struct {
438       /* Pointer to the key symbol of the face property.  */
439       MSymbol *key;
440       /* Index (enum face_property) of the face property. */
441       int index;
442     } mface_prop_data[MFACE_PROPERTY_MAX] =
443         { { &Mfoundry,          MFACE_FOUNDRY },
444           { &Mfamily,           MFACE_FAMILY },
445           { &Mweight,           MFACE_WEIGHT },
446           { &Mstyle,            MFACE_STYLE },
447           { &Mstretch,          MFACE_STRETCH },
448           { &Madstyle,          MFACE_ADSTYLE },
449           { &Msize,             MFACE_SIZE },
450           { &Mfontset,          MFACE_FONTSET },
451           { &Mforeground,       MFACE_FOREGROUND },
452           { &Mbackground,       MFACE_BACKGROUND },
453           { &Mhline,            MFACE_HLINE },
454           { &Mbox,              MFACE_BOX },
455           { &Mvideomode,        MFACE_VIDEOMODE },
456           { &Mhook_func,        MFACE_HOOK_FUNC },
457           { &Mhook_arg,         MFACE_HOOK_ARG },
458           { &Mratio,            MFACE_RATIO },
459         };
460
461     for (i = 0; i < MFACE_PROPERTY_MAX; i++)
462       /* We add one to distinguish it from no-property.  */
463       msymbol_put (*mface_prop_data[i].key, M_face_prop_index,
464                    (void *) (mface_prop_data[i].index + 1));
465   }
466
467   hline_prop_list = mplist ();
468   MSTRUCT_CALLOC (hline, MERROR_FACE);
469   mplist_push (hline_prop_list, Mt, hline);
470   box_prop_list = mplist ();
471   MSTRUCT_CALLOC (box, MERROR_FACE);
472   mplist_push (box_prop_list, Mt, box);
473
474   mface__default = mface ();
475   mface__default->property[MFACE_FOUNDRY] = msymbol ("misc");
476   mface__default->property[MFACE_FAMILY] = msymbol ("fixed");
477   mface__default->property[MFACE_WEIGHT] = msymbol ("medium");
478   mface__default->property[MFACE_STYLE] = msymbol ("r");
479   mface__default->property[MFACE_STRETCH] = msymbol ("normal");
480   mface__default->property[MFACE_ADSTYLE] = msymbol ("");
481   mface__default->property[MFACE_SIZE] = (void *) 120;
482   mface__default->property[MFACE_FONTSET] = mfontset (NULL);
483   mface__default->property[MFACE_FOREGROUND] = msymbol ("black");
484   mface__default->property[MFACE_BACKGROUND] = msymbol ("white");
485   mface__default->property[MFACE_HLINE] = hline;
486   mface__default->property[MFACE_BOX] = box;
487   mface__default->property[MFACE_VIDEOMODE] = Mnormal;
488   mface__default->property[MFACE_HOOK_FUNC] = (void *) noop_hook;
489
490   mface_normal_video = mface ();
491   mface_normal_video->property[MFACE_VIDEOMODE] = (void *) Mnormal;
492
493   mface_reverse_video = mface ();
494   mface_reverse_video->property[MFACE_VIDEOMODE] = (void *) Mreverse;
495
496   {
497     MFaceHLineProp hline_prop;
498
499     hline_prop.type = MFACE_HLINE_UNDER;
500     hline_prop.width = 1;
501     hline_prop.color = Mnil;
502     mface_underline = mface ();
503     mface_put_prop (mface_underline, Mhline, &hline_prop);
504   }
505
506   mface_medium = mface ();
507   mface_medium->property[MFACE_WEIGHT] = (void *) msymbol ("medium");
508   mface_bold = mface ();
509   mface_bold->property[MFACE_WEIGHT] = (void *) msymbol ("bold");
510   mface_italic = mface ();
511   mface_italic->property[MFACE_STYLE] = (void *) msymbol ("i");
512   mface_bold_italic = mface_copy (mface_bold);
513   mface_bold_italic->property[MFACE_STYLE]
514     = mface_italic->property[MFACE_STYLE];
515
516   mface_xx_small = mface ();
517   mface_xx_small->property[MFACE_RATIO] = (void *) 50;
518   mface_x_small = mface ();
519   mface_x_small->property[MFACE_RATIO] = (void *) 67;
520   mface_small = mface ();
521   mface_small->property[MFACE_RATIO] = (void *) 75;
522   mface_normalsize = mface ();
523   mface_normalsize->property[MFACE_RATIO] = (void *) 100;
524   mface_large = mface ();
525   mface_large->property[MFACE_RATIO] = (void *) 120;
526   mface_x_large = mface ();
527   mface_x_large->property[MFACE_RATIO] = (void *) 150;
528   mface_xx_large = mface ();
529   mface_xx_large->property[MFACE_RATIO] = (void *) 200;
530
531   mface_black = mface ();
532   mface_black->property[MFACE_FOREGROUND] = (void *) msymbol ("black");
533   mface_white = mface ();
534   mface_white->property[MFACE_FOREGROUND] = (void *) msymbol ("white");
535   mface_red = mface ();
536   mface_red->property[MFACE_FOREGROUND] = (void *) msymbol ("red");
537   mface_green = mface ();
538   mface_green->property[MFACE_FOREGROUND] = (void *) msymbol ("green");
539   mface_blue = mface ();
540   mface_blue->property[MFACE_FOREGROUND] = (void *) msymbol ("blue");
541   mface_cyan = mface ();
542   mface_cyan->property[MFACE_FOREGROUND] = (void *) msymbol ("cyan");
543   mface_yellow = mface ();
544   mface_yellow->property[MFACE_FOREGROUND] = (void *) msymbol ("yellow");
545   mface_magenta = mface ();
546   mface_magenta->property[MFACE_FOREGROUND] = (void *) msymbol ("magenta");
547
548   work_gstring.glyphs = malloc (sizeof (MGlyph) * 2);
549   work_gstring.size = 2;
550   work_gstring.used = 0;
551   work_gstring.inc = 1;
552   return 0;
553 }
554
555 void
556 mface__fini ()
557 {
558   MPlist *plist;
559
560   M17N_OBJECT_UNREF (mface__default);
561   M17N_OBJECT_UNREF (mface_normal_video);
562   M17N_OBJECT_UNREF (mface_reverse_video);
563   M17N_OBJECT_UNREF (mface_underline);
564   M17N_OBJECT_UNREF (mface_medium);
565   M17N_OBJECT_UNREF (mface_bold);
566   M17N_OBJECT_UNREF (mface_italic);
567   M17N_OBJECT_UNREF (mface_bold_italic);
568   M17N_OBJECT_UNREF (mface_xx_small);
569   M17N_OBJECT_UNREF (mface_x_small);
570   M17N_OBJECT_UNREF (mface_small);
571   M17N_OBJECT_UNREF (mface_normalsize);
572   M17N_OBJECT_UNREF (mface_large);
573   M17N_OBJECT_UNREF (mface_x_large);
574   M17N_OBJECT_UNREF (mface_xx_large);
575   M17N_OBJECT_UNREF (mface_black);
576   M17N_OBJECT_UNREF (mface_white);
577   M17N_OBJECT_UNREF (mface_red);
578   M17N_OBJECT_UNREF (mface_green);
579   M17N_OBJECT_UNREF (mface_blue);
580   M17N_OBJECT_UNREF (mface_cyan);
581   M17N_OBJECT_UNREF (mface_yellow);
582   M17N_OBJECT_UNREF (mface_magenta);
583
584   MPLIST_DO (plist, hline_prop_list)
585     free (MPLIST_VAL (plist));
586   M17N_OBJECT_UNREF (hline_prop_list);
587   MPLIST_DO (plist, box_prop_list)
588     free (MPLIST_VAL (plist));
589   M17N_OBJECT_UNREF (box_prop_list);
590
591   free (work_gstring.glyphs);
592
593   mdebug__report_object ("Face", &face_table);
594 }
595
596 /** Return a realized face for ASCII characters from NUM number of
597     base faces pointed by FACES on the frame FRAME.  */
598
599 MRealizedFace *
600 mface__realize (MFrame *frame, MFace **faces, int num, int size)
601 {
602   MRealizedFace *rface;
603   MRealizedFont *rfont;
604   MFace merged_face = *(frame->face);
605   void **props;
606   int i, j;
607   MGlyph g;
608   MFaceHookFunc func;
609
610   if (num == 0 && frame->rface)
611     return frame->rface;
612
613   for (i = 0; i < MFACE_PROPERTY_MAX; i++)
614     for (j = num - 1; j >= 0; j--)
615       if (faces[j]->property[i])
616         {
617           merged_face.property[i] = faces[j]->property[i];
618           break;
619         }
620
621   if (! mplist_find_by_value (frame->face->frame_list, frame))
622     mplist_push (frame->face->frame_list, Mt, frame);
623   for (i = 0; i < num; i++)
624     if (! mplist_find_by_value (faces[i]->frame_list, frame))
625       mplist_push (faces[i]->frame_list, Mt, frame);
626
627   if (merged_face.property[MFACE_RATIO])
628     {
629       int font_size = (int) merged_face.property[MFACE_SIZE];
630
631       font_size *= (int) merged_face.property[MFACE_RATIO];
632       font_size /= 100;
633       merged_face.property[MFACE_SIZE] = (void *) font_size;
634       merged_face.property[MFACE_RATIO] = 0;
635     }
636
637   rface = find_realized_face (frame, &merged_face);
638   if (rface)
639     return rface;
640
641   MSTRUCT_CALLOC (rface, MERROR_FACE);
642   mplist_push (frame->realized_face_list, Mt, rface);
643   rface->frame = frame;
644   rface->face = merged_face;
645   props = rface->face.property;
646   rface->rfontset = mfont__realize_fontset (frame,
647                                             (MFontset *) props[MFACE_FONTSET],
648                                             &merged_face);
649   g.type = GLYPH_SPACE;
650   g.c = ' ';
651   num = 1;
652   rfont = mfont__lookup_fontset (rface->rfontset, &g, &num,
653                                  Mlatin, Mnil, Mnil, size);
654   if (rfont)
655     {
656       rface->rfont = rfont;
657       g.otf_encoded = 0;
658       work_gstring.frame = frame;
659       work_gstring.glyphs[0] = g;
660       work_gstring.glyphs[0].rface = rface;
661       work_gstring.glyphs[1].code = MCHAR_INVALID_CODE;
662       work_gstring.glyphs[1].rface = rface;
663       mfont__get_metric (&work_gstring, 0, 2);
664       rface->space_width = work_gstring.glyphs[0].width;
665       rface->ascent = work_gstring.glyphs[1].ascent;
666       rface->descent = work_gstring.glyphs[1].descent;
667     }
668   else
669     {
670       rface->rfont = NULL;
671       rface->space_width = frame->space_width;
672     }
673
674   rface->hline = (MFaceHLineProp *) props[MFACE_HLINE];
675   if (rface->hline && rface->hline->width == 0)
676     rface->hline = NULL;
677   rface->box = (MFaceBoxProp *) props[MFACE_BOX];
678   if (rface->box && rface->box->width == 0)
679     rface->box = NULL;
680   rface->ascii_rface = rface;
681   (*frame->driver->realize_face) (rface);
682
683   func = (MFaceHookFunc) rface->face.property[MFACE_HOOK_FUNC];
684   if (func && func != noop_hook)
685     (func) (&(rface->face), rface->info, rface->face.property[MFACE_HOOK_ARG]);
686
687   rface->non_ascii_list = mplist ();
688   if (rface->rfont)
689     {
690       MRealizedFace *nofont;
691
692       MSTRUCT_CALLOC (nofont, MERROR_FACE);
693       *nofont = *rface;
694       nofont->non_ascii_list = NULL;
695       nofont->rfont = NULL;
696       mplist_add (rface->non_ascii_list, Mt, nofont);
697     }
698
699   return rface;
700 }
701
702
703 MGlyph *
704 mface__for_chars (MSymbol script, MSymbol language, MSymbol charset,
705                   MGlyph *from_g, MGlyph *to_g, int size)
706 {
707   MRealizedFont *rfont;
708   int num = to_g - from_g;
709
710   rfont = mfont__lookup_fontset (from_g->rface->rfontset, from_g, &num,
711                                  script, language, charset, size);
712   if (! rfont)
713     num = 1;
714   
715   to_g = from_g + num;
716   while (from_g < to_g)
717     {
718       MGlyph *g = from_g;
719       MRealizedFace *rface = from_g++->rface;
720
721       while (from_g < to_g && rface == from_g->rface) from_g++;
722       if (rface->rfont != rfont)
723         {
724           MPlist *plist = mplist_find_by_value (rface->non_ascii_list, rfont);
725           MRealizedFace *new;
726
727           if (plist)
728             new = MPLIST_VAL (plist);
729           else
730             {
731               MSTRUCT_MALLOC (new, MERROR_FACE);
732               mplist_push (rface->non_ascii_list, Mt, new);
733               *new = *rface;
734               new->rfont = rfont;
735               new->non_ascii_list = NULL;
736               if (rfont)
737                 {
738                   new->ascent = rfont->ascent;
739                   new->descent = rfont->descent;
740                 }
741             }
742           while (g < from_g)
743             g++->rface = new;
744         }
745     }
746   return to_g;
747 }
748
749
750 void
751 mface__free_realized (MRealizedFace *rface)
752 {
753   MPlist *plist;
754
755   MPLIST_DO (plist, rface->non_ascii_list)
756     free (MPLIST_VAL (plist));
757   M17N_OBJECT_UNREF (rface->non_ascii_list);
758   free (rface);
759 }
760
761 void
762 mface__update_frame_face (MFrame *frame)
763 {
764   frame->rface = NULL;
765   frame->rface = mface__realize (frame, NULL, 0, 0);
766   frame->space_width = frame->rface->space_width;
767   frame->ascent = frame->rface->ascent;
768   frame->descent = frame->rface->descent;
769 }
770
771 /*** @} */
772 #endif /* !FOR_DOXYGEN || DOXYGEN_INTERNAL_MODULE */
773
774 \f
775 /* External API  */
776 /*** @addtogroup m17nFace */
777 /*** @{ */
778 /*=*/
779
780 /***en @name Variables: Keys of face property */
781 /***ja @name ÊÑ¿ô: ¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥­¡¼  */
782 /*** @{ */
783 /*=*/
784
785 /***en
786     @brief Key of a face property specifying foreground color.
787
788     The variable #Mforeground is used as a key of face property.  The
789     property value must be a symbol whose name is a color name, or
790     #Mnil.
791
792     #Mnil means that the face does not specify a foreground color.
793     Otherwise, the foreground of an M-text is drawn by the specified
794     color.  */
795 /***ja
796     @brief Á°·Ê¿§¤ò»ØÄꤹ¤ë¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥­¡¼.
797
798     ÊÑ¿ô #Mforeground ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥­¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£
799     ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢¿§Ì¾¤ò̾Á°¤È¤·¤Æ»ý¤Ä¥·¥ó¥Ü¥ë¤« #Mnil ¤Ç¤¢¤ë¡£
800
801     #Mnil ¤Î¾ì¹ç¡¢Á°·Ê¿§¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð M-text 
802     ¤ÎÁ°·Ê¤Ï»ØÄꤵ¤ì¤¿¿§¤Çɽ¼¨¤µ¤ì¤ë¡£  */
803
804 MSymbol Mforeground;
805
806 /***en
807     @brief Key of a face property specifying background color.
808
809     The variable #Mbackground is used as a key of face property.  The
810     property value must be a symbol whose name is a color name, or
811     #Mnil.
812
813     #Mnil means that the face does not specify a background color.
814     Otherwise, the background of an M-text is drawn by the specified
815     color.  */
816 /***ja
817     @brief ÇØ·Ê¿§¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥­¡¼.
818
819     ÊÑ¿ô #Mbackground ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥­¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£
820     ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢¿§Ì¾¤ò̾Á°¤È¤·¤Æ»ý¤Ä¥·¥ó¥Ü¥ë¤« #Mnil ¤Ç¤¢¤ë¡£
821
822     #Mnil ¤Î¾ì¹ç¡¢ÇØ·Ê¿§¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð M-text 
823     ¤ÎÇطʤϻØÄꤵ¤ì¤¿¿§¤Çɽ¼¨¤µ¤ì¤ë¡£  */
824
825 MSymbol Mbackground;
826
827 /***en
828     @brief Key of a face property specifying video mode.
829
830     The variable #Mvideomode is used as a key of face property.  The
831     property value must be #Mnormal, #Mreverse, or #Mnil.
832
833     #Mnormal means that an M-text is drawn in normal video mode
834     (i.e. the foreground is drawn by foreground color, the background
835     is drawn by background color).
836
837     #Mreverse means that an M-text is drawn in reverse video mode
838     (i.e. the foreground is drawn by background color, the background
839     is drawn by foreground color).
840
841     #Mnil means that the face does not specify a video mode.  */
842 /***ja
843     @brief ¥Ó¥Ç¥ª¥â¡¼¥É¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥­¡¼.
844
845     ÊÑ¿ô #Mvideomode ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥­¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢
846     #Mnormal, #Mreverse, #Mnil ¤Î¤¤¤º¤ì¤«¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
847
848     #Mnormal ¤Î¾ì¹ç¤Ï¡¢M-text 
849     ¤òɸ½à¤Î¥Ó¥Ç¥ª¥â¡¼¥É¡ÊÁ°·Ê¤òÁ°·Ê¿§¤Ç¡¢ÇطʤòÇØ·Ê¿§¤Ç¡Ë¤Çɽ¼¨¤¹¤ë¡£
850
851     #Mreverse ¤Î¾ì¹ç¤Ï¥ê¥Ð¡¼¥¹¥Ó¥Ç¥ª¥â¡¼¥É¤Ç¡ÊÁ°·Ê¤òÇØ·Ê¿§¤Ç¡¢ÇطʤòÁ°·Ê¿§¤Ç¡Ëɽ¼¨¤¹¤ë¡£
852
853     #Mnil ¤Î¾ì¹ç¤Ï¥Ó¥Ç¥ª¥â¡¼¥É¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
854     */
855
856 MSymbol Mvideomode;
857
858 /***en
859     @brief Key of a face property specifying font size ratio.
860
861     The variable #Mratio is used as a key of face property.  The value
862     RATIO must be an integer.
863
864     The value 0 means that the face does not specify a font size
865     ratio.  Otherwise, an M-text is drawn by a font of size (FONTSIZE
866     * RATIO / 100) where FONTSIZE is a font size specified by the face
867     property #Msize.  */
868 /***ja
869     @brief ¥Õ¥©¥ó¥È¤Î¥µ¥¤¥º¤ÎÈæΨ¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥­¡¼.
870
871     ÊÑ¿ô #Mratio ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥­¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃÍ RATIO 
872     ¤ÏÀ°¿ôÃͤǤʤ¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
873
874     Ãͤ¬0¤Ê¤é¤Ð¡¢¥Õ¥©¥ó¥È¥µ¥¤¥º¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¡¢M-text 
875     ¤Ï(FONTSIZE * RATIO / 100) ¤È¤¤¤¦¥µ¥¤¥º¤Î¥Õ¥©¥ó¥È¤Çɽ¼¨¤µ¤ì¤ë¡£
876     FONTSIZE ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼#Msize ¤Ç»ØÄꤵ¤ì¤¿¥µ¥¤¥º¤Ç¤¢¤ë¡£ */
877
878 MSymbol Mratio;
879
880 /***en
881     @brief Key of a face property specifying horizontal line.
882
883     The variable #Mhline is used as a key of face property.  The value
884     must be a pointer to an object of type #MFaceHLineProp, or @c
885     NULL.
886
887     The value @c NULL means that the face does not specify this
888     property.  Otherwise, an M-text is drawn with a horizontal line by
889     a way specified by the object that the value points to.  */
890 /***ja
891     @brief ¿åÊ¿Àþ¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥­¡¼.
892
893     ÊÑ¿ô #Mhline ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥­¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃͤϠ
894     #MFaceHLineProp ·¿¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤« @c NULL ¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
895
896     Ãͤ¬ @c NULL ¤Ê¤é¤Ð¡¢¤³¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
897     ¤½¤¦¤Ç¤Ê¤±¤ì¤ÐÃͤ¬»Ø¤¹¥ª¥Ö¥¸¥§¥¯¥È¤Ë»ØÄꤵ¤ì¤¿¤è¤¦¤Ë¿åÊ¿Àþ¤òÉղ䷤ƠM-text 
898     ¤òɽ¼¨¤¹¤ë¡£*/
899
900 MSymbol Mhline;
901
902 /***en
903     @brief Key of a face property specifying box.
904
905     The variable #Mbox is used as a key of face property.  The value
906     must be a pointer to an object of type #MFaceBoxProp, or @c NULL.
907
908     The value @c NULL means that the face does not specify a box.
909     Otherwise, an M-text is drawn with a surrounding box by a way
910     specified by the object that the value points to.  */
911 /***ja
912     @brief °Ï¤ßÏȤò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥­¡¼.
913
914     ÊÑ¿ô #Mbox ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥­¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃͤϠ
915     #MFaceBoxProp ·¿¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤« @c NULL ¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
916
917     Ãͤ¬ @c NULL ¤Ê¤é¤Ð¡¢¤³¤Î¥Õ¥§¡¼¥¹¤Ï°Ï¤ßÏȤò»ØÄꤷ¤Æ¤¤¤Ê¤¤¡£
918     ¤½¤¦¤Ç¤Ê¤±¤ì¤ÐÃͤ¬»Ø¤¹¥ª¥Ö¥¸¥§¥¯¥È¤Ë»ØÄꤵ¤ì¤¿¤è¤¦¤Ë°Ï¤ßÏȤòÉղ䷤Ơ
919     M-text ¤òɽ¼¨¤¹¤ë¡£*/
920
921 MSymbol Mbox;
922
923 /***en
924     @brief Key of a face property specifying fontset.
925
926     The variable #Mfontset is used as a key of face property.  The
927     value must be a pointer to an object of type #Mfontset, or @c
928     NULL.
929
930     The value @c NULL means that the face does not specify a fontset.
931     Otherwise, an M-text is drawn with a font selected from what
932     specified in the fontset.  */
933 /***ja
934     @brief ¥Õ¥©¥ó¥È¥»¥Ã¥È¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥­¡¼.
935
936     ÊÑ¿ô #Mfontset ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥­¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃͤϠ
937     #Mfontset ·¿¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤« @c NULL ¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
938
939     Ãͤ¬ @c NULL ¤Ê¤é¤Ð¡¢¥Õ¥©¥ó¥È¥»¥Ã¥È¤Ï»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£
940     ¤½¤¦¤Ç¤Ê¤±¤ì¤ÐÃͤ¬»Ø¤¹¥ª¥Ö¥¸¥§¥¯¥È¤Ë»ØÄꤵ¤ì¤¿¥Õ¥©¥ó¥È¥»¥Ã¥È¤«¤éÁª¤ó¤À¥Õ¥©¥ó¥È¤Ç 
941     M-text ¤òɽ¼¨¤¹¤ë¡£*/
942     
943 MSymbol Mfontset;
944
945 /***en
946     @brief Key of a face property specifying hook.
947
948     The variable #Mhook_func is used as a key of face property.  The
949     value must be a function of type #MFaceHookFunc, or @c NULL.
950
951     The value @c NULL means that the face does not specify a hook.
952     Otherwise, the specified function is called before the face is
953     realized.  */
954 /***ja
955     @brief ¥Õ¥Ã¥¯¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥­¡¼.
956
957     ÊÑ¿ô #Mhook_func ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥­¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃͤϠ
958     #MFaceHookFunc ·¿¤Î´Ø¿ô¤« @c NULL ¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
959
960     Ãͤ¬ @c NULL ¤Ê¤é¤Ð¡¢¥Õ¥Ã¥¯¤Ï»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£
961     ¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¥Õ¥§¡¼¥¹¤ò¼Â¸½¤¹¤ëÁ°¤Ë»ØÄꤵ¤ì¤¿´Ø¿ô¤¬¸Æ¤Ð¤ì¤ë¡£      */
962 MSymbol Mhook_func;
963
964 /***en
965     @brief Key of a face property specifying argument of hook.
966
967     The variable #Mhook_arg is used as a key of face property.  The
968     value can be anything that is passed a hook function specified by
969     the face property #Mhook_func.  */
970 /***ja
971     @brief ¥Õ¥Ã¥¯¤Î°ú¿ô¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥­¡¼.
972
973     ÊÑ¿ô #Mhook_arg ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥­¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£
974     Ãͤϲ¿¤Ç¤â¤è¤¯¡¢¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£ #Mhook_func ¤Ç»ØÄꤵ¤ì¤ë´Ø¿ô¤ËÅϤµ¤ì¤ë¡£ */
975 MSymbol Mhook_arg;
976
977 /*** @} */
978 /*=*/
979
980 /*** @ingroup m17nFace */
981 /***en @name Variables: Possible values of #Mvideomode property of face */
982 /***ja @name ÊÑ¿ô¡§  ¥Õ¥§¡¼¥¹¤Î #Mvideomode ¥×¥í¥Ñ¥Æ¥£¤Î²Äǽ¤ÊÃÍ */
983 /*** @{ */
984 /*=*/
985
986 /***en
987     See the documentation of the variable #Mvideomode.  */ 
988 /***ja
989     ÊÑ¿ô #Mvideomode ¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£  */ 
990 MSymbol Mnormal;
991 MSymbol Mreverse;
992 /*** @} */
993 /*=*/
994
995 /*** @ingroup m17nFace */
996 /***en @name Variables: Predefined faces  */
997 /***ja @name ÊÑ¿ô: ÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹  */
998 /*** @{ */
999 /*=*/
1000
1001 /***en
1002     @brief Normal video face.
1003
1004     The variable #mface_normal_video points to a face that has the
1005     #Mvideomode property with value #Mnormal.  The other properties
1006     are not specified.  An M-text drawn with this face appear normal
1007     colors (i.e. the foreground is drawn by foreground color, and
1008     background is drawn by background color).  */
1009 /***ja
1010     @brief É¸½à¥Ó¥Ç¥ª¥Õ¥§¡¼¥¹.
1011
1012     ÊÑ¿ô #mface_normal_video ¤Ï #Mvideomode ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ #Mnormal 
1013     ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1014     ¤³¤Î¥Õ¥§¡¼¥¹¤Çɽ¼¨¤µ¤ì¤ëM-text 
1015     ¤Ïɸ½à¤Î¿§ (¤¹¤Ê¤ï¤ÁÁ°·Ê¤ÏÁ°·Ê¿§¡¢ÇطʤÏÇØ·Ê¿§¡Ë¤ÇÉÁ¤«¤ì¤ë¡£  */
1016
1017 MFace *mface_normal_video;
1018
1019 /***en
1020     @brief Reverse video face.
1021
1022     The variable #mface_reverse_video points to a face that has the
1023     #Mvideomode property with value #Mreverse.  The other properties
1024     are not specified.  An M-text drawn with this face appear in
1025     reversed colors (i.e. the foreground is drawn by background
1026     color, and background is drawn by foreground color).  */
1027 /***ja
1028     @brief ¥ê¥Ð¡¼¥¹¥Ó¥Ç¥ª¥Õ¥§¡¼¥¹.
1029
1030     ÊÑ¿ô #mface_reverse_video ¤Ï #Mvideomode ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 
1031     #Mreverse ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1032     ¤³¤Î¥Õ¥§¡¼¥¹¤Çɽ¼¨¤µ¤ì¤ëM-text 
1033     ¤ÏÁ°·Ê¿§¤ÈÇØ·Ê¿§¤¬Æþ¤ìÂؤï¤Ã¤Æ (¤¹¤Ê¤ï¤ÁÁ°·Ê¤ÏÇØ·Ê¿§¡¢ÇطʤÏÁ°·Ê¿§¡ËÉÁ¤«¤ì¤ë¡£  */
1034
1035 MFace *mface_reverse_video;
1036
1037 /***en
1038     @brief Underline face.
1039
1040     The variable #mface_underline points to a face that has the
1041     #Mhline property with value a pointer to an object of type
1042     #MFaceHLineProp.  The members of the object are as follows:
1043
1044 @verbatim
1045     member  value
1046     -----   -----
1047     type    MFACE_HLINE_UNDER
1048     width   1
1049     color   Mnil
1050 @endverbatim
1051
1052     The other properties are not specified.  An M-text that has this
1053     face is drawn with an underline.  */ 
1054 /***ja
1055     @brief ²¼Àþ¥Õ¥§¡¼¥¹.
1056
1057     ÊÑ¿ô #mface_underline ¤Ï #Mhline ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ #MFaceHLineProp 
1058     ·¿¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£¥ª¥Ö¥¸¥§¥¯¥È¤Î¥á¥ó¥Ð¤Ï°Ê²¼¤ÎÄ̤ꡣ
1059
1060 @verbatim
1061     ¥á¥ó¥Ð  ÃÍ
1062     -----   -----
1063     type    MFACE_HLINE_UNDER
1064     width   1
1065     color   Mnil
1066 @endverbatim
1067
1068     Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ï²¼ÀþÉÕ¤­¤Çɽ¼¨¤µ¤ì¤ë¡£*/ 
1069
1070 MFace *mface_underline;
1071
1072 /***en
1073     @brief Medium face.
1074
1075     The variable #mface_medium points to a face that has the #Mweight
1076     property with value a symbol of name "medium".  The other
1077     properties are not specified.  An M-text that has this face is
1078     drawn with a font of medium weight.  */
1079 /***ja
1080     @brief ¥ß¥Ç¥£¥¢¥à¥Õ¥§¡¼¥¹.
1081
1082     ÊÑ¿ô #mface_medium ¤Ï #Mweight ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "medium" 
1083     ¤È¤¤¤¦Ì¾Á°¤ò¤â¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1084     Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text
1085     ¤Ï¡¢¥ß¥Ç¥£¥¢¥à¥¦¥§¥¤¥È¤Î¥Õ¥©¥ó¥È¤Çɽ¼¨¤µ¤ì¤ë¡£  */
1086 MFace *mface_medium;
1087
1088 /***en
1089     @brief Bold face.
1090
1091     The variable #mface_bold points to a face that has the #Mweight
1092     property with value a symbol of name "bold".  The other properties
1093     are not specified.  An M-text that has this face is drawn with a
1094     font of bold weight.  */
1095 /***ja
1096     @brief ¥Ü¡¼¥ë¥É¥Õ¥§¡¼¥¹.
1097
1098     ÊÑ¿ô #mface_bold ¤Ï #Mweight ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "bold" 
1099     ¤È¤¤¤¦Ì¾Á°¤ò¤â¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1100     Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text 
1101     ¤Ï¡¢¥Ü¡¼¥ë¥É¥Õ¥©¥ó¥È¤Çɽ¼¨¤µ¤ì¤ë¡£    */
1102
1103 MFace *mface_bold;
1104
1105 /***en
1106     @brief Italic face.
1107
1108     The variable #mface_italic points to a face that has the #Mstyle
1109     property with value a symbol of name "italic".  The other
1110     properties are not specified.  An M-text that has this face is
1111     drawn with a font of italic style.  */
1112 /***ja
1113     @brief ¥¤¥¿¥ê¥Ã¥¯¥Õ¥§¡¼¥¹.
1114
1115     ÊÑ¿ô #mface_italic ¤Ï #Mstyle ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "italic" 
1116     ¤È¤¤¤¦Ì¾Á°¤ò¤â¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1117     Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text
1118     ¤Ï¡¢¥¤¥¿¥ê¥Ã¥¯ÂΤÇɽ¼¨¤µ¤ì¤ë¡£    */
1119
1120 MFace *mface_italic;
1121
1122 /***en
1123     @brief Bold italic face.
1124
1125     The variable #mface_bold_italic points to a face that has the
1126     #Mweight property with value a symbol of name "bold", and #Mstyle
1127     property with value a symbol of name "italic".  The other
1128     properties are not specified.  An M-text that has this face is
1129     drawn with a font of bold weight and italic style.  */
1130 /***ja
1131     @brief ¥Ü¡¼¥ë¥É¥¤¥¿¥ê¥Ã¥¯¥Õ¥§¡¼¥¹.
1132
1133     ÊÑ¿ô #mface_bold_italic ¤Ï¡¢#Mweight ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "bold" 
1134     ¤È¤¤¤¦Ì¾Á°¤ò¤â¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ê¡¢¤«¤Ä #Mstyle ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "italic" 
1135     ¤È¤¤¤¦Ì¾Á°¤ò¤â¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1136     Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text 
1137     ¤Ï¡¢¥Ü¡¼¥ë¥É¥¤¥¿¥ê¥Ã¥¯ÂΤÇɽ¼¨¤µ¤ì¤ë¡£    */
1138
1139 MFace *mface_bold_italic;
1140
1141 /***en
1142     @brief Smallest face.
1143
1144     The variable #mface_xx_small points to a face that has the #Mratio
1145     property with value 50.  The other properties are not specified.
1146     An M-text that has this face is drawn with a font whose size is
1147     50% of a normal font.  */
1148 /***ja
1149     @brief ºÇ¾®¤Î¥Õ¥§¡¼¥¹.
1150
1151     ÊÑ¿ô #mface_xx_small ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 50 
1152     ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1153     ¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ïɸ½à¥Õ¥©¥ó¥È¤Î 50% ¤ÎÂ礭¤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1154      */
1155
1156 MFace *mface_xx_small;
1157
1158 /***en
1159     @brief Smaller face.
1160
1161     The variable #mface_x_small points to a face that has the #Mratio
1162     property with value 66.  The other properties are not specified.
1163     An M-text that has this face is drawn with a font whose size is
1164     66% of a normal font.  */
1165 /***ja
1166     @brief ¤è¤ê¾®¤µ¤¤¥Õ¥§¡¼¥¹.
1167
1168     ÊÑ¿ô #mface_x_small ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 66 
1169     ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1170     ¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ïɸ½à¥Õ¥©¥ó¥È¤Î 66% ¤ÎÂ礭¤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1171      */
1172
1173 MFace *mface_x_small;
1174
1175 /***en
1176     @brief Small face.
1177
1178     The variable #mface_x_small points to a face that has the #Mratio
1179     property with value 75.  The other properties are not specified.
1180     An M-text that has this face is drawn with a font whose size is
1181     75% of a normal font.  */
1182 /***ja
1183     @brief ¾®¤µ¤¤¥Õ¥§¡¼¥¹.
1184
1185     ÊÑ¿ô #mface_small ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 75 
1186     ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1187     ¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ïɸ½à¥Õ¥©¥ó¥È¤Î 75% ¤ÎÂ礭¤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1188      */
1189
1190 MFace *mface_small;
1191
1192 /***en
1193     @brief Normalsize face.
1194
1195     The variable #mface_normalsize points to a face that has the
1196     #Mratio property with value 100.  The other properties are not
1197     specified.  An M-text that has this face is drawn with a font
1198     whose size is the same as a normal font.  */
1199 /***ja
1200     @brief É¸½à¤ÎÂ礭¤µ¤Î¥Õ¥§¡¼¥¹.
1201
1202     ÊÑ¿ô #mface_normalsize ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 100 
1203     ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1204     ¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ïɸ½à¥Õ¥©¥ó¥È¤ÈƱ¤¸Â礭¤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1205      */
1206
1207 MFace *mface_normalsize;
1208
1209 /***en
1210     @brief Large face.
1211
1212     The variable #mface_large points to a face that has the #Mratio
1213     property with value 120.  The other properties are not specified.
1214     An M-text that has this face is drawn with a font whose size is
1215     120% of a normal font.  */
1216 /***ja
1217     @brief Â礭¤¤¥Õ¥§¡¼¥¹.
1218
1219     ÊÑ¿ô #mface_large ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 120 
1220     ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1221     ¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ïɸ½à¥Õ¥©¥ó¥È¤Î 120% ¤ÎÂ礭¤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1222      */
1223
1224 MFace *mface_large;
1225
1226 /***en
1227     @brief Larger face.
1228
1229     The variable #mface_x_large points to a face that has the #Mratio
1230     property with value 150.  The other properties are not specified.
1231     An M-text that has this face is drawn with a font whose size is
1232     150% of a normal font.  */
1233 /***ja
1234     @brief ¤â¤Ã¤ÈÂ礭¤¤¥Õ¥§¡¼¥¹.
1235
1236     ÊÑ¿ô #mface_x_large ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 150 
1237     ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1238     ¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ïɸ½à¥Õ¥©¥ó¥È¤Î 150% ¤ÎÂ礭¤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1239      */
1240
1241 MFace *mface_x_large;
1242
1243 /***en
1244     @brief Largest face.
1245
1246     The variable #mface_xx_large points to a face that has the #Mratio
1247     property with value 200.  The other properties are not specified.
1248     An M-text that has this face is drawn with a font whose size is
1249     200% of a normal font.  */
1250 /***ja
1251     @brief ºÇÂç¤Î¥Õ¥§¡¼¥¹.
1252
1253     ÊÑ¿ô #mface_xx_large ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 200 
1254     ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1255     ¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ïɸ½à¥Õ¥©¥ó¥È¤Î 200% ¤ÎÂ礭¤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1256      */
1257
1258 MFace *mface_xx_large;
1259
1260 /***en
1261     @brief Black face.
1262
1263     The variable #mface_black points to a face that has the
1264     #Mforeground property with value a symbol of name "black".  The
1265     other properties are not specified.  An M-text that has this face
1266     is drawn with black foreground.  */
1267 /***ja 
1268     @brief ¹õ¥Õ¥§¡¼¥¹.
1269
1270     ÊÑ¿ô #mface_black ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "black" 
1271     ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1272     Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text 
1273     ¤ÏÁ°·Ê¿§¤È¤·¤Æ¹õ¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£     */
1274
1275 MFace *mface_black;
1276
1277 /***en
1278     @brief White face.
1279
1280     The variable #mface_white points to a face that has the
1281     #Mforeground property with value a symbol of name "white".  The
1282     other properties are not specified.  An M-text that has this face
1283     is drawn with white foreground.  */
1284 /***ja
1285     @brief Çò¥Õ¥§¡¼¥¹.
1286
1287     ÊÑ¿ô #mface_white ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "white" 
1288     ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1289     Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text 
1290     ¤ÏÁ°·Ê¿§¤È¤·¤ÆÇò¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£     */
1291
1292 MFace *mface_white;
1293
1294 /***en
1295     @brief Red face.
1296
1297     The variable #mface_red points to a face that has the
1298     #Mforeground property with value a symbol of name "red".  The
1299     other properties are not specified.  An M-text that has this face
1300     is drawn with red foreground.  */
1301 /***ja
1302     @brief ÀÖ¥Õ¥§¡¼¥¹.
1303
1304     ÊÑ¿ô #mface_red ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "red" 
1305     ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1306     Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text 
1307     ¤ÏÁ°·Ê¿§¤È¤·¤ÆÀÖ¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£  */
1308
1309 MFace *mface_red;
1310
1311 /***en
1312     @brief Green face.
1313
1314     The variable #mface_green points to a face that has the
1315     #Mforeground property with value a symbol of name "green".  The
1316     other properties are not specified.  An M-text that has this face
1317     is drawn with green foreground.  */
1318 /***ja
1319     @brief ÎÐ¥Õ¥§¡¼¥¹.
1320
1321     ÊÑ¿ô #mface_green ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "green" 
1322     ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1323     Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text 
1324     ¤ÏÁ°·Ê¿§¤È¤·¤ÆÎФòÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£  */
1325
1326 MFace *mface_green;
1327
1328 /***en
1329     @brief Blue face.
1330
1331     The variable #mface_blue points to a face that has the
1332     #Mforeground property with value a symbol of name "blue".  The
1333     other properties are not specified.  An M-text that has this face
1334     is drawn with blue foreground.  */
1335 /***ja
1336     @brief ÀÄ¥Õ¥§¡¼¥¹.
1337
1338     ÊÑ¿ô #mface_blue ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "blue" 
1339     ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1340     Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text 
1341     ¤ÏÁ°·Ê¿§¤È¤·¤ÆÀĤòÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£  */
1342
1343 MFace *mface_blue;
1344
1345 /***en
1346     @brief Cyan face.
1347
1348     The variable #mface_cyan points to a face that has the
1349     #Mforeground property with value a symbol of name "cyan".  The
1350     other properties are not specified.  An M-text that has this face
1351     is drawn with cyan foreground.  */
1352 /***ja
1353     @brief ¥·¥¢¥ó¥Õ¥§¡¼¥¹.
1354
1355     ÊÑ¿ô #mface_cyan ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "cyan"
1356     ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1357     Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text 
1358     ¤ÏÁ°·Ê¿§¤È¤·¤Æ¥·¥¢¥ó¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£  */
1359
1360 MFace *mface_cyan;
1361
1362 /***en
1363     @brief yellow face.
1364
1365     The variable #mface_yellow points to a face that has the
1366     #Mforeground property with value a symbol of name "yellow".  The
1367     other properties are not specified.  An M-text that has this face
1368     is drawn with yellow foreground.  */
1369
1370 /***ja
1371     @brief ²«¥Õ¥§¡¼¥¹.
1372
1373     ÊÑ¿ô #mface_yellow ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "yellow" 
1374     ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1375     Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text 
1376     ¤ÏÁ°·Ê¿§¤È¤·¤Æ²«¿§¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£  */
1377
1378 MFace *mface_yellow;
1379
1380 /***en
1381     @brief Magenta face.
1382
1383     The variable #mface_magenta points to a face that has the
1384     #Mforeground property with value a symbol of name "magenta".  The
1385     other properties are not specified.  An M-text that has this face
1386     is drawn with magenta foreground.  */
1387
1388 /***ja
1389     @brief ¥Þ¥¼¥ó¥¿¥Õ¥§¡¼¥¹.
1390
1391     ÊÑ¿ô #mface_magenta ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ 
1392     "magenta" ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1393     Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text 
1394     ¤ÏÁ°·Ê¿§¤È¤·¤Æ¥Þ¥¼¥ó¥¿¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£  */
1395
1396 MFace *mface_magenta;
1397
1398 /*** @} */
1399 /*=*/
1400
1401 /***en @name Variables: The other symbols for face handling.  */
1402 /***ja @name ÊÑ¿ô: ¥Õ¥§¡¼¥¹¤ò¼è¤ê°·¤¦¤¿¤á¤Î¤½¤Î¾¤Î¥·¥ó¥Ü¥ë  */
1403 /*** @{ */
1404 /*=*/
1405
1406 /***en
1407     @brief Key of a text property specifying a face.
1408
1409     The variable #Mface is a symbol of name <tt>"face"</tt>.  A text
1410     property whose key is this symbol must have a pointer to an object
1411     of type #MFace.  This is a managing key.  */
1412
1413 /***ja
1414     @brief ¥Õ¥§¡¼¥¹¤ò»ØÄꤹ¤ë¥Æ¥­¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Î¥­¡¼.
1415
1416     ÊÑ¿ô #Mface ¤Ï <tt>"face"</tt> 
1417     ¤È¤¤¤¦Ì¾Á°¤ò»ý¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¡£¤³¤Î¥·¥ó¥Ü¥ë¤ò¥­¡¼¤È¤¹¤ë¥Æ¥­¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Ï¡¢
1418     #MFace ·¿¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
1419     ¤³¤ì¤Ï´ÉÍý¥­¡¼¤Ç¤¢¤ë¡£  */
1420
1421 MSymbol Mface;
1422 /*=*/
1423 /*** @} */
1424 /*=*/
1425
1426 /***en
1427     @brief Create a new face.
1428
1429     The mface () function creates a new face object that specifies no
1430     property.
1431
1432     @return
1433     This function returns a pointer to the created face.  */
1434
1435 /***ja
1436     @brief ¿·¤·¤¤¥Õ¥§¡¼¥¹¤ò¤Ä¤¯¤ë.
1437
1438     ´Ø¿ô mface () 
1439     ¤Ï¥×¥í¥Ñ¥Æ¥£¤ò°ìÀÚ»ý¤¿¤Ê¤¤¿·¤·¤¤¥Õ¥§¡¼¥¹¥ª¥Ö¥¸¥§¥¯¥È¤òºî¤ë¡£
1440
1441     @return
1442     ¤³¤Î´Ø¿ô¤Ïºî¤Ã¤¿¥Õ¥§¡¼¥¹¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£  */
1443
1444 MFace *
1445 mface ()
1446 {
1447   MFace *face;
1448
1449   M17N_OBJECT (face, free_face, MERROR_FACE);
1450   face->frame_list = mplist ();
1451   M17N_OBJECT_REGISTER (face_table, face);
1452   return face;
1453 }
1454
1455 /*=*/
1456
1457 /***en
1458     @brief Make a copy of a face.
1459
1460     The mface_copy () function makes a copy of $FACE and returns a
1461     pointer to the created copy.  */
1462
1463 /***ja
1464     @brief ¥Õ¥§¡¼¥¹¤Î¥³¥Ô¡¼¤òºî¤ë.
1465
1466     ´Ø¿ô mface_copy () ¤Ï¥Õ¥§¡¼¥¹ $FACE 
1467     ¤Î¥³¥Ô¡¼¤òºî¤ê¡¢¤½¤Î¥³¥Ô¡¼¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£  */
1468
1469 MFace *
1470 mface_copy (MFace *face)
1471 {
1472   MFace *copy;
1473
1474   MSTRUCT_CALLOC (copy, MERROR_FACE);
1475   *copy = *face;
1476   copy->control.ref_count = 1;
1477   M17N_OBJECT_REGISTER (face_table, copy);
1478   copy->frame_list = mplist ();
1479   if (copy->property[MFACE_FONTSET])
1480     M17N_OBJECT_REF (copy->property[MFACE_FONTSET]);
1481   return copy;
1482 }
1483
1484 /*=*/
1485 /***en
1486     @brief Merge faces.
1487
1488     The mface_merge () functions merges the properties of face $SRC
1489     into $DST.
1490
1491     @return
1492     This function returns $DST.  */
1493
1494 /***ja
1495     @brief ¥Õ¥§¡¼¥¹¤òÅý¹ç¤¹¤ë.
1496
1497     ´Ø¿ô mface_merge () ¤Ï¡¢¥Õ¥§¡¼¥¹ $SRC ¤Î¥×¥í¥Ñ¥Æ¥£¤ò¥Õ¥§¡¼¥¹ $DST 
1498     ¤ËÅý¹ç¤¹¤ë¡£
1499
1500     @return
1501     ¤³¤Î´Ø¿ô¤Ï $DST ¤òÊÖ¤¹¡£  */
1502
1503 MFace *
1504 mface_merge (MFace *dst, MFace *src)
1505 {
1506   int i;
1507   MPlist *plist;
1508
1509   for (i = 0; i < MFACE_PROPERTY_MAX; i++)
1510     if (src->property[i])
1511       {
1512         if (i == MFACE_FONTSET)
1513           {
1514             M17N_OBJECT_UNREF (dst->property[i]);
1515             M17N_OBJECT_REF (src->property[i]);
1516           }
1517         dst->property[i] = src->property[i];
1518       }
1519
1520   MPLIST_DO (plist, dst->frame_list)
1521     {
1522       MFrame *frame = MPLIST_VAL (plist);
1523
1524       frame->tick++;
1525       if (dst == frame->face)
1526         mface__update_frame_face (frame);
1527     }
1528
1529   return dst;
1530 }
1531
1532 /*=*/
1533
1534 /***en
1535     @brief Make a face from a font.
1536
1537     The mface_from_font () function return a newly created face while
1538     reflecting the properties of $FONT in its properties.   */
1539
1540 /***ja
1541     @brief ¥Õ¥©¥ó¥È¤«¤é¥Õ¥§¡¼¥¹¤òºî¤ë.
1542
1543     ´Ø¿ô mface_from_font () ¤Ï¥Õ¥©¥ó¥È $FONT 
1544     ¤Î¥×¥í¥Ñ¥Æ¥£¤ò¥×¥í¥Ñ¥Æ¥£¤È¤·¤Æ»ý¤Ä¿·¤·¤¤¥Õ¥§¡¼¥¹¤òºî¤ê¡¢¤½¤ì¤òÊÖ¤¹¡£  */
1545
1546 MFace *
1547 mface_from_font (MFont *font)
1548 {
1549   MFace *face = mface ();
1550
1551   face->property[MFACE_FOUNDRY] = mfont_get_prop (font, Mfoundry);
1552   face->property[MFACE_FAMILY] = mfont_get_prop (font, Mfamily);
1553   face->property[MFACE_WEIGHT] = mfont_get_prop (font, Mweight);
1554   face->property[MFACE_STYLE] = mfont_get_prop (font, Mstyle);
1555   face->property[MFACE_STRETCH] = mfont_get_prop (font, Mstretch);
1556   face->property[MFACE_ADSTYLE] = mfont_get_prop (font, Madstyle);
1557   face->property[MFACE_SIZE] = mfont_get_prop (font, Msize);
1558   return face;
1559 }
1560
1561 /*=*/
1562
1563 /***en
1564     @brief Get the value of a face property.
1565
1566     The mface_get_prop () function returns the value of the face
1567     property whose key is $KEY in face $FACE.  $KEY must be one of the
1568     followings:
1569
1570         #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
1571         #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
1572         #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg
1573
1574     @return
1575     The actual type of the returned value depends of $KEY.  See
1576     documentation of the above keys.  If an error is detected, it
1577     returns @c NULL and assigns an error code to the external variable
1578     #merror_code.  */
1579
1580 /***ja
1581     @brief ¥Õ¥§¡¼¥¹¤Î¥×¥í¥Ñ¥Æ¥£¤ÎÃͤòÆÀ¤ë.
1582
1583     ´Ø¿ô mface_get_prop () ¤Ï¡¢¥Õ¥§¡¼¥¹ $FACE 
1584     ¤¬»ý¤Ä¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÆâ¡¢¥­¡¼¤¬ $KEY ¤Ç¤¢¤ë¤â¤Î¤ÎÃͤòÊÖ¤¹¡£
1585     $KEY ¤Ï²¼µ­¤Î¤¤¤º¤ì¤«¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
1586
1587         #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
1588         #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
1589         #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg
1590
1591     @return 
1592     Ìá¤êÃͤη¿¤Ï $KEY ¤Ë°Í¸¤¹¤ë¡£¾åµ­¤Î¥­¡¼¤ÎÀâÌÀ¤ò»²¾È¤¹¤ë¤³¤È¡£
1593     ¥¨¥é¡¼¤¬¸¡½Ð¤µ¤ì¤¿¾ì¹ç¤Ï @c NULL ¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô #merror_code 
1594     ¤Ë¥¨¥é¡¼¥³¡¼¥É¤òÀßÄꤹ¤ë¡£  */
1595
1596 /***
1597     @seealso
1598     mface_put_prop ()
1599
1600     @errors
1601     @c MERROR_FACE  */
1602
1603 void *
1604 mface_get_prop (MFace *face, MSymbol key)
1605 {
1606   int index = (int) msymbol_get (key, M_face_prop_index) - 1;
1607
1608   if (index < 0)
1609     MERROR (MERROR_FACE, NULL);
1610   return face->property[index];
1611 }
1612
1613 /*=*/
1614
1615 /***en
1616     @brief Set a value of a face property.
1617
1618     The mface_put_prop () function assigns $VAL to the property whose
1619     key is $KEY in face $FACE.  $KEY must be one the followings:
1620
1621         #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
1622         #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
1623         #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg
1624
1625     Among them, font related properties (#Mfoundry through #Msize) are
1626     used as the default values when a font in the fontset of $FACE
1627     does not specify those values.
1628
1629     The actual type of the returned value depends of $KEY.  See
1630     documentation of the above keys.
1631
1632     @return
1633     If the operation was successful, mface_put_prop () returns 0.
1634     Otherwise it returns -1 and assigns an error code to the external
1635     variable #merror_code.  */
1636
1637 /***ja
1638     @brief ¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤòÀßÄꤹ¤ë.
1639
1640     ´Ø¿ô mface_put_prop () ¤Ï¡¢¥Õ¥§¡¼¥¹ $FACE Æâ¤Ç¥­¡¼¤¬ $KEY 
1641     ¤Ç¤¢¤ë¥×¥í¥Ñ¥Æ¥£¤ÎÃͤò $VAL ¤ËÀßÄꤹ¤ë¡£$KEY 
1642     ¤Ï°Ê²¼¤Î¤¤¤º¤ì¤«¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
1643
1644         #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
1645         #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
1646         #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg.
1647
1648     ¤³¤ì¤é¤Î¤¦¤Á¤Î¡¢¥Õ¥©¥ó¥È´ØÏ¢¤Î¥×¥í¥Ñ¥Æ¥£ (#Mfamily ¤«¤é #Msize 
1649     ¤Þ¤Ç) ¤Ï¡¢¥Õ¥§¡¼¥¹¤Î¥Õ¥©¥ó¥È¥»¥Ã¥ÈÃæ¤Î¥Õ¥©¥ó¥È¤Ë´Ø¤¹¤ë¥Ç¥Õ¥©¥ë¥ÈÃͤȤʤꡢ¸Ä¡¹¤Î¥Õ¥©¥ó¥È¤¬Ãͤò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¤ËÍѤ¤¤é¤ì¤ë¡£
1650
1651     Ìá¤êÃͤη¿¤Ï $KEY ¤Ë°Í¸¤¹¤ë¡£¾åµ­¤Î¥­¡¼¤ÎÀâÌÀ¤ò»²¾È¤¹¤ë¤³¤È¡£
1652
1653     @return
1654     ½èÍý¤¬À®¸ù¤·¤¿¾ì¹ç¡¢mface_put_prop () ¤Ï 0 ¤òÊÖ¤¹¡£¼ºÇÔ¤·¤¿¾ì¹ç¤Ï 
1655     -1 ¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô #merror_code ¤Ë¥¨¥é¡¼¥³¡¼¥É¤òÀßÄꤹ¤ë¡£  */
1656
1657 /***
1658     @seealso
1659     mface_get_prop ()
1660
1661     @errors
1662     @c MERROR_FACE  */
1663
1664 int
1665 mface_put_prop (MFace *face, MSymbol key, void *val)
1666 {
1667   int index = (int) msymbol_get (key, M_face_prop_index) - 1;
1668   MPlist *plist;
1669
1670   if (index < 0)
1671     MERROR (MERROR_FACE, -1);
1672   if (key == Mfontset)
1673     {
1674       if (face->property[index])
1675         M17N_OBJECT_UNREF (face->property[index]);
1676       M17N_OBJECT_REF (val);
1677     }
1678   else if (key == Mhline)
1679     val = get_hline_create (val);
1680   else if (key == Mbox)
1681     val = get_box_create (val);
1682
1683   if (face->property[index] == val)
1684     return 0;
1685   face->property[index] = val;
1686
1687   MPLIST_DO (plist, face->frame_list)
1688     {
1689       MFrame *frame = MPLIST_VAL (plist);
1690
1691       frame->tick++;
1692       if (face == frame->face)
1693         mface__update_frame_face (frame);
1694     }
1695
1696   return 0;
1697 }
1698
1699 /*=*/
1700
1701 /***en
1702     @brief Update a face.
1703
1704     The mface_update () function update face $FACE on frame $FRAME by
1705     calling a hook function of $FACE (if any).  */
1706
1707 /***ja
1708     @brief ¥Õ¥§¡¼¥¹¤ò¹¹¿·¤¹¤ë.
1709
1710     ´Ø¿ô mface_update () ¤Ï¥Õ¥ì¡¼¥à $FRAME ¤Î¥Õ¥§¡¼¥¹ $FACE ¤ò $FACE 
1711     ¤Î¥Õ¥Ã¥¯´Ø¿ô¤ò¡Ê¤¢¤ì¤Ð¡Ë¸Æ¤ó¤Ç¹¹¿·¤¹¤ë¡£  */
1712
1713 void
1714 mface_update (MFrame *frame, MFace *face)
1715 {
1716   MFaceHookFunc func = (MFaceHookFunc) face->property[MFACE_HOOK_FUNC];
1717   MPlist *rface_list;
1718   MRealizedFace *rface;
1719
1720   if (func && func != noop_hook)
1721     {
1722       MPLIST_DO (rface_list, frame->realized_face_list)
1723         {
1724           rface = MPLIST_VAL (rface_list);
1725           if ((MFaceHookFunc) rface->face.property[MFACE_HOOK_FUNC] == func)
1726             (func) (&(rface->face), rface->face.property[MFACE_HOOK_ARG],
1727                     rface->info);
1728         }
1729     }
1730 }
1731 /*=*/
1732
1733 /*** @} */
1734 /*=*/
1735
1736 /*** @addtogroup m17nDebug */
1737 /*** @{  */
1738 /*=*/
1739
1740 /***en
1741     @brief Dump a face.
1742
1743     The mdebug_dump_face () function prints face $FACE in a human readable
1744     way to the stderr.  $INDENT specifies how many columns to indent
1745     the lines but the first one.
1746
1747     @return
1748     This function returns $FACE.  */
1749
1750 /***ja
1751     @brief ¥Õ¥§¡¼¥¹¤ò¥À¥ó¥×¤¹¤ë.
1752
1753     ´Ø¿ô mdebug_dump_face () ¤Ï¥Õ¥§¡¼¥¹ $FACE ¤ò stderr 
1754     ¤Ë¿Í´Ö¤Ë²ÄÆɤʷÁ¤Ç°õºþ¤¹¤ë¡£ $INDENT ¤Ï£²¹ÔÌܰʹߤΥ¤¥ó¥Ç¥ó¥È¤ò»ØÄꤹ¤ë¡£
1755
1756     @return
1757     ¤³¤Î´Ø¿ô¤Ï $FACE ¤òÊÖ¤¹¡£  */
1758
1759 MFace *
1760 mdebug_dump_face (MFace *face, int indent)
1761 {
1762   char *prefix = (char *) alloca (indent + 1);
1763   MFont spec;
1764
1765   memset (prefix, 32, indent);
1766   prefix[indent] = 0;
1767   mfont__set_spec_from_face (&spec, face);
1768   fprintf (stderr, "(face font:\"");
1769   mdebug_dump_font (&spec);
1770   fprintf (stderr, "\"\n %s  fore:%s back:%s", prefix,
1771            msymbol_name ((MSymbol) face->property[MFACE_FOREGROUND]),
1772            msymbol_name ((MSymbol) face->property[MFACE_BACKGROUND]));
1773   if (face->property[MFACE_FONTSET])
1774     fprintf (stderr, " non-default-fontset");
1775   fprintf (stderr, " hline:%s", face->property[MFACE_HLINE] ? "yes" : "no");
1776   fprintf (stderr, " box:%s)", face->property[MFACE_BOX] ? "yes" : "no");
1777   return face;
1778 }
1779
1780 /*** @} */
1781
1782 /*
1783   Local Variables:
1784   coding: euc-japan
1785   End:
1786 */