1 /* face.c -- face module.
2 Copyright (C) 2003, 2004
3 National Institute of Advanced Industrial Science and Technology (AIST)
4 Registration Number H15PRO112
6 This file is part of the m17n library.
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.
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.
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
25 @brief A face is an object to control appearance of M-text.
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:
32 #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
33 #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
34 #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg
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".
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.
44 If there are multiple text properties whose key is @c Mface, and
45 they are not conflicting one another, properties of those faces
48 If no faces specify a certain property, the value of the default
53 @brief ¥Õ¥§¡¼¥¹¤È¤Ï¡¢M-text ¤Î¸«±É¤¨¤òÀ©¸æ¤¹¤ë¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤¢¤ë.
55 @e ¥Õ¥§¡¼¥¹ ¤Ï #MFace ·¿¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤¢¤ê¡¢M-text ¤Îɽ¼¨ÊýË¡
56 ¤òÀ©¸æ¤¹¤ë¡£¥Õ¥§¡¼¥¹¤Ï¸ÇÄê¸Ä¿ô¤Î @e ¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£ ¤ò»ý¤Ä¡£
57 ¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Ï¥¡¼¤ÈÃͤ«¤é¤Ê¤ë¡£¥¡¼¤Ï°Ê²¼¤Î¥·¥ó¥Ü¥ë¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë¡£
59 #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
60 #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
61 #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg
63 ¡Ö¥Õ¥§¡¼¥¹ F ¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¤¦¤Á¥¡¼¤¬ @c Mxxx ¤Ç¤¢¤ë¤â¤Î¡×
64 ¤Î¤³¤È¤ò´Êñ¤Ë¡ÖF ¤Î xxx ¥×¥í¥Ñ¥Æ¥£¡×¤È¸Æ¤Ö¤³¤È¤¬¤¢¤ë¡£
66 M-text ¤Îɽ¼¨´Ø¿ô¤Ï¡¢¤Þ¤ººÇ½é¤Ë¤½¤Î M-text ¤«¤é¥¡¼¤¬¥·¥ó¥Ü¥ë
67 #Mface ¤Ç¤¢¤ë¤è¤¦¤Ê¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤òõ¤·¡¢¼¡¤Ë¤½¤ÎÃͤ˽¾¤Ã¤Æ
68 M-text ¤òɽ¼¨¤¹¤ë¡£¤³¤ÎÃͤϥե§¡¼¥¹¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±
71 M-text ¤¬¡¢#Mface ¤ò¥¡¼¤È¤¹¤ë¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤òÊ£¿ô»ý¤Ã¤Æ¤ª¤ê¡¢
72 ¤«¤Ä¤½¤ì¤é¤ÎÃͤδ֤˾×Æͤ¬¤Ê¤¤¤Ê¤é¤Ð¡¢¥Õ¥§¡¼¥¹¾ðÊó¤ÏÁȤ߹ç¤ï¤µ¤ì¤Æ
75 ¤¢¤ë¥Æ¥¥¹¥È°À¤¬¤É¤Î¥Õ¥§¡¼¥¹¤Ë¤è¤Ã¤Æ¤â»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢¥Ç
76 ¥Õ¥©¥ë¥È¥Õ¥§¡¼¥¹¤ÎÃͤ¬ÍѤ¤¤é¤ì¤ë¡£ */
80 #if !defined (FOR_DOXYGEN) || defined (DOXYGEN_INTERNAL_MODULE)
81 /*** @addtogroup m17nInternal
91 #include "m17n-misc.h"
98 #include "internal-gui.h"
103 static M17NObjectArray face_table;
107 static MSymbol M_face_prop_index;
109 static MPlist *hline_prop_list;
110 static MPlist *box_prop_list;
112 /** Special hook function pointer that does nothing. */
113 static MFaceHookFunc noop_hook;
116 static MFaceHLineProp *
117 get_hline_create (MFaceHLineProp *prop)
120 MFaceHLineProp *hline;
122 if (prop->width == 0)
123 return MPLIST_VAL (hline_prop_list);
124 MPLIST_DO (plist, MPLIST_NEXT (hline_prop_list))
126 hline = MPLIST_VAL (plist);
127 if (prop->type == hline->type
128 && prop->width == hline->width
129 && prop->color == hline->color)
132 MSTRUCT_MALLOC (hline, MERROR_FACE);
134 mplist_push (plist, Mt, hline);
138 static MFaceBoxProp *
139 get_box_create (MFaceBoxProp *prop)
144 if (prop->width == 0)
145 return MPLIST_VAL (box_prop_list);
146 MPLIST_DO (plist, MPLIST_NEXT (box_prop_list))
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)
160 MSTRUCT_MALLOC (box, MERROR_FACE);
162 mplist_push (plist, Mt, box);
166 /** From FRAME->realized_face_list, find a realized face based on
169 static MRealizedFace *
170 find_realized_face (MFrame *frame, MFace *face)
174 MPLIST_DO (plist, frame->realized_face_list)
176 MRealizedFace *rface = MPLIST_VAL (plist);
178 if (memcmp (rface->face.property, face->property, sizeof face->property)
186 free_face (void *object)
188 MFace *face = (MFace *) object;
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);
199 serialize_hline (MPlist *plist, MFaceHLineProp *hline)
201 if (hline->width > 0)
203 MPlist *pl = mplist ();
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);
215 serialize_box (MPlist *plist, MFaceBoxProp *box)
219 MPlist *pl = mplist ();
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);
237 serialize_face (void *val)
240 MPlist *plist = mplist (), *pl = plist;
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 },
255 { &Mforeground, &Msymbol },
256 { &Mbackground, &Msymbol },
259 { &Mvideomode, &Msymbol },
260 { NULL, NULL}, /* MFACE_HOOK_FUNC */
261 { NULL, NULL}, /* MFACE_HOOK_ARG */
262 { &Mratio, &Minteger } };
264 for (i = 0; i < MFACE_PROPERTY_MAX; i++)
265 if (face->property[i] && serializer[i].key)
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 *)
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]);
283 deserialize_hline (MPlist *plist)
285 MFaceHLineProp hline, *hline_ret;
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);
304 deserialize_box (MPlist *plist)
306 MFaceBoxProp box, *box_ret;
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);
349 deserialize_face (MPlist *plist)
351 MFace *face = mface ();
353 MPLIST_DO (plist, plist)
359 if (! MPLIST_SYMBOL_P (plist))
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))
366 if (index < 0 || index >= MFACE_PROPERTY_MAX)
368 if (key == Mfoundry || key == Mfamily || key == Mweight || key == Mstyle
369 || key == Mstretch || key == Madstyle
370 || key == Mforeground || key == Mbackground || key == Mvideomode)
372 if (! MPLIST_SYMBOL_P (plist))
374 val = MPLIST_VAL (plist);
376 else if (key == Msize || key == Mratio)
378 if (! MPLIST_INTEGER_P (plist))
380 val = MPLIST_VAL (plist);
382 else if (key == Mfontset)
384 if (! MPLIST_SYMBOL_P (plist))
386 val = mfontset (MSYMBOL_NAME (MPLIST_SYMBOL (plist)));
388 else if (key == Mhline)
390 if (! MPLIST_PLIST_P (plist))
392 val = deserialize_hline (MPLIST_PLIST (plist));
394 else if (key == Mbox)
396 if (! MPLIST_PLIST_P (plist))
398 val = deserialize_box (MPLIST_PLIST (plist));
400 face->property[index] = val;
405 static MGlyphString work_gstring;
411 MFace *mface__default;
417 MFaceHLineProp *hline;
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);
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");
436 Mlatin = msymbol ("latin");
437 M_face_prop_index = msymbol (" face-prop-index");
441 /* Pointer to the key symbol of the face property. */
443 /* Index (enum face_property) of the face property. */
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 },
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));
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);
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;
493 mface_normal_video = mface ();
494 mface_normal_video->property[MFACE_VIDEOMODE] = (void *) Mnormal;
496 mface_reverse_video = mface ();
497 mface_reverse_video->property[MFACE_VIDEOMODE] = (void *) Mreverse;
500 MFaceHLineProp hline_prop;
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);
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];
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;
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");
551 work_gstring.glyphs = malloc (sizeof (MGlyph) * 2);
552 work_gstring.size = 2;
553 work_gstring.used = 0;
554 work_gstring.inc = 1;
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);
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);
594 free (work_gstring.glyphs);
596 mdebug__report_object ("Face", &face_table);
599 /** Return a realized face for ASCII characters from NUM number of
600 base faces pointed by FACES on the frame FRAME. */
603 mface__realize (MFrame *frame, MFace **faces, int num,
604 MSymbol language, MSymbol charset, int size)
606 MRealizedFace *rface;
607 MRealizedFont *rfont;
608 MFace merged_face = *(frame->face);
614 if (num == 0 && language == Mnil && charset == Mnil && frame->rface)
617 for (i = 0; i < MFACE_PROPERTY_MAX; i++)
618 for (j = num - 1; j >= 0; j--)
619 if (faces[j]->property[i])
621 merged_face.property[i] = faces[j]->property[i];
625 if (! mplist_find_by_value (frame->face->frame_list, frame))
626 mplist_push (frame->face->frame_list, Mt, frame);
627 for (i = 0; i < num; i++)
628 if (! mplist_find_by_value (faces[i]->frame_list, frame))
629 mplist_push (faces[i]->frame_list, Mt, frame);
631 if (merged_face.property[MFACE_RATIO])
633 int font_size = (int) merged_face.property[MFACE_SIZE];
635 font_size *= (int) merged_face.property[MFACE_RATIO];
637 merged_face.property[MFACE_SIZE] = (void *) font_size;
638 merged_face.property[MFACE_RATIO] = 0;
641 rface = find_realized_face (frame, &merged_face);
645 MSTRUCT_CALLOC (rface, MERROR_FACE);
646 mplist_push (frame->realized_face_list, Mt, rface);
647 rface->frame = frame;
648 rface->face = merged_face;
649 props = rface->face.property;
650 rface->rfontset = mfont__realize_fontset (frame,
651 (MFontset *) props[MFACE_FONTSET],
653 g.type = GLYPH_SPACE;
656 rfont = mfont__lookup_fontset (rface->rfontset, &g, &num,
657 msymbol ("latin"), language, Mnil, size);
660 rface->rfont = rfont;
662 work_gstring.frame = frame;
663 work_gstring.glyphs[0] = g;
664 work_gstring.glyphs[0].rface = rface;
665 work_gstring.glyphs[1].code = MCHAR_INVALID_CODE;
666 work_gstring.glyphs[1].rface = rface;
667 mfont__get_metric (&work_gstring, 0, 2);
668 rface->space_width = work_gstring.glyphs[0].width;
669 rface->ascent = work_gstring.glyphs[1].ascent;
670 rface->descent = work_gstring.glyphs[1].descent;
675 rface->space_width = frame->space_width;
678 rface->hline = (MFaceHLineProp *) props[MFACE_HLINE];
679 if (rface->hline && rface->hline->width == 0)
681 rface->box = (MFaceBoxProp *) props[MFACE_BOX];
682 if (rface->box && rface->box->width == 0)
684 rface->ascii_rface = rface;
685 (*frame->driver->realize_face) (rface);
687 func = (MFaceHookFunc) rface->face.property[MFACE_HOOK_FUNC];
688 if (func && func != noop_hook)
689 (func) (&(rface->face), rface->info, rface->face.property[MFACE_HOOK_ARG]);
691 rface->non_ascii_list = mplist ();
694 MRealizedFace *nofont;
696 MSTRUCT_CALLOC (nofont, MERROR_FACE);
698 nofont->non_ascii_list = NULL;
699 nofont->rfont = NULL;
700 mplist_add (rface->non_ascii_list, Mt, nofont);
708 mface__for_chars (MSymbol script, MSymbol language, MSymbol charset,
709 MGlyph *from_g, MGlyph *to_g, int size)
711 MRealizedFace *rface = from_g->rface->ascii_rface, *new;
712 MRealizedFont *rfont;
713 int num = to_g - from_g, i;
716 rfont = mfont__lookup_fontset (from_g->rface->rfontset, from_g, &num,
717 script, language, charset, size);
721 MPLIST_DO (plist, rface->non_ascii_list)
723 rface = MPLIST_VAL (plist);
730 if (rface->rfont == rfont)
733 MPLIST_DO (plist, rface->non_ascii_list)
734 if (((MRealizedFace *) MPLIST_VAL (plist))->rfont == rfont)
736 if (! MPLIST_TAIL_P (plist))
738 rface = MPLIST_VAL (plist);
742 MSTRUCT_MALLOC (new, MERROR_FACE);
743 mplist_push (rface->non_ascii_list, Mt, new);
746 rface->rfont = rfont;
747 rface->non_ascii_list = NULL;
748 work_gstring.frame = rface->frame;
749 work_gstring.glyphs[0].code = MCHAR_INVALID_CODE;
750 work_gstring.glyphs[0].rface = rface;
751 mfont__get_metric (&work_gstring, 0, 1);
752 rface->ascent = work_gstring.glyphs[0].ascent;
753 rface->descent = work_gstring.glyphs[0].descent;
756 for (i = 0; i < num; i++, from_g++)
757 from_g->rface = rface;
763 mface__free_realized (MRealizedFace *rface)
767 MPLIST_DO (plist, rface->non_ascii_list)
768 free (MPLIST_VAL (plist));
769 M17N_OBJECT_UNREF (rface->non_ascii_list);
774 mface__update_frame_face (MFrame *frame)
777 frame->rface = mface__realize (frame, NULL, 0, Mnil, Mnil, 0);
778 frame->space_width = frame->rface->space_width;
779 frame->ascent = frame->rface->ascent;
780 frame->descent = frame->rface->descent;
784 #endif /* !FOR_DOXYGEN || DOXYGEN_INTERNAL_MODULE */
788 /*** @addtogroup m17nFace */
792 /***en @name Variables: Keys of face property */
793 /***ja @name ÊÑ¿ô: ¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼ */
798 @brief Key of a face property specifying foreground color.
800 The variable #Mforeground is used as a key of face property. The
801 property value must be a symbol whose name is a color name, or
804 #Mnil means that the face does not specify a foreground color.
805 Otherwise, the foreground of an M-text is drawn by the specified
809 @brief Á°·Ê¿§¤ò»ØÄꤹ¤ë¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
811 ÊÑ¿ô #Mforeground ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£
812 ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢¿§Ì¾¤ò̾Á°¤È¤·¤Æ»ý¤Ä¥·¥ó¥Ü¥ë¤« #Mnil ¤Ç¤¢¤ë¡£
814 #Mnil ¤Î¾ì¹ç¡¢Á°·Ê¿§¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð M-text ¤ÎÁ°·Ê¤Ï
815 »ØÄꤵ¤ì¤¿¿§¤Çɽ¼¨¤µ¤ì¤ë¡£ */
820 @brief Key of a face property specifying background color.
822 The variable #Mbackground is used as a key of face property. The
823 property value must be a symbol whose name is a color name, or
826 #Mnil means that the face does not specify a background color.
827 Otherwise, the background of an M-text is drawn by the specified
831 @brief ÇØ·Ê¿§¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
833 ÊÑ¿ô #Mbackground ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£
834 ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢¿§Ì¾¤ò̾Á°¤È¤·¤Æ»ý¤Ä¥·¥ó¥Ü¥ë¤« #Mnil ¤Ç¤¢¤ë¡£
836 #Mnil ¤Î¾ì¹ç¡¢ÇØ·Ê¿§¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð M-text ¤ÎÇطʤÏ
837 »ØÄꤵ¤ì¤¿¿§¤Çɽ¼¨¤µ¤ì¤ë¡£ */
842 @brief Key of a face property specifying video mode.
844 The variable #Mvideomode is used as a key of face property. The
845 property value must be #Mnormal, #Mreverse, or #Mnil.
847 #Mnormal means that an M-text is drawn in normal video mode
848 (i.e. the foreground is drawn by foreground color, the background
849 is drawn by background color).
851 #Mreverse means that an M-text is drawn in reverse video mode
852 (i.e. the foreground is drawn by background color, the background
853 is drawn by foreground color).
855 #Mnil means that the face does not specify a video mode. */
858 @brief ¥Ó¥Ç¥ª¥â¡¼¥É¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
860 ÊÑ¿ô #Mvideomode ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£
861 ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢#Mnormal, #Mreverse, #Mnil ¤Î¤¤¤º¤ì¤«¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
863 #Mnormal ¤Î¾ì¹ç¤Ï¡¢M-text ¤Ïɸ½à¤Î¥Ó¥Ç¥ª¥â¡¼¥É¡ÊÁ°·Ê¤òÁ°·Ê¿§¤Ç¡¢ÇØ
864 ·Ê¤òÇØ·Ê¿§¤Ç¡Ë¤Çɽ¼¨¤¹¤ë¡£
866 #Mreverse ¤Î¾ì¹ç¤Ï¥ê¥Ð¡¼¥¹¥Ó¥Ç¥ª¥â¡¼¥É¤Ç¡ÊÁ°·Ê¤òÇØ·Ê¿§¤Ç¡¢ÇطʤòÁ°
869 #Mnil ¤Î¾ì¹ç¤Ï¥Ó¥Ç¥ª¥â¡¼¥É¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
875 @brief Key of a face property specifying font size ratio.
877 The variable #Mratio is used as a key of face property. The value
878 RATIO must be an integer.
880 The value 0 means that the face does not specify a font size
881 ratio. Otherwise, an M-text is drawn by a font of size (FONTSIZE
882 * RATIO / 100) where FONTSIZE is a font size specified by the face
885 @brief ¥Õ¥©¥ó¥È¤Î¥µ¥¤¥º¤ÎÈæΨ¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
887 ÊÑ¿ô #Mratio ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃÍ RATIO
888 ¤ÏÀ°¿ôÃͤǤʤ¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
890 Ãͤ¬0¤Ê¤é¤Ð¡¢¥Õ¥©¥ó¥È¥µ¥¤¥º¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¡¢M-text
891 ¤Ï(FONTSIZE * RATIO / 100) ¤È¤¤¤¦¥µ¥¤¥º¤Î¥Õ¥©¥ó¥È¤Çɽ¼¨¤µ¤ì¤ë¡£¤³
892 ¤³¤Ç FONTSIZE ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼ #Msize ¤Ç»ØÄꤵ¤ì¤¿¥µ¥¤¥º¤Ç¤¢
898 @brief Key of a face property specifying horizontal line.
900 The variable #Mhline is used as a key of face property. The value
901 must be a pointer to an object of type #MFaceHLineProp, or @c
904 The value @c NULL means that the face does not specify this
905 property. Otherwise, an M-text is drawn with a horizontal line by
906 a way specified by the object that the value points to. */
909 @brief ¿åÊ¿Àþ¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
911 ÊÑ¿ô #Mhline ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃͤÏ
912 #MFaceHLineProp ·¿¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤« @c NULL ¤Ç¤Ê¤¯¤Æ¤Ï¤Ê
915 Ãͤ¬ @c NULL ¤Ê¤é¤Ð¡¢¤³¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤Ê¤±¤ì¤ÐÃÍ
916 ¤¬»Ø¤¹¥ª¥Ö¥¸¥§¥¯¥È¤Ë»ØÄꤵ¤ì¤¿¤è¤¦¤Ë¿åÊ¿Àþ¤òÉղä·¤Æ M-text ¤òɽ¼¨
922 @brief Key of a face property specifying box.
924 The variable #Mbox is used as a key of face property. The value
925 must be a pointer to an object of type #MFaceBoxProp, or @c NULL.
927 The value @c NULL means that the face does not specify a box.
928 Otherwise, an M-text is drawn with a surrounding box by a way
929 specified by the object that the value points to. */
932 @brief °Ï¤ßÏȤò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
934 ÊÑ¿ô #Mbox ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃͤÏ
935 #MFaceBoxProp ·¿¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤« @c NULL ¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é
938 Ãͤ¬ @c NULL ¤Ê¤é¤Ð¡¢¤³¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤Ê¤±¤ì¤ÐÃÍ
939 ¤¬»Ø¤¹¥ª¥Ö¥¸¥§¥¯¥È¤Ë»ØÄꤵ¤ì¤¿¤è¤¦¤Ë°Ï¤ßÏȤòÉղä·¤Æ M-text ¤òɽ¼¨
945 @brief Key of a face property specifying fontset.
947 The variable #Mfontset is used as a key of face property. The
948 value must be a pointer to an object of type #Mfontset, or @c
951 The value @c NULL means that the face does not specify a fontset.
952 Otherwise, an M-text is drawn with a font selected from what
953 specified in the fontset. */
956 @brief ¥Õ¥©¥ó¥È¥»¥Ã¥È¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
958 ÊÑ¿ô #Mfontset ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃͤÏ
959 #Mfontset ·¿¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤« @c NULL ¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
961 Ãͤ¬ @c NULL ¤Ê¤é¤Ð¡¢¥Õ¥©¥ó¥È¥»¥Ã¥È¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤Ê¤±¤ì¤ÐÃÍ
962 ¤¬»Ø¤¹¥ª¥Ö¥¸¥§¥¯¥È¤Ë»ØÄꤵ¤ì¤¿¥Õ¥©¥ó¥È¥»¥Ã¥È¤«¤éÁª¤ó¤À¥Õ¥©¥ó¥È¤Ç
963 M-text ¤òɽ¼¨¤¹¤ë¡£*/
968 @brief Key of a face property specifying hook.
970 The variable #Mhook_func is used as a key of face property. The
971 value must be a function of type #MFaceHookFunc, or @c NULL.
973 The value @c NULL means that the face does not specify a hook.
974 Otherwise, the specified function is called before the face is
977 @brief ¥Õ¥Ã¥¯¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
979 ÊÑ¿ô #Mhook_func ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃͤÏ
980 #MFaceHookFunc ·¿¤Î´Ø¿ô¤« @c NULL ¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
982 Ãͤ¬ @c NULL ¤Ê¤é¤Ð¡¢¥Õ¥Ã¥¯¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¥Õ¥§¡¼¥¹¤ò
983 ¼Â¸½¤¹¤ëÁ°¤Ë»ØÄꤷ¤¿´Ø¿ô¤¬¸Æ¤Ð¤ì¤ë¡£ */
987 @brief Key of a face property specifying argument of hook.
989 The variable #Mhook_arg is used as a key of face property. The
990 value can be anything that is passed a hook function specified by
991 the face property #Mhook_func. */
993 @brief ¥Õ¥Ã¥¯¤Î°ú¿ô¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
995 ÊÑ¿ô #Mhook_arg ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃͤÏ
996 ²¿¤Ç¤â¤è¤¯¡¢¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£ #Mhook_func ¤Ç»ØÄꤵ¤ì¤ë´Ø¿ô¤ËÅϤµ
1003 /*** @ingroup m17nFace */
1004 /***en @name Variables: Possible values of #Mvideomode property of face */
1005 /***ja @name ÊÑ¿ô¡§ ¥Õ¥§¡¼¥¹¤Î #Mvideomode ¥×¥í¥Ñ¥Æ¥£¤Î²Äǽ¤ÊÃÍ */
1010 See the documentation of the variable #Mvideomode. */
1012 ÊÑ¿ô #Mvideomode ¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£ */
1018 /*** @ingroup m17nFace */
1019 /***en @name Variables: Predefined faces */
1020 /***ja @name ÊÑ¿ô: ÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹ */
1025 @brief Normal video face.
1027 The variable #mface_normal_video points to a face that has the
1028 #Mvideomode property with value #Mnormal. The other properties
1029 are not specified. An M-text drawn with this face appear normal
1030 colors (i.e. the foreground is drawn by foreground color, and
1031 background is drawn by background color). */
1033 @brief ɸ½à¥Ó¥Ç¥ª¥Õ¥§¡¼¥¹.
1035 ÊÑ¿ô #mface_normal_video ¤Ï #Mvideomode ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ #Mnormal
1036 ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1037 ¤³¤Î¥Õ¥§¡¼¥¹¤Çɽ¼¨¤µ¤ì¤ëM-text ¤Ïɸ½à¤Î¿§ (¤¹¤Ê¤ï¤ÁÁ°·Ê¤ÏÁ°·Ê¿§¡¢
1038 ÇطʤÏÇØ·Ê¿§¡Ë¤ÇÉÁ¤«¤ì¤ë¡£ */
1040 MFace *mface_normal_video;
1043 @brief Reverse video face.
1045 The variable #mface_reverse_video points to a face that has the
1046 #Mvideomode property with value #Mreverse. The other properties
1047 are not specified. An M-text drawn with this face appear in
1048 reversed colors (i.e. the foreground is drawn by background
1049 color, and background is drawn by foreground color). */
1051 @brief ¥ê¥Ð¡¼¥¹¥Ó¥Ç¥ª¥Õ¥§¡¼¥¹.
1053 ÊÑ¿ô #mface_reverse_video ¤Ï #Mvideomode ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬
1054 #Mreverse ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄê
1055 ¤µ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤Çɽ¼¨¤µ¤ì¤ëM-text ¤ÏÁ°·Ê¿§¤ÈÇØ·Ê¿§¤¬Æþ¤ìÂØ
1056 ¤ï¤Ã¤Æ (¤¹¤Ê¤ï¤ÁÁ°·Ê¤ÏÇØ·Ê¿§¡¢ÇطʤÏÁ°·Ê¿§¡ËÉÁ¤«¤ì¤ë¡£ */
1058 MFace *mface_reverse_video;
1061 @brief Underline face.
1063 The variable #mface_underline points to a face that has the
1064 #Mhline property with value a pointer to an object of type
1065 #MFaceHLineProp. The members of the object are as follows:
1070 type MFACE_HLINE_UNDER
1075 The other properties are not specified. An M-text that has this
1076 face is drawn with an underline. */
1078 @brief ²¼Àþ¥Õ¥§¡¼¥¹.
1080 ÊÑ¿ô #mface_underline ¤Ï #Mhline ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ #MFaceHLineProp
1081 ·¿¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£¥ª¥Ö
1082 ¥¸¥§¥¯¥È¤Î¥á¥ó¥Ð¤Ï°Ê²¼¤ÎÄ̤ꡣ
1087 type MFACE_HLINE_UNDER
1092 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ï²¼ÀþÉÕ¤
1095 MFace *mface_underline;
1100 The variable #mface_medium points to a face that has the #Mweight
1101 property with value a symbol of name "medium". The other
1102 properties are not specified. An M-text that has this face is
1103 drawn with a font of medium weight. */
1105 @brief ¥ß¥Ç¥£¥¢¥à¥Õ¥§¡¼¥¹.
1107 ÊÑ¿ô #mface_medium ¤Ï #Mweight ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "medium" ¤È¤¤¤¦Ì¾
1108 Á°¤ò¤â¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í
1109 ¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ï¡¢¥ß¥Ç¥£¥¢¥à¥¦¥§
1110 ¥¤¥È¤Î¥Õ¥©¥ó¥È¤Çɽ¼¨¤µ¤ì¤ë¡£ */
1111 MFace *mface_medium;
1116 The variable #mface_bold points to a face that has the #Mweight
1117 property with value a symbol of name "bold". The other properties
1118 are not specified. An M-text that has this face is drawn with a
1119 font of bold weight. */
1122 @brief ¥Ü¡¼¥ë¥É¥Õ¥§¡¼¥¹.
1124 ÊÑ¿ô #mface_bold ¤Ï #Mweight ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "bold" ¤È¤¤¤¦Ì¾Á°¤ò
1125 ¤â¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£
1126 ¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ï¡¢¥Ü¡¼¥ë¥É¤Î¥Õ¥©¥ó¥È¤Ç
1135 The variable #mface_italic points to a face that has the #Mstyle
1136 property with value a symbol of name "italic". The other
1137 properties are not specified. An M-text that has this face is
1138 drawn with a font of italic style. */
1141 @brief ¥¤¥¿¥ê¥Ã¥¯¥Õ¥§¡¼¥¹.
1143 ÊÑ¿ô #mface_italic ¤Ï #Mstyle ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "italic" ¤È¤¤¤¦Ì¾Á°
1144 ¤ò¤â¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ
1145 ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ï¡¢¥¤¥¿¥ê¥Ã¥¯ÂΤÇɽ
1149 MFace *mface_italic;
1152 @brief Bold italic face.
1154 The variable #mface_bold_italic points to a face that has the
1155 #Mweight property with value a symbol of name "bold", and #Mstyle
1156 property with value a symbol of name "italic". The other
1157 properties are not specified. An M-text that has this face is
1158 drawn with a font of bold weight and italic style. */
1161 @brief ¥Ü¡¼¥ë¥É¥¤¥¿¥ê¥Ã¥¯¥Õ¥§¡¼¥¹.
1163 ÊÑ¿ô #mface_bold_italic ¤Ï¡¢#Mweight ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "bold" ¤È¤¤
1164 ¤¦Ì¾Á°¤ò¤â¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ê¡¢¤«¤Ä #Mstyle ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "italic"
1165 ¤È¤¤¤¦Ì¾Á°¤ò¤â¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1166 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ï¡¢¥Ü¡¼¥ë
1167 ¥É¥¤¥¿¥ê¥Ã¥¯ÂΤÇɽ¼¨¤µ¤ì¤ë¡£
1170 MFace *mface_bold_italic;
1173 @brief Smallest face.
1175 The variable #mface_xx_small points to a face that has the #Mratio
1176 property with value 50. The other properties are not specified.
1177 An M-text that has this face is drawn with a font whose size is
1178 50% of a normal font. */
1181 @brief ºÇ¾®¤Î¥Õ¥§¡¼¥¹.
1183 ÊÑ¿ô #mface_xx_small ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 50 ¤Ç¤¢¤ë¥Õ¥§¡¼
1184 ¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹
1185 ¤ò»ý¤Ä M-text ¤Ïɸ½à¤Î 50% ¤ÎÂ礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1188 MFace *mface_xx_small;
1191 @brief Smaller face.
1193 The variable #mface_x_small points to a face that has the #Mratio
1194 property with value 66. The other properties are not specified.
1195 An M-text that has this face is drawn with a font whose size is
1196 66% of a normal font. */
1199 @brief ¤â¤Ã¤È¾®¤µ¤¤¥Õ¥§¡¼¥¹.
1201 ÊÑ¿ô #mface_x_small ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 66 ¤Ç¤¢¤ë¥Õ¥§¡¼
1202 ¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹
1203 ¤ò»ý¤Ä M-text ¤Ïɸ½à¤Î 66% ¤ÎÂ礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1206 MFace *mface_x_small;
1211 The variable #mface_x_small points to a face that has the #Mratio
1212 property with value 75. The other properties are not specified.
1213 An M-text that has this face is drawn with a font whose size is
1214 75% of a normal font. */
1217 @brief ¾®¤µ¤¤¥Õ¥§¡¼¥¹.
1219 ÊÑ¿ô #mface_small ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 75 ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò
1220 »Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý
1221 ¤Ä M-text ¤Ïɸ½à¤Î 75% ¤ÎÂ礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1227 @brief Normalsize face.
1229 The variable #mface_normalsize points to a face that has the
1230 #Mratio property with value 100. The other properties are not
1231 specified. An M-text that has this face is drawn with a font
1232 whose size is the same as a normal font. */
1235 @brief ɸ½à¤ÎÂ礤µ¤Î¥Õ¥§¡¼¥¹.
1237 ÊÑ¿ô #mface_normalsize ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 100 ¤Ç¤¢¤ë¥Õ¥§¡¼
1238 ¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹
1239 ¤ò»ý¤Ä M-text ¤Ïɸ½à¤ÈƱ¤¸Â礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1242 MFace *mface_normalsize;
1247 The variable #mface_large points to a face that has the #Mratio
1248 property with value 120. The other properties are not specified.
1249 An M-text that has this face is drawn with a font whose size is
1250 120% of a normal font. */
1253 @brief Â礤¤¥Õ¥§¡¼¥¹.
1255 ÊÑ¿ô #mface_large ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 120 ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹
1256 ¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò
1257 »ý¤Ä M-text ¤Ïɸ½à¤Î 120% ¤ÎÂ礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1265 The variable #mface_x_large points to a face that has the #Mratio
1266 property with value 150. The other properties are not specified.
1267 An M-text that has this face is drawn with a font whose size is
1268 150% of a normal font. */
1271 @brief ¤â¤Ã¤ÈÂ礤¤¥Õ¥§¡¼¥¹.
1273 ÊÑ¿ô #mface_x_large ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 150 ¤Ç¤¢¤ë¥Õ¥§¡¼
1274 ¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹
1275 ¤ò»ý¤Ä M-text ¤Ïɸ½à¤Î 150% ¤ÎÂ礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1278 MFace *mface_x_large;
1281 @brief Largest face.
1283 The variable #mface_xx_large points to a face that has the #Mratio
1284 property with value 200. The other properties are not specified.
1285 An M-text that has this face is drawn with a font whose size is
1286 200% of a normal font. */
1289 @brief ºÇÂç¤Î¥Õ¥§¡¼¥¹.
1291 ÊÑ¿ô #mface_xx_large ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 200 ¤Ç¤¢¤ë¥Õ¥§¡¼
1292 ¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹
1293 ¤ò»ý¤Ä M-text ¤Ïɸ½à¤Î 200% ¤ÎÂ礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1296 MFace *mface_xx_large;
1301 The variable #mface_black points to a face that has the
1302 #Mforeground property with value a symbol of name "black". The
1303 other properties are not specified. An M-text that has this face
1304 is drawn with black foreground. */
1309 ÊÑ¿ô #mface_black ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "black" ¤È
1310 ¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×
1311 ¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤ÏÁ°·Ê¿§¤ò¹õ¤È¤·
1319 The variable #mface_white points to a face that has the
1320 #Mforeground property with value a symbol of name "white". The
1321 other properties are not specified. An M-text that has this face
1322 is drawn with white foreground. */
1327 ÊÑ¿ô #mface_white ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "white" ¤È
1328 ¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×
1329 ¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤ÏÁ°·Ê¿§¤òÇò¤È¤·
1337 The variable #mface_red points to a face that has the
1338 #Mforeground property with value a symbol of name "red". The
1339 other properties are not specified. An M-text that has this face
1340 is drawn with red foreground. */
1345 ÊÑ¿ô #mface_red ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "red" ¤È¤¤¤¦
1346 ̾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ
1347 ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤ÏÁ°·Ê¿§¤òÀ֤Ȥ·¤Æɽ
1355 The variable #mface_green points to a face that has the
1356 #Mforeground property with value a symbol of name "green". The
1357 other properties are not specified. An M-text that has this face
1358 is drawn with green foreground. */
1363 ÊÑ¿ô #mface_green ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "green" ¤È
1364 ¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×
1365 ¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤ÏÁ°·Ê¿§¤òÎФȤ·
1373 The variable #mface_blue points to a face that has the
1374 #Mforeground property with value a symbol of name "blue". The
1375 other properties are not specified. An M-text that has this face
1376 is drawn with blue foreground. */
1381 ÊÑ¿ô #mface_blue ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "blue" ¤È¤¤
1382 ¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í
1383 ¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤ÏÁ°·Ê¿§¤òÀĤȤ·¤Æ
1391 The variable #mface_cyan points to a face that has the
1392 #Mforeground property with value a symbol of name "cyan". The
1393 other properties are not specified. An M-text that has this face
1394 is drawn with cyan foreground. */
1397 @brief ¥·¥¢¥ó¥Õ¥§¡¼¥¹.
1399 ÊÑ¿ô #mface_cyan ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "cyan" ¤È¤¤
1400 ¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í
1401 ¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤ÏÁ°·Ê¿§¤ò¥·¥¢¥ó¤È
1409 The variable #mface_yellow points to a face that has the
1410 #Mforeground property with value a symbol of name "yellow". The
1411 other properties are not specified. An M-text that has this face
1412 is drawn with yellow foreground. */
1417 ÊÑ¿ô #mface_yellow ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "yellow"
1418 ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î
1419 ¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤ÏÁ°·Ê¿§¤ò²«¿§
1420 ¤È¤·¤Æɽ¼¨¤µ¤ì¤ë¡£ */
1422 MFace *mface_yellow;
1425 @brief Magenta face.
1427 The variable #mface_magenta points to a face that has the
1428 #Mforeground property with value a symbol of name "magenta". The
1429 other properties are not specified. An M-text that has this face
1430 is drawn with magenta foreground. */
1433 @brief ¥Þ¥¼¥ó¥¿¥Õ¥§¡¼¥¹.
1435 ÊÑ¿ô #mface_magenta ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ
1436 "magenta" ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç
1437 ¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤ÏÁ°
1438 ·Ê¿§¤ò¥Þ¥¼¥ó¥¿¤È¤·¤Æɽ¼¨¤µ¤ì¤ë¡£ */
1440 MFace *mface_magenta;
1445 /***en @name Variables: The other symbols for face handling. */
1446 /***ja @name ÊÑ¿ô: ¥Õ¥§¡¼¥¹¤ò¼è¤ê°·¤¦¤¿¤á¤Î¤½¤Î¾¤Î¥·¥ó¥Ü¥ë */
1451 @brief Key of a text property specifying a face.
1453 The variable #Mface is a symbol of name <tt>"face"</tt>. A text
1454 property whose key is
1455 this symbol must have a pointer to an object
1457 . This is a managing key. */
1460 @brief ¥Õ¥§¡¼¥¹¤ò»ØÄꤹ¤ë¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼.
1462 ÊÑ¿ô #Mface ¤Ï <tt>"face"</tt> ¤È¤¤¤¦Ì¾Á°¤ò»ý¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¡£¤³
1463 ¤Î¥·¥ó¥Ü¥ë¤ò¥¡¼¤È¤¹¤ë¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Ï¡¢#MFace ·¿¤Î¥ª¥Ö¥¸¥§¥¯
1464 ¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£¤³¤ì¤Ï´ÉÍý¥¡¼¤Ç¤¢¤ë¡£ */
1472 @brief Create a new face.
1474 The mface () function creates a new face object that specifies no
1478 This function returns a pointer to the created face. */
1481 @brief ¿·¤·¤¤¥Õ¥§¡¼¥¹¤ò¤Ä¤¯¤ë.
1483 ´Ø¿ô mface () ¤Ï¥×¥í¥Ñ¥Æ¥£¤ò°ìÀÚ»ý¤¿¤Ê¤¤¿·¤·¤¤¥Õ¥§¡¼¥¹¥ª¥Ö¥¸¥§¥¯¥È
1487 ¤³¤Î´Ø¿ô¤Ïºî¤Ã¤¿¥Õ¥§¡¼¥¹¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ */
1494 M17N_OBJECT (face, free_face, MERROR_FACE);
1495 face->frame_list = mplist ();
1496 M17N_OBJECT_REGISTER (face_table, face);
1503 @brief Make a copy of a face.
1505 The mface_copy () function makes a copy of $FACE and returns a
1506 pointer to the created copy. */
1509 @brief ¥Õ¥§¡¼¥¹¤Î¥³¥Ô¡¼¤òºî¤ë.
1511 ´Ø¿ô mface_copy () ¤Ï¥Õ¥§¡¼¥¹ $FACE ¤Î¥³¥Ô¡¼¤òºî¤ê¡¢¤½¤Î¥³¥Ô¡¼¤Ø¤Î
1515 mface_copy (MFace *face)
1519 MSTRUCT_CALLOC (copy, MERROR_FACE);
1521 copy->control.ref_count = 1;
1522 M17N_OBJECT_REGISTER (face_table, copy);
1523 copy->frame_list = mplist ();
1524 if (copy->property[MFACE_FONTSET])
1525 M17N_OBJECT_REF (copy->property[MFACE_FONTSET]);
1533 The mface_merge () functions merges the properties of face $SRC
1537 This function returns $DST. */
1540 @brief ¥Õ¥§¡¼¥¹¤òÅý¹ç¤¹¤ë.
1542 ´Ø¿ô mface_merge () ¤Ï¡¢¥Õ¥§¡¼¥¹ $SRC ¤Î¥×¥í¥Ñ¥Æ¥£¤ò¥Õ¥§¡¼¥¹ $DST
1546 ¤³¤Î´Ø¿ô¤Ï $DST ¤òÊÖ¤¹¡£ */
1549 mface_merge (MFace *dst, MFace *src)
1554 for (i = 0; i < MFACE_PROPERTY_MAX; i++)
1555 if (src->property[i])
1557 if (i == MFACE_FONTSET)
1559 M17N_OBJECT_UNREF (dst->property[i]);
1560 M17N_OBJECT_REF (src->property[i]);
1562 dst->property[i] = src->property[i];
1565 MPLIST_DO (plist, dst->frame_list)
1567 MFrame *frame = MPLIST_VAL (plist);
1570 if (dst == frame->face)
1571 mface__update_frame_face (frame);
1580 @brief Make a face from a font.
1582 The mface_from_font () function return a newly created face while
1583 reflecting the properties of $FONT in its properties. */
1586 @brief ¥Õ¥©¥ó¥È¤«¤é¥Õ¥§¡¼¥¹¤òºî¤ë.
1588 ´Ø¿ô mface_from_font () ¤Ï¥Õ¥©¥ó¥È $FONT ¤Î¥×¥í¥Ñ¥Æ¥£¤ò¥×¥í¥Ñ¥Æ¥£
1589 ¤È¤·¤Æ»ý¤Ä¿·¤·¤¤¥Õ¥§¡¼¥¹¤òºî¤ê¡¢¤½¤ì¤òÊÖ¤¹¡£ */
1592 mface_from_font (MFont *font)
1594 MFace *face = mface ();
1596 face->property[MFACE_FOUNDRY] = mfont_get_prop (font, Mfoundry);
1597 face->property[MFACE_FAMILY] = mfont_get_prop (font, Mfamily);
1598 face->property[MFACE_WEIGHT] = mfont_get_prop (font, Mweight);
1599 face->property[MFACE_STYLE] = mfont_get_prop (font, Mstyle);
1600 face->property[MFACE_STRETCH] = mfont_get_prop (font, Mstretch);
1601 face->property[MFACE_ADSTYLE] = mfont_get_prop (font, Madstyle);
1602 face->property[MFACE_SIZE] = mfont_get_prop (font, Msize);
1609 @brief Get the value of a face property.
1611 The mface_get_prop () function returns the value of the face
1612 property whose key is $KEY in face $FACE. $KEY must be one of the
1615 #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
1616 #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
1617 #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg
1620 The actual type of the returned value depends of $KEY. See
1621 documentation of the above keys. If an error is detected, it
1622 returns @c NULL and assigns an error code to the external variable
1626 @brief ¥Õ¥§¡¼¥¹¤Î¥×¥í¥Ñ¥Æ¥£¤ÎÃͤòÆÀ¤ë.
1628 ´Ø¿ô mface_get_prop () ¤Ï¡¢¥Õ¥§¡¼¥¹ $FACE ¤¬»ý¤Ä¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£
1629 ¤ÎÆâ¡¢¥¡¼¤¬ $KEY ¤Ç¤¢¤ë¤â¤Î¤ÎÃͤòÊÖ¤¹¡£$KEY ¤Ï²¼µ¤Î¤¤¤º¤ì¤«¤Ç¤Ê
1632 #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
1633 #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
1634 #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg
1637 Ìá¤êÃͤη¿¤Ï $KEY ¤Ë°Í¸¤¹¤ë¡£¾åµ¤Î¥¡¼¤ÎÀâÌÀ¤ò»²¾È¤¹¤ë¤³
1638 ¤È¡£¥¨¥é¡¼¤¬¸¡½Ð¤µ¤ì¤¿¾ì¹ç¤Ï @c NULL ¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô #merror_code
1639 ¤Ë¥¨¥é¡¼¥³¡¼¥É¤òÀßÄꤹ¤ë¡£ */
1649 mface_get_prop (MFace *face, MSymbol key)
1651 int index = (int) msymbol_get (key, M_face_prop_index) - 1;
1654 MERROR (MERROR_FACE, NULL);
1655 return face->property[index];
1661 @brief Set a value of a face property.
1663 The mface_put_prop () function assigns $VAL to the property whose
1664 key is $KEY in face $FACE. $KEY must be one the followings:
1666 #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
1667 #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
1668 #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg
1670 Among them, font related properties (#Mfoundry through #Msize) are
1671 used as the default values when a font in the fontset of $FACE
1672 does not specify those values.
1674 The actual type of the returned value depends of $KEY. See
1675 documentation of the above keys.
1678 If the operation was successful, mface_put_prop () returns 0.
1679 Otherwise it returns -1 and assigns an error code to the external
1680 variable #merror_code. */
1683 @brief ¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤòÀßÄꤹ¤ë.
1685 ´Ø¿ô mface_put_prop () ¤Ï¡¢¥Õ¥§¡¼¥¹ $FACE Æâ¤Ç¥¡¼¤¬ $KEY ¤Ç¤¢¤ë¥×
1686 ¥í¥Ñ¥Æ¥£¤ÎÃͤò $VAL ¤ËÀßÄꤹ¤ë¡£$KEY ¤Ï°Ê²¼¤Î¤¤¤º¤ì¤«¤Ç¤Ê¤¯¤Æ¤Ï¤Ê
1689 #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
1690 #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
1691 #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg.
1693 ¤³¤ì¤é¤Î¤¦¤Á¤Î¡¢¥Õ¥©¥ó¥È´ØÏ¢¤Î¥×¥í¥Ñ¥Æ¥£ (#Mfamily ¤«¤é #Msize
1694 ¤Þ¤Ç) ¤Ï¡¢¥Õ¥§¡¼¥¹¤Î¥Õ¥©¥ó¥È¥»¥Ã¥ÈÃæ¤Î¥Õ¥©¥ó¥È¤Ë´Ø¤¹¤ë¥Ç¥Õ¥©¥ë¥ÈÃÍ
1695 ¤È¤Ê¤ê¡¢¸Ä¡¹¤Î¥Õ¥©¥ó¥È¤¬Ãͤò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¤ËÍѤ¤¤é¤ì¤ë¡£
1697 Ìá¤êÃͤη¿¤Ï $KEY ¤Ë°Í¸¤¹¤ë¡£¾åµ¤Î¥¡¼¤ÎÀâÌÀ¤ò»²¾È¤¹¤ë¤³¤È¡£
1700 ½èÍý¤¬À®¸ù¤·¤¿¾ì¹ç¡¢mface_put_prop () ¤Ï 0 ¤òÊÖ¤¹¡£¼ºÇÔ¤·¤¿¾ì¹ç¤Ï
1701 -1 ¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô #merror_code ¤Ë¥¨¥é¡¼¥³¡¼¥É¤òÀßÄꤹ¤ë¡£ */
1711 mface_put_prop (MFace *face, MSymbol key, void *val)
1713 int index = (int) msymbol_get (key, M_face_prop_index) - 1;
1717 MERROR (MERROR_FACE, -1);
1718 if (key == Mfontset)
1720 if (face->property[index])
1721 M17N_OBJECT_UNREF (face->property[index]);
1722 M17N_OBJECT_REF (val);
1724 else if (key == Mhline)
1725 val = get_hline_create (val);
1726 else if (key == Mbox)
1727 val = get_box_create (val);
1729 if (face->property[index] == val)
1731 face->property[index] = val;
1733 MPLIST_DO (plist, face->frame_list)
1735 MFrame *frame = MPLIST_VAL (plist);
1738 if (face == frame->face)
1739 mface__update_frame_face (frame);
1748 @brief Update a face.
1750 The mface_update () function update face $FACE on frame $FRAME by
1751 calling a hook function of $FACE (if any). */
1754 @brief ¥Õ¥§¡¼¥¹¤ò¹¹¿·¤¹¤ë.
1756 ´Ø¿ô mface_update () ¤Ï¥Õ¥ì¡¼¥à $FRAME ¤Î¥Õ¥§¡¼¥¹ $FACE ¤ò $FACE
1757 ¤Î¥Õ¥Ã¥¯´Ø¿ô¤ò¡Ê¤¢¤ì¤Ð¡Ë¸Æ¤ó¤Ç¹¹¿·¤¹¤ë¡£ */
1760 mface_update (MFrame *frame, MFace *face)
1762 MFaceHookFunc func = (MFaceHookFunc) face->property[MFACE_HOOK_FUNC];
1764 MRealizedFace *rface;
1766 if (func && func != noop_hook)
1768 MPLIST_DO (rface_list, frame->realized_face_list)
1770 rface = MPLIST_VAL (rface_list);
1771 if ((MFaceHookFunc) rface->face.property[MFACE_HOOK_FUNC] == func)
1772 (func) (&(rface->face), rface->face.property[MFACE_HOOK_ARG],
1782 /*** @addtogroup m17nDebug */
1789 The mdebug_dump_face () function prints face $FACE in a human readable
1790 way to the stderr. $INDENT specifies how many columns to indent
1791 the lines but the first one.
1794 This function returns $FACE. */
1797 @brief ¥Õ¥§¡¼¥¹¤ò¥À¥ó¥×¤¹¤ë.
1799 ´Ø¿ô mdebug_dump_face () ¤Ï¥Õ¥§¡¼¥¹ $FACE ¤ò stderr ¤Ë¿Í´Ö¤Ë²ÄÆɤÊ
1800 ·Á¤Ç°õºþ¤¹¤ë¡£ $INDENT ¤Ï£²¹ÔÌܰʹߤΥ¤¥ó¥Ç¥ó¥È¤ò»ØÄꤹ¤ë¡£
1803 ¤³¤Î´Ø¿ô¤Ï $FACE ¤òÊÖ¤¹¡£ */
1806 mdebug_dump_face (MFace *face, int indent)
1808 char *prefix = (char *) alloca (indent + 1);
1811 memset (prefix, 32, indent);
1813 mfont__set_spec_from_face (&spec, face);
1814 fprintf (stderr, "(face font:\"");
1815 mdebug_dump_font (&spec);
1816 fprintf (stderr, "\"\n %s fore:%s back:%s", prefix,
1817 msymbol_name ((MSymbol) face->property[MFACE_FOREGROUND]),
1818 msymbol_name ((MSymbol) face->property[MFACE_BACKGROUND]));
1819 if (face->property[MFACE_FONTSET])
1820 fprintf (stderr, " non-default-fontset");
1821 fprintf (stderr, " hline:%s", face->property[MFACE_HLINE] ? "yes" : "no");
1822 fprintf (stderr, " box:%s)", face->property[MFACE_BOX] ? "yes" : "no");