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