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., 51 Franklin Street, Fifth Floor,
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 ¤ò¥¡¼¤È¤¹¤ë¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤òÊ£¿ô»ý¤Ã¤Æ¤ª¤ê¡¢¤«¤Ä¤½¤ì¤é¤ÎÃͤ¬¾×Æͤ·¤Ê¤¤¤Ê¤é¤Ð¡¢¥Õ¥§¡¼¥¹¾ðÊó¤ÏÁȤ߹ç¤ï¤µ¤ì¤ÆÍѤ¤¤é¤ì¤ë¡£
73 ¤¢¤ë¥Æ¥¥¹¥È°À¤¬¤É¤Î¥Õ¥§¡¼¥¹¤Ë¤è¤Ã¤Æ¤â»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¥Õ¥§¡¼¥¹¤ÎÃͤ¬ÍѤ¤¤é¤ì¤ë¡£ */
77 #if !defined (FOR_DOXYGEN) || defined (DOXYGEN_INTERNAL_MODULE)
78 /*** @addtogroup m17nInternal
88 #include "m17n-misc.h"
95 #include "internal-gui.h"
100 static M17NObjectArray face_table;
104 static MSymbol M_face_prop_index;
106 static MPlist *hline_prop_list;
107 static MPlist *box_prop_list;
109 /** Special hook function pointer that does nothing. */
110 static MFaceHookFunc noop_hook;
113 static MFaceHLineProp *
114 get_hline_create (MFaceHLineProp *prop)
117 MFaceHLineProp *hline;
119 if (prop->width == 0)
120 return MPLIST_VAL (hline_prop_list);
121 MPLIST_DO (plist, MPLIST_NEXT (hline_prop_list))
123 hline = MPLIST_VAL (plist);
124 if (prop->type == hline->type
125 && prop->width == hline->width
126 && prop->color == hline->color)
129 MSTRUCT_MALLOC (hline, MERROR_FACE);
131 mplist_push (plist, Mt, hline);
135 static MFaceBoxProp *
136 get_box_create (MFaceBoxProp *prop)
141 if (prop->width == 0)
142 return MPLIST_VAL (box_prop_list);
143 MPLIST_DO (plist, MPLIST_NEXT (box_prop_list))
145 box = MPLIST_VAL (plist);
146 if (prop->width == box->width
147 && prop->color_top == box->color_top
148 && prop->color_bottom == box->color_bottom
149 && prop->color_left == box->color_left
150 && prop->color_right == box->color_right
151 && prop->inner_hmargin == box->inner_hmargin
152 && prop->inner_vmargin == box->inner_vmargin
153 && prop->outer_hmargin == box->inner_hmargin
154 && prop->inner_vmargin == box->inner_vmargin)
157 MSTRUCT_MALLOC (box, MERROR_FACE);
159 mplist_push (plist, Mt, box);
163 /** From FRAME->realized_face_list, find a realized face based on
166 static MRealizedFace *
167 find_realized_face (MFrame *frame, MFace *face, MFont *font)
171 MPLIST_DO (plist, frame->realized_face_list)
173 MRealizedFace *rface = MPLIST_VAL (plist);
175 if (memcmp (rface->face.property, face->property,
176 sizeof face->property) == 0
178 ? (font && ! memcmp (rface->font, font, sizeof (MFont)))
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 M17N_OBJECT_ADD_ARRAY (face_table, "Face");
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);
597 /** Return a face realized from NUM number of base faces pointed by
598 FACES on the frame FRAME. If SIZE is nonzero, it specifies the
599 maximum font size. */
602 mface__realize (MFrame *frame, MFace **faces, int num, int size, MFont *font)
604 MRealizedFace *rface;
605 MRealizedFont *rfont;
606 MFace merged_face = *(frame->face);
611 if (num == 0 && frame->rface && ! font)
614 if (! mplist_find_by_value (frame->face->frame_list, frame))
615 mplist_push (frame->face->frame_list, Mt, frame);
616 for (i = 0; i < num; i++)
617 if (! mplist_find_by_value (faces[i]->frame_list, frame))
618 mplist_push (faces[i]->frame_list, Mt, frame);
620 for (i = 0; i < MFACE_PROPERTY_MAX; i++)
621 for (j = num - 1; j >= 0; j--)
622 if (faces[j]->property[i])
624 merged_face.property[i] = faces[j]->property[i];
630 if (font->type != MFONT_TYPE_REALIZED)
631 font = mfont_copy (font);
632 for (i = 0; i <= MFACE_ADSTYLE; i++)
633 if (font->property[i])
634 merged_face.property[i] = FONT_PROPERTY (font, i);
638 font->size = ((double) (- font->size)) * frame->dpi / 72.27 + 0.5;
639 merged_face.property[MFACE_SIZE] = (void *) font->size;
640 merged_face.property[MFACE_RATIO] = (void *) 0;
644 if (! font || ! font->size)
646 double font_size = (int) merged_face.property[MFACE_SIZE];
650 font_size = - font_size * frame->dpi / 72.27;
651 if (merged_face.property[MFACE_RATIO]
652 && (int) merged_face.property[MFACE_RATIO] != 100)
654 font_size *= (int) merged_face.property[MFACE_RATIO];
657 ifont_size = font_size + 0.5;
658 merged_face.property[MFACE_SIZE] = (void *) ifont_size;
659 merged_face.property[MFACE_RATIO] = (void *) 0;
662 merged_face.property[MFACE_FOUNDRY] = Mnil;
663 rface = find_realized_face (frame, &merged_face, font);
666 if (font && font->type != MFONT_TYPE_REALIZED)
671 MSTRUCT_CALLOC (rface, MERROR_FACE);
672 mplist_push (frame->realized_face_list, Mt, rface);
673 rface->frame = frame;
674 rface->face = merged_face;
679 if (font->type == MFONT_TYPE_SPEC)
680 rfont = (MRealizedFont *) mfont_find (frame, font, NULL, 0);
681 else if (font->type == MFONT_TYPE_OBJECT)
684 spec.size = (int) merged_face.property[MFONT_SIZE];
685 if (font->property[MFONT_REGISTRY])
686 spec.property[MFONT_REGISTRY] = font->property[MFONT_REGISTRY];
688 mfont_put_prop (&spec, Mregistry,
689 (font->source == MFONT_SOURCE_X
690 ? Miso8859_1 : Municode_bmp));
691 rfont = mfont__open (frame, font, &spec);
694 rfont = (MRealizedFont *) font;
698 MFontset *fontset = (MFontset *) merged_face.property[MFACE_FONTSET];
700 rface->rfontset = mfont__realize_fontset (frame, fontset, &merged_face,
703 mfont__set_spec_from_face (&spec, &merged_face);
704 mfont_put_prop (&spec, Mregistry, Miso8859_1);
705 spec.source = MFONT_SOURCE_X;
706 font = mfont__select (frame, &spec, 0);
708 rfont = mfont__open (frame, font, &spec);
711 mfont_put_prop (&spec, Mregistry, Municode_bmp);
712 spec.source = MFONT_SOURCE_FT;
713 font = mfont__select (frame, &spec, 0);
715 rfont = mfont__open (frame, font, &spec);
720 rfont = mfont__lookup_fontset (rface->rfontset, NULL, &num,
721 Mlatin, Mnil, Mnil, size, 0);
727 rface->rfont = rfont;
728 rface->layouter = rfont->layouter;
729 rfont->layouter = Mnil;
730 work_gstring.glyphs[0].rface = rface;
731 work_gstring.glyphs[0].code = MCHAR_INVALID_CODE;
732 mfont__get_metric (&work_gstring, 0, 1);
733 rface->ascent = work_gstring.glyphs[0].ascent;
734 rface->descent = work_gstring.glyphs[0].descent;
735 work_gstring.glyphs[0].code
736 = mfont__encode_char (frame, (MFont *) rfont, NULL, ' ');
737 if (work_gstring.glyphs[0].code != MCHAR_INVALID_CODE)
739 mfont__get_metric (&work_gstring, 0, 1);
740 rface->space_width = work_gstring.glyphs[0].width;
743 rface->space_width = rfont->spec.size / 10;
744 if (rfont->average_width)
745 rface->average_width = rfont->average_width;
748 work_gstring.glyphs[0].code
749 = mfont__encode_char (frame, (MFont *) rfont, NULL, 'x');
750 if (work_gstring.glyphs[0].code != MCHAR_INVALID_CODE)
752 mfont__get_metric (&work_gstring, 0, 1);
753 rface->average_width = work_gstring.glyphs[0].width;
756 rface->average_width = rface->space_width;
762 rface->space_width = frame->space_width;
765 rface->hline = (MFaceHLineProp *) merged_face.property[MFACE_HLINE];
766 if (rface->hline && rface->hline->width == 0)
768 rface->box = (MFaceBoxProp *) merged_face.property[MFACE_BOX];
769 if (rface->box && rface->box->width == 0)
771 rface->ascii_rface = rface;
772 (*frame->driver->realize_face) (rface);
774 func = (MFaceHookFunc) rface->face.property[MFACE_HOOK_FUNC];
775 if (func && func != noop_hook)
776 (func) (&(rface->face), rface->info, rface->face.property[MFACE_HOOK_ARG]);
778 rface->non_ascii_list = mplist ();
781 MRealizedFace *nofont;
783 MSTRUCT_CALLOC (nofont, MERROR_FACE);
785 nofont->non_ascii_list = NULL;
786 nofont->rfont = NULL;
787 mplist_add (rface->non_ascii_list, Mt, nofont);
795 mface__for_chars (MSymbol script, MSymbol language, MSymbol charset,
796 MGlyph *from_g, MGlyph *to_g, int size)
798 MRealizedFont *rfont = from_g->rface->rfont;
800 int num = to_g - from_g;
803 if (from_g->rface->font)
805 MRealizedFace *rface = from_g->rface, *new;
808 rfont = mfontset__get_font (rface->frame,
809 rface->face.property[MFACE_FONTSET],
812 else if (script != Mlatin)
813 rfont = mfontset__get_font (rface->frame,
814 rface->face.property[MFACE_FONTSET],
816 (MFont *) rfont, NULL);
819 for (; from_g < to_g && from_g->rface->font; from_g++)
820 from_g->code = MCHAR_INVALID_CODE;
824 if (rface->rfont == rfont && rfont->layouter == Mnil)
828 MSTRUCT_MALLOC (new, MERROR_FACE);
829 mplist_push (rface->non_ascii_list, Mt, new);
832 new->layouter = rfont->layouter;
833 rfont->layouter = Mnil;
834 new->non_ascii_list = NULL;
835 new->ascent = rfont->ascent;
836 new->descent = rfont->descent;
838 for (; from_g < to_g && from_g->rface->font; from_g++)
843 from_g->code = mfont__flt_encode_char (new->layouter,
845 if (from_g->code == MCHAR_INVALID_CODE)
847 from_g->rface = rface;
848 from_g->code = mfont__encode_char (rfont->frame,
854 from_g->code = mfont__encode_char (rfont->frame,
862 if (rfont && script == Mlatin)
864 for (i = 0; i < num; i++)
866 unsigned code = mfont__encode_char (rfont->frame, (MFont *) rfont,
868 if (code == MCHAR_INVALID_CODE)
870 from_g[i].code = code;
872 if (i == num || from_g[i].rface->font)
876 rfont = mfont__lookup_fontset (from_g->rface->rfontset, from_g, &num,
877 script, language, charset, size, 0);
880 layouter = rfont->layouter;
881 rfont->layouter = Mnil;
885 from_g->code = MCHAR_INVALID_CODE;
892 while (from_g < to_g)
895 MRealizedFace *rface = from_g++->rface;
897 while (from_g < to_g && rface == from_g->rface) from_g++;
898 if (rface->rfont != rfont
899 || rface->layouter != layouter)
901 MPlist *plist = mplist_find_by_value (rface->non_ascii_list, rfont);
902 MRealizedFace *new = NULL;
906 new = MPLIST_VAL (plist);
907 if (new->layouter == layouter)
909 plist = mplist_find_by_value (MPLIST_NEXT (plist), rfont);
913 MSTRUCT_MALLOC (new, MERROR_FACE);
914 mplist_push (rface->non_ascii_list, Mt, new);
917 new->layouter = layouter;
918 new->non_ascii_list = NULL;
921 new->ascent = rfont->ascent;
922 new->descent = rfont->descent;
934 mface__free_realized (MRealizedFace *rface)
938 MPLIST_DO (plist, rface->non_ascii_list)
939 free (MPLIST_VAL (plist));
940 M17N_OBJECT_UNREF (rface->non_ascii_list);
941 if (rface->font && rface->font->type != MFONT_TYPE_REALIZED)
947 mface__update_frame_face (MFrame *frame)
950 frame->rface = mface__realize (frame, NULL, 0, 0, NULL);
951 frame->space_width = frame->rface->space_width;
952 frame->average_width = frame->rface->average_width;
953 frame->ascent = frame->rface->ascent;
954 frame->descent = frame->rface->descent;
958 #endif /* !FOR_DOXYGEN || DOXYGEN_INTERNAL_MODULE */
962 /*** @addtogroup m17nFace */
966 /***en @name Variables: Keys of face property */
967 /***ja @name ÊÑ¿ô: ¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼ */
972 @brief Key of a face property specifying foreground color.
974 The variable #Mforeground is used as a key of face property. The
975 property value must be a symbol whose name is a color name, or
978 #Mnil means that the face does not specify a foreground color.
979 Otherwise, the foreground of an M-text is drawn by the specified
982 @brief Á°·Ê¿§¤ò»ØÄꤹ¤ë¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
984 ÊÑ¿ô #Mforeground ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£
985 ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢¿§Ì¾¤ò̾Á°¤È¤·¤Æ»ý¤Ä¥·¥ó¥Ü¥ë¤« #Mnil ¤Ç¤¢¤ë¡£
987 #Mnil ¤Î¾ì¹ç¡¢Á°·Ê¿§¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð M-text
988 ¤ÎÁ°·Ê¤Ï»ØÄꤵ¤ì¤¿¿§¤Çɽ¼¨¤µ¤ì¤ë¡£ */
993 @brief Key of a face property specifying background color.
995 The variable #Mbackground is used as a key of face property. The
996 property value must be a symbol whose name is a color name, or
999 #Mnil means that the face does not specify a background color.
1000 Otherwise, the background of an M-text is drawn by the specified
1003 @brief ÇØ·Ê¿§¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
1005 ÊÑ¿ô #Mbackground ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£
1006 ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢¿§Ì¾¤ò̾Á°¤È¤·¤Æ»ý¤Ä¥·¥ó¥Ü¥ë¤« #Mnil ¤Ç¤¢¤ë¡£
1008 #Mnil ¤Î¾ì¹ç¡¢ÇØ·Ê¿§¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð M-text
1009 ¤ÎÇطʤϻØÄꤵ¤ì¤¿¿§¤Çɽ¼¨¤µ¤ì¤ë¡£ */
1011 MSymbol Mbackground;
1014 @brief Key of a face property specifying video mode.
1016 The variable #Mvideomode is used as a key of face property. The
1017 property value must be #Mnormal, #Mreverse, or #Mnil.
1019 #Mnormal means that an M-text is drawn in normal video mode
1020 (i.e. the foreground is drawn by foreground color, the background
1021 is drawn by background color).
1023 #Mreverse means that an M-text is drawn in reverse video mode
1024 (i.e. the foreground is drawn by background color, the background
1025 is drawn by foreground color).
1027 #Mnil means that the face does not specify a video mode. */
1029 @brief ¥Ó¥Ç¥ª¥â¡¼¥É¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
1031 ÊÑ¿ô #Mvideomode ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢
1032 #Mnormal, #Mreverse, #Mnil ¤Î¤¤¤º¤ì¤«¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
1034 #Mnormal ¤Î¾ì¹ç¤Ï¡¢M-text
1035 ¤òɸ½à¤Î¥Ó¥Ç¥ª¥â¡¼¥É¡ÊÁ°·Ê¤òÁ°·Ê¿§¤Ç¡¢ÇطʤòÇØ·Ê¿§¤Ç¡Ë¤Çɽ¼¨¤¹¤ë¡£
1037 #Mreverse ¤Î¾ì¹ç¤Ï¥ê¥Ð¡¼¥¹¥Ó¥Ç¥ª¥â¡¼¥É¤Ç¡ÊÁ°·Ê¤òÇØ·Ê¿§¤Ç¡¢ÇطʤòÁ°·Ê¿§¤Ç¡Ëɽ¼¨¤¹¤ë¡£
1039 #Mnil ¤Î¾ì¹ç¤Ï¥Ó¥Ç¥ª¥â¡¼¥É¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1045 @brief Key of a face property specifying font size ratio.
1047 The variable #Mratio is used as a key of face property. The value
1048 RATIO must be an integer.
1050 The value 0 means that the face does not specify a font size
1051 ratio. Otherwise, an M-text is drawn by a font of size (FONTSIZE
1052 * RATIO / 100) where FONTSIZE is a font size specified by the face
1055 @brief ¥Õ¥©¥ó¥È¤Î¥µ¥¤¥º¤ÎÈæΨ¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
1057 ÊÑ¿ô #Mratio ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃÍ RATIO
1058 ¤ÏÀ°¿ôÃͤǤʤ¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
1060 Ãͤ¬0¤Ê¤é¤Ð¡¢¥Õ¥©¥ó¥È¥µ¥¤¥º¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¡¢M-text
1061 ¤Ï(FONTSIZE * RATIO / 100) ¤È¤¤¤¦¥µ¥¤¥º¤Î¥Õ¥©¥ó¥È¤Çɽ¼¨¤µ¤ì¤ë¡£
1062 FONTSIZE ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼#Msize ¤Ç»ØÄꤵ¤ì¤¿¥µ¥¤¥º¤Ç¤¢¤ë¡£ */
1067 @brief Key of a face property specifying horizontal line.
1069 The variable #Mhline is used as a key of face property. The value
1070 must be a pointer to an object of type #MFaceHLineProp, or @c
1073 The value @c NULL means that the face does not specify this
1074 property. Otherwise, an M-text is drawn with a horizontal line by
1075 a way specified by the object that the value points to. */
1077 @brief ¿åÊ¿Àþ¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
1079 ÊÑ¿ô #Mhline ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃͤÏ
1080 #MFaceHLineProp ·¿¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤« @c NULL ¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
1082 Ãͤ¬ @c NULL ¤Ê¤é¤Ð¡¢¤³¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1083 ¤½¤¦¤Ç¤Ê¤±¤ì¤ÐÃͤ¬»Ø¤¹¥ª¥Ö¥¸¥§¥¯¥È¤Ë»ØÄꤵ¤ì¤¿¤è¤¦¤Ë¿åÊ¿Àþ¤òÉղä·¤Æ M-text
1089 @brief Key of a face property specifying box.
1091 The variable #Mbox is used as a key of face property. The value
1092 must be a pointer to an object of type #MFaceBoxProp, or @c NULL.
1094 The value @c NULL means that the face does not specify a box.
1095 Otherwise, an M-text is drawn with a surrounding box by a way
1096 specified by the object that the value points to. */
1098 @brief °Ï¤ßÏȤò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
1100 ÊÑ¿ô #Mbox ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃͤÏ
1101 #MFaceBoxProp ·¿¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤« @c NULL ¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
1103 Ãͤ¬ @c NULL ¤Ê¤é¤Ð¡¢¤³¤Î¥Õ¥§¡¼¥¹¤Ï°Ï¤ßÏȤò»ØÄꤷ¤Æ¤¤¤Ê¤¤¡£
1104 ¤½¤¦¤Ç¤Ê¤±¤ì¤ÐÃͤ¬»Ø¤¹¥ª¥Ö¥¸¥§¥¯¥È¤Ë»ØÄꤵ¤ì¤¿¤è¤¦¤Ë°Ï¤ßÏȤòÉղä·¤Æ
1105 M-text ¤òɽ¼¨¤¹¤ë¡£*/
1110 @brief Key of a face property specifying fontset.
1112 The variable #Mfontset is used as a key of face property. The
1113 value must be a pointer to an object of type #Mfontset, or @c
1116 The value @c NULL means that the face does not specify a fontset.
1117 Otherwise, an M-text is drawn with a font selected from what
1118 specified in the fontset. */
1120 @brief ¥Õ¥©¥ó¥È¥»¥Ã¥È¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
1122 ÊÑ¿ô #Mfontset ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃͤÏ
1123 #Mfontset ·¿¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤« @c NULL ¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
1125 Ãͤ¬ @c NULL ¤Ê¤é¤Ð¡¢¥Õ¥©¥ó¥È¥»¥Ã¥È¤Ï»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£
1126 ¤½¤¦¤Ç¤Ê¤±¤ì¤ÐÃͤ¬»Ø¤¹¥ª¥Ö¥¸¥§¥¯¥È¤Ë»ØÄꤵ¤ì¤¿¥Õ¥©¥ó¥È¥»¥Ã¥È¤«¤éÁª¤ó¤À¥Õ¥©¥ó¥È¤Ç
1127 M-text ¤òɽ¼¨¤¹¤ë¡£*/
1132 @brief Key of a face property specifying hook.
1134 The variable #Mhook_func is used as a key of face property. The
1135 value must be a function of type #MFaceHookFunc, or @c NULL.
1137 The value @c NULL means that the face does not specify a hook.
1138 Otherwise, the specified function is called before the face is
1141 @brief ¥Õ¥Ã¥¯¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
1143 ÊÑ¿ô #Mhook_func ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃͤÏ
1144 #MFaceHookFunc ·¿¤Î´Ø¿ô¤« @c NULL ¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
1146 Ãͤ¬ @c NULL ¤Ê¤é¤Ð¡¢¥Õ¥Ã¥¯¤Ï»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£
1147 ¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¥Õ¥§¡¼¥¹¤ò¼Â¸½¤¹¤ëÁ°¤Ë»ØÄꤵ¤ì¤¿´Ø¿ô¤¬¸Æ¤Ð¤ì¤ë¡£ */
1151 @brief Key of a face property specifying argument of hook.
1153 The variable #Mhook_arg is used as a key of face property. The
1154 value can be anything that is passed a hook function specified by
1155 the face property #Mhook_func. */
1157 @brief ¥Õ¥Ã¥¯¤Î°ú¿ô¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
1159 ÊÑ¿ô #Mhook_arg ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£
1160 Ãͤϲ¿¤Ç¤â¤è¤¯¡¢¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£ #Mhook_func ¤Ç»ØÄꤵ¤ì¤ë´Ø¿ô¤ËÅϤµ¤ì¤ë¡£ */
1166 /*** @ingroup m17nFace */
1167 /***en @name Variables: Possible values of #Mvideomode property of face */
1168 /***ja @name ÊÑ¿ô¡§ ¥Õ¥§¡¼¥¹¤Î #Mvideomode ¥×¥í¥Ñ¥Æ¥£¤Î²Äǽ¤ÊÃÍ */
1173 See the documentation of the variable #Mvideomode. */
1175 ÊÑ¿ô #Mvideomode ¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£ */
1181 /*** @ingroup m17nFace */
1182 /***en @name Variables: Predefined faces */
1183 /***ja @name ÊÑ¿ô: ÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹ */
1188 @brief Normal video face.
1190 The variable #mface_normal_video points to a face that has the
1191 #Mvideomode property with value #Mnormal. The other properties
1192 are not specified. An M-text drawn with this face appear normal
1193 colors (i.e. the foreground is drawn by foreground color, and
1194 background is drawn by background color). */
1196 @brief ɸ½à¥Ó¥Ç¥ª¥Õ¥§¡¼¥¹.
1198 ÊÑ¿ô #mface_normal_video ¤Ï #Mvideomode ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ #Mnormal
1199 ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1200 ¤³¤Î¥Õ¥§¡¼¥¹¤Çɽ¼¨¤µ¤ì¤ëM-text
1201 ¤Ïɸ½à¤Î¿§ (¤¹¤Ê¤ï¤ÁÁ°·Ê¤ÏÁ°·Ê¿§¡¢ÇطʤÏÇØ·Ê¿§¡Ë¤ÇÉÁ¤«¤ì¤ë¡£ */
1203 MFace *mface_normal_video;
1206 @brief Reverse video face.
1208 The variable #mface_reverse_video points to a face that has the
1209 #Mvideomode property with value #Mreverse. The other properties
1210 are not specified. An M-text drawn with this face appear in
1211 reversed colors (i.e. the foreground is drawn by background
1212 color, and background is drawn by foreground color). */
1214 @brief ¥ê¥Ð¡¼¥¹¥Ó¥Ç¥ª¥Õ¥§¡¼¥¹.
1216 ÊÑ¿ô #mface_reverse_video ¤Ï #Mvideomode ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬
1217 #Mreverse ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1218 ¤³¤Î¥Õ¥§¡¼¥¹¤Çɽ¼¨¤µ¤ì¤ëM-text
1219 ¤ÏÁ°·Ê¿§¤ÈÇØ·Ê¿§¤¬Æþ¤ìÂؤï¤Ã¤Æ (¤¹¤Ê¤ï¤ÁÁ°·Ê¤ÏÇØ·Ê¿§¡¢ÇطʤÏÁ°·Ê¿§¡ËÉÁ¤«¤ì¤ë¡£ */
1221 MFace *mface_reverse_video;
1224 @brief Underline face.
1226 The variable #mface_underline points to a face that has the
1227 #Mhline property with value a pointer to an object of type
1228 #MFaceHLineProp. The members of the object are as follows:
1233 type MFACE_HLINE_UNDER
1238 The other properties are not specified. An M-text that has this
1239 face is drawn with an underline. */
1241 @brief ²¼Àþ¥Õ¥§¡¼¥¹.
1243 ÊÑ¿ô #mface_underline ¤Ï #Mhline ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ #MFaceHLineProp
1244 ·¿¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£¥ª¥Ö¥¸¥§¥¯¥È¤Î¥á¥ó¥Ð¤Ï°Ê²¼¤ÎÄ̤ꡣ
1249 type MFACE_HLINE_UNDER
1254 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ï²¼ÀþÉÕ¤¤Çɽ¼¨¤µ¤ì¤ë¡£*/
1256 MFace *mface_underline;
1261 The variable #mface_medium points to a face that has the #Mweight
1262 property with value a symbol of name "medium". The other
1263 properties are not specified. An M-text that has this face is
1264 drawn with a font of medium weight. */
1266 @brief ¥ß¥Ç¥£¥¢¥à¥Õ¥§¡¼¥¹.
1268 ÊÑ¿ô #mface_medium ¤Ï #Mweight ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "medium"
1269 ¤È¤¤¤¦Ì¾Á°¤ò¤â¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1270 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text
1271 ¤Ï¡¢¥ß¥Ç¥£¥¢¥à¥¦¥§¥¤¥È¤Î¥Õ¥©¥ó¥È¤Çɽ¼¨¤µ¤ì¤ë¡£ */
1272 MFace *mface_medium;
1277 The variable #mface_bold points to a face that has the #Mweight
1278 property with value a symbol of name "bold". The other properties
1279 are not specified. An M-text that has this face is drawn with a
1280 font of bold weight. */
1282 @brief ¥Ü¡¼¥ë¥É¥Õ¥§¡¼¥¹.
1284 ÊÑ¿ô #mface_bold ¤Ï #Mweight ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "bold"
1285 ¤È¤¤¤¦Ì¾Á°¤ò¤â¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1286 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text
1287 ¤Ï¡¢¥Ü¡¼¥ë¥É¥Õ¥©¥ó¥È¤Çɽ¼¨¤µ¤ì¤ë¡£ */
1294 The variable #mface_italic points to a face that has the #Mstyle
1295 property with value a symbol of name "italic". The other
1296 properties are not specified. An M-text that has this face is
1297 drawn with a font of italic style. */
1299 @brief ¥¤¥¿¥ê¥Ã¥¯¥Õ¥§¡¼¥¹.
1301 ÊÑ¿ô #mface_italic ¤Ï #Mstyle ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "italic"
1302 ¤È¤¤¤¦Ì¾Á°¤ò¤â¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1303 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text
1304 ¤Ï¡¢¥¤¥¿¥ê¥Ã¥¯ÂΤÇɽ¼¨¤µ¤ì¤ë¡£ */
1306 MFace *mface_italic;
1309 @brief Bold italic face.
1311 The variable #mface_bold_italic points to a face that has the
1312 #Mweight property with value a symbol of name "bold", and #Mstyle
1313 property with value a symbol of name "italic". The other
1314 properties are not specified. An M-text that has this face is
1315 drawn with a font of bold weight and italic style. */
1317 @brief ¥Ü¡¼¥ë¥É¥¤¥¿¥ê¥Ã¥¯¥Õ¥§¡¼¥¹.
1319 ÊÑ¿ô #mface_bold_italic ¤Ï¡¢#Mweight ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "bold"
1320 ¤È¤¤¤¦Ì¾Á°¤ò¤â¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ê¡¢¤«¤Ä #Mstyle ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "italic"
1321 ¤È¤¤¤¦Ì¾Á°¤ò¤â¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1322 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text
1323 ¤Ï¡¢¥Ü¡¼¥ë¥É¥¤¥¿¥ê¥Ã¥¯ÂΤÇɽ¼¨¤µ¤ì¤ë¡£ */
1325 MFace *mface_bold_italic;
1328 @brief Smallest face.
1330 The variable #mface_xx_small points to a face that has the #Mratio
1331 property with value 50. The other properties are not specified.
1332 An M-text that has this face is drawn with a font whose size is
1333 50% of a normal font. */
1335 @brief ºÇ¾®¤Î¥Õ¥§¡¼¥¹.
1337 ÊÑ¿ô #mface_xx_small ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 50
1338 ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1339 ¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ïɸ½à¥Õ¥©¥ó¥È¤Î 50% ¤ÎÂ礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1342 MFace *mface_xx_small;
1345 @brief Smaller face.
1347 The variable #mface_x_small points to a face that has the #Mratio
1348 property with value 66. The other properties are not specified.
1349 An M-text that has this face is drawn with a font whose size is
1350 66% of a normal font. */
1352 @brief ¤è¤ê¾®¤µ¤¤¥Õ¥§¡¼¥¹.
1354 ÊÑ¿ô #mface_x_small ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 66
1355 ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1356 ¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ïɸ½à¥Õ¥©¥ó¥È¤Î 66% ¤ÎÂ礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1359 MFace *mface_x_small;
1364 The variable #mface_x_small points to a face that has the #Mratio
1365 property with value 75. The other properties are not specified.
1366 An M-text that has this face is drawn with a font whose size is
1367 75% of a normal font. */
1369 @brief ¾®¤µ¤¤¥Õ¥§¡¼¥¹.
1371 ÊÑ¿ô #mface_small ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 75
1372 ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1373 ¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ïɸ½à¥Õ¥©¥ó¥È¤Î 75% ¤ÎÂ礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1379 @brief Normalsize face.
1381 The variable #mface_normalsize points to a face that has the
1382 #Mratio property with value 100. The other properties are not
1383 specified. An M-text that has this face is drawn with a font
1384 whose size is the same as a normal font. */
1386 @brief ɸ½à¤ÎÂ礤µ¤Î¥Õ¥§¡¼¥¹.
1388 ÊÑ¿ô #mface_normalsize ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 100
1389 ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1390 ¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ïɸ½à¥Õ¥©¥ó¥È¤ÈƱ¤¸Â礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1393 MFace *mface_normalsize;
1398 The variable #mface_large points to a face that has the #Mratio
1399 property with value 120. The other properties are not specified.
1400 An M-text that has this face is drawn with a font whose size is
1401 120% of a normal font. */
1403 @brief Â礤¤¥Õ¥§¡¼¥¹.
1405 ÊÑ¿ô #mface_large ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 120
1406 ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1407 ¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ïɸ½à¥Õ¥©¥ó¥È¤Î 120% ¤ÎÂ礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1415 The variable #mface_x_large points to a face that has the #Mratio
1416 property with value 150. The other properties are not specified.
1417 An M-text that has this face is drawn with a font whose size is
1418 150% of a normal font. */
1420 @brief ¤â¤Ã¤ÈÂ礤¤¥Õ¥§¡¼¥¹.
1422 ÊÑ¿ô #mface_x_large ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 150
1423 ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1424 ¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ïɸ½à¥Õ¥©¥ó¥È¤Î 150% ¤ÎÂ礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1427 MFace *mface_x_large;
1430 @brief Largest face.
1432 The variable #mface_xx_large points to a face that has the #Mratio
1433 property with value 200. The other properties are not specified.
1434 An M-text that has this face is drawn with a font whose size is
1435 200% of a normal font. */
1437 @brief ºÇÂç¤Î¥Õ¥§¡¼¥¹.
1439 ÊÑ¿ô #mface_xx_large ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 200
1440 ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1441 ¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ïɸ½à¥Õ¥©¥ó¥È¤Î 200% ¤ÎÂ礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1444 MFace *mface_xx_large;
1449 The variable #mface_black points to a face that has the
1450 #Mforeground property with value a symbol of name "black". The
1451 other properties are not specified. An M-text that has this face
1452 is drawn with black foreground. */
1456 ÊÑ¿ô #mface_black ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "black"
1457 ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1458 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text
1459 ¤ÏÁ°·Ê¿§¤È¤·¤Æ¹õ¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£ */
1466 The variable #mface_white points to a face that has the
1467 #Mforeground property with value a symbol of name "white". The
1468 other properties are not specified. An M-text that has this face
1469 is drawn with white foreground. */
1473 ÊÑ¿ô #mface_white ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "white"
1474 ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1475 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text
1476 ¤ÏÁ°·Ê¿§¤È¤·¤ÆÇò¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£ */
1483 The variable #mface_red points to a face that has the
1484 #Mforeground property with value a symbol of name "red". The
1485 other properties are not specified. An M-text that has this face
1486 is drawn with red foreground. */
1490 ÊÑ¿ô #mface_red ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "red"
1491 ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1492 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text
1493 ¤ÏÁ°·Ê¿§¤È¤·¤ÆÀÖ¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£ */
1500 The variable #mface_green points to a face that has the
1501 #Mforeground property with value a symbol of name "green". The
1502 other properties are not specified. An M-text that has this face
1503 is drawn with green foreground. */
1507 ÊÑ¿ô #mface_green ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "green"
1508 ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1509 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text
1510 ¤ÏÁ°·Ê¿§¤È¤·¤ÆÎФòÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£ */
1517 The variable #mface_blue points to a face that has the
1518 #Mforeground property with value a symbol of name "blue". The
1519 other properties are not specified. An M-text that has this face
1520 is drawn with blue foreground. */
1524 ÊÑ¿ô #mface_blue ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "blue"
1525 ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1526 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text
1527 ¤ÏÁ°·Ê¿§¤È¤·¤ÆÀĤòÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£ */
1534 The variable #mface_cyan points to a face that has the
1535 #Mforeground property with value a symbol of name "cyan". The
1536 other properties are not specified. An M-text that has this face
1537 is drawn with cyan foreground. */
1539 @brief ¥·¥¢¥ó¥Õ¥§¡¼¥¹.
1541 ÊÑ¿ô #mface_cyan ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "cyan"
1542 ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1543 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text
1544 ¤ÏÁ°·Ê¿§¤È¤·¤Æ¥·¥¢¥ó¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£ */
1551 The variable #mface_yellow points to a face that has the
1552 #Mforeground property with value a symbol of name "yellow". The
1553 other properties are not specified. An M-text that has this face
1554 is drawn with yellow foreground. */
1559 ÊÑ¿ô #mface_yellow ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "yellow"
1560 ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1561 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text
1562 ¤ÏÁ°·Ê¿§¤È¤·¤Æ²«¿§¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£ */
1564 MFace *mface_yellow;
1567 @brief Magenta face.
1569 The variable #mface_magenta points to a face that has the
1570 #Mforeground property with value a symbol of name "magenta". The
1571 other properties are not specified. An M-text that has this face
1572 is drawn with magenta foreground. */
1575 @brief ¥Þ¥¼¥ó¥¿¥Õ¥§¡¼¥¹.
1577 ÊÑ¿ô #mface_magenta ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ
1578 "magenta" ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1579 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text
1580 ¤ÏÁ°·Ê¿§¤È¤·¤Æ¥Þ¥¼¥ó¥¿¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£ */
1582 MFace *mface_magenta;
1587 /***en @name Variables: The other symbols for face handling. */
1588 /***ja @name ÊÑ¿ô: ¥Õ¥§¡¼¥¹¤ò¼è¤ê°·¤¦¤¿¤á¤Î¤½¤Î¾¤Î¥·¥ó¥Ü¥ë */
1593 @brief Key of a text property specifying a face.
1595 The variable #Mface is a symbol of name <tt>"face"</tt>. A text
1596 property whose key is this symbol must have a pointer to an object
1597 of type #MFace. This is a managing key. */
1600 @brief ¥Õ¥§¡¼¥¹¤ò»ØÄꤹ¤ë¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼.
1602 ÊÑ¿ô #Mface ¤Ï <tt>"face"</tt>
1603 ¤È¤¤¤¦Ì¾Á°¤ò»ý¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¡£¤³¤Î¥·¥ó¥Ü¥ë¤ò¥¡¼¤È¤¹¤ë¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Ï¡¢
1604 #MFace ·¿¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
1605 ¤³¤ì¤Ï´ÉÍý¥¡¼¤Ç¤¢¤ë¡£ */
1613 @brief Create a new face.
1615 The mface () function creates a new face object that specifies no
1619 This function returns a pointer to the created face. */
1622 @brief ¿·¤·¤¤¥Õ¥§¡¼¥¹¤ò¤Ä¤¯¤ë.
1625 ¤Ï¥×¥í¥Ñ¥Æ¥£¤ò°ìÀÚ»ý¤¿¤Ê¤¤¿·¤·¤¤¥Õ¥§¡¼¥¹¥ª¥Ö¥¸¥§¥¯¥È¤òºî¤ë¡£
1628 ¤³¤Î´Ø¿ô¤Ïºî¤Ã¤¿¥Õ¥§¡¼¥¹¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ */
1635 M17N_OBJECT (face, free_face, MERROR_FACE);
1636 face->frame_list = mplist ();
1637 M17N_OBJECT_REGISTER (face_table, face);
1644 @brief Make a copy of a face.
1646 The mface_copy () function makes a copy of $FACE and returns a
1647 pointer to the created copy. */
1650 @brief ¥Õ¥§¡¼¥¹¤Î¥³¥Ô¡¼¤òºî¤ë.
1652 ´Ø¿ô mface_copy () ¤Ï¥Õ¥§¡¼¥¹ $FACE
1653 ¤Î¥³¥Ô¡¼¤òºî¤ê¡¢¤½¤Î¥³¥Ô¡¼¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ */
1656 mface_copy (MFace *face)
1660 MSTRUCT_CALLOC (copy, MERROR_FACE);
1662 copy->control.ref_count = 1;
1663 M17N_OBJECT_REGISTER (face_table, copy);
1664 copy->frame_list = mplist ();
1665 if (copy->property[MFACE_FONTSET])
1666 M17N_OBJECT_REF (copy->property[MFACE_FONTSET]);
1672 @brief Compare faces.
1674 The mface_equal () function compares faces $FACE1 and $FACE2.
1676 @return If two faces have the same property values, return 1.
1677 Otherwise return 0. */
1680 mface_equal (MFace *face1, MFace *face2)
1682 MFaceHLineProp *hline1, *hline2;
1683 MFaceBoxProp *box1, *box2;
1688 if (memcmp (face1->property, face2->property, sizeof face1->property) == 0)
1690 for (i = MFACE_FOUNDRY; i <= MFACE_BACKGROUND; i++)
1691 if (face1->property[i] != face2->property[i])
1693 for (i = MFACE_VIDEOMODE; i <= MFACE_RATIO; i++)
1694 if (face1->property[i] != face2->property[i])
1696 hline1 = (MFaceHLineProp *) face1->property[MFACE_HLINE];
1697 hline2 = (MFaceHLineProp *) face2->property[MFACE_HLINE];
1698 if (hline1 != hline2)
1700 if (! hline1 || ! hline2)
1702 if (memcmp (hline1, hline2, sizeof (MFaceHLineProp)) != 0)
1705 box1 = (MFaceBoxProp *) face1->property[MFACE_BOX];
1706 box2 = (MFaceBoxProp *) face2->property[MFACE_BOX];
1709 if (! box1 || ! box2)
1711 if (memcmp (box1, box2, sizeof (MFaceBoxProp)) != 0)
1722 The mface_merge () functions merges the properties of face $SRC
1726 This function returns $DST. */
1729 @brief ¥Õ¥§¡¼¥¹¤òÅý¹ç¤¹¤ë.
1731 ´Ø¿ô mface_merge () ¤Ï¡¢¥Õ¥§¡¼¥¹ $SRC ¤Î¥×¥í¥Ñ¥Æ¥£¤ò¥Õ¥§¡¼¥¹ $DST
1735 ¤³¤Î´Ø¿ô¤Ï $DST ¤òÊÖ¤¹¡£ */
1738 mface_merge (MFace *dst, MFace *src)
1743 for (i = 0; i < MFACE_PROPERTY_MAX; i++)
1744 if (src->property[i])
1746 if (i == MFACE_FONTSET)
1748 M17N_OBJECT_UNREF (dst->property[i]);
1749 M17N_OBJECT_REF (src->property[i]);
1751 dst->property[i] = src->property[i];
1754 MPLIST_DO (plist, dst->frame_list)
1756 MFrame *frame = MPLIST_VAL (plist);
1759 if (dst == frame->face)
1760 mface__update_frame_face (frame);
1769 @brief Make a face from a font.
1771 The mface_from_font () function return a newly created face while
1772 reflecting the properties of $FONT in its properties. */
1775 @brief ¥Õ¥©¥ó¥È¤«¤é¥Õ¥§¡¼¥¹¤òºî¤ë.
1777 ´Ø¿ô mface_from_font () ¤Ï¥Õ¥©¥ó¥È $FONT
1778 ¤Î¥×¥í¥Ñ¥Æ¥£¤ò¥×¥í¥Ñ¥Æ¥£¤È¤·¤Æ»ý¤Ä¿·¤·¤¤¥Õ¥§¡¼¥¹¤òºî¤ê¡¢¤½¤ì¤òÊÖ¤¹¡£ */
1781 mface_from_font (MFont *font)
1783 MFace *face = mface ();
1785 face->property[MFACE_FOUNDRY] = mfont_get_prop (font, Mfoundry);
1786 face->property[MFACE_FAMILY] = mfont_get_prop (font, Mfamily);
1787 face->property[MFACE_WEIGHT] = mfont_get_prop (font, Mweight);
1788 face->property[MFACE_STYLE] = mfont_get_prop (font, Mstyle);
1789 face->property[MFACE_STRETCH] = mfont_get_prop (font, Mstretch);
1790 face->property[MFACE_ADSTYLE] = mfont_get_prop (font, Madstyle);
1791 face->property[MFACE_SIZE] = mfont_get_prop (font, Msize);
1798 @brief Get the value of a face property.
1800 The mface_get_prop () function returns the value of the face
1801 property whose key is $KEY in face $FACE. $KEY must be one of the
1804 #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
1805 #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
1806 #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg
1809 The actual type of the returned value depends of $KEY. See
1810 documentation of the above keys. If an error is detected, it
1811 returns @c NULL and assigns an error code to the external variable
1815 @brief ¥Õ¥§¡¼¥¹¤Î¥×¥í¥Ñ¥Æ¥£¤ÎÃͤòÆÀ¤ë.
1817 ´Ø¿ô mface_get_prop () ¤Ï¡¢¥Õ¥§¡¼¥¹ $FACE
1818 ¤¬»ý¤Ä¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÆâ¡¢¥¡¼¤¬ $KEY ¤Ç¤¢¤ë¤â¤Î¤ÎÃͤòÊÖ¤¹¡£
1819 $KEY ¤Ï²¼µ¤Î¤¤¤º¤ì¤«¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
1821 #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
1822 #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
1823 #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg
1826 Ìá¤êÃͤη¿¤Ï $KEY ¤Ë°Í¸¤¹¤ë¡£¾åµ¤Î¥¡¼¤ÎÀâÌÀ¤ò»²¾È¤¹¤ë¤³¤È¡£
1827 ¥¨¥é¡¼¤¬¸¡½Ð¤µ¤ì¤¿¾ì¹ç¤Ï @c NULL ¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô #merror_code
1828 ¤Ë¥¨¥é¡¼¥³¡¼¥É¤òÀßÄꤹ¤ë¡£ */
1838 mface_get_prop (MFace *face, MSymbol key)
1840 int index = (int) msymbol_get (key, M_face_prop_index) - 1;
1843 MERROR (MERROR_FACE, NULL);
1844 return face->property[index];
1850 @brief Set a value of a face property.
1852 The mface_put_prop () function assigns $VAL to the property whose
1853 key is $KEY in face $FACE. $KEY must be one the followings:
1855 #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
1856 #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
1857 #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg
1859 Among them, font related properties (#Mfoundry through #Msize) are
1860 used as the default values when a font in the fontset of $FACE
1861 does not specify those values.
1863 The actual type of the returned value depends of $KEY. See
1864 documentation of the above keys.
1867 If the operation was successful, mface_put_prop () returns 0.
1868 Otherwise it returns -1 and assigns an error code to the external
1869 variable #merror_code. */
1872 @brief ¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤòÀßÄꤹ¤ë.
1874 ´Ø¿ô mface_put_prop () ¤Ï¡¢¥Õ¥§¡¼¥¹ $FACE Æâ¤Ç¥¡¼¤¬ $KEY
1875 ¤Ç¤¢¤ë¥×¥í¥Ñ¥Æ¥£¤ÎÃͤò $VAL ¤ËÀßÄꤹ¤ë¡£$KEY
1876 ¤Ï°Ê²¼¤Î¤¤¤º¤ì¤«¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
1878 #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
1879 #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
1880 #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg.
1882 ¤³¤ì¤é¤Î¤¦¤Á¤Î¡¢¥Õ¥©¥ó¥È´ØÏ¢¤Î¥×¥í¥Ñ¥Æ¥£ (#Mfamily ¤«¤é #Msize
1883 ¤Þ¤Ç) ¤Ï¡¢¥Õ¥§¡¼¥¹¤Î¥Õ¥©¥ó¥È¥»¥Ã¥ÈÃæ¤Î¥Õ¥©¥ó¥È¤Ë´Ø¤¹¤ë¥Ç¥Õ¥©¥ë¥ÈÃͤȤʤꡢ¸Ä¡¹¤Î¥Õ¥©¥ó¥È¤¬Ãͤò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¤ËÍѤ¤¤é¤ì¤ë¡£
1885 Ìá¤êÃͤη¿¤Ï $KEY ¤Ë°Í¸¤¹¤ë¡£¾åµ¤Î¥¡¼¤ÎÀâÌÀ¤ò»²¾È¤¹¤ë¤³¤È¡£
1888 ½èÍý¤¬À®¸ù¤·¤¿¾ì¹ç¡¢mface_put_prop () ¤Ï 0 ¤òÊÖ¤¹¡£¼ºÇÔ¤·¤¿¾ì¹ç¤Ï
1889 -1 ¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô #merror_code ¤Ë¥¨¥é¡¼¥³¡¼¥É¤òÀßÄꤹ¤ë¡£ */
1899 mface_put_prop (MFace *face, MSymbol key, void *val)
1901 int index = (int) msymbol_get (key, M_face_prop_index) - 1;
1905 MERROR (MERROR_FACE, -1);
1906 if (key == Mfontset)
1908 if (face->property[index])
1909 M17N_OBJECT_UNREF (face->property[index]);
1910 M17N_OBJECT_REF (val);
1912 else if (key == Mhline)
1913 val = get_hline_create (val);
1914 else if (key == Mbox)
1915 val = get_box_create (val);
1917 if (face->property[index] == val)
1919 face->property[index] = val;
1921 MPLIST_DO (plist, face->frame_list)
1923 MFrame *frame = MPLIST_VAL (plist);
1926 if (face == frame->face)
1927 mface__update_frame_face (frame);
1936 @brief Update a face.
1938 The mface_update () function update face $FACE on frame $FRAME by
1939 calling a hook function of $FACE (if any). */
1942 @brief ¥Õ¥§¡¼¥¹¤ò¹¹¿·¤¹¤ë.
1944 ´Ø¿ô mface_update () ¤Ï¥Õ¥ì¡¼¥à $FRAME ¤Î¥Õ¥§¡¼¥¹ $FACE ¤ò $FACE
1945 ¤Î¥Õ¥Ã¥¯´Ø¿ô¤ò¡Ê¤¢¤ì¤Ð¡Ë¸Æ¤ó¤Ç¹¹¿·¤¹¤ë¡£ */
1948 mface_update (MFrame *frame, MFace *face)
1950 MFaceHookFunc func = (MFaceHookFunc) face->property[MFACE_HOOK_FUNC];
1952 MRealizedFace *rface;
1954 if (func && func != noop_hook)
1956 MPLIST_DO (rface_list, frame->realized_face_list)
1958 rface = MPLIST_VAL (rface_list);
1959 if ((MFaceHookFunc) rface->face.property[MFACE_HOOK_FUNC] == func)
1960 (func) (&(rface->face), rface->face.property[MFACE_HOOK_ARG],
1970 /*** @addtogroup m17nDebug */
1977 The mdebug_dump_face () function prints face $FACE in a human readable
1978 way to the stderr. $INDENT specifies how many columns to indent
1979 the lines but the first one.
1982 This function returns $FACE. */
1985 @brief ¥Õ¥§¡¼¥¹¤ò¥À¥ó¥×¤¹¤ë.
1987 ´Ø¿ô mdebug_dump_face () ¤Ï¥Õ¥§¡¼¥¹ $FACE ¤ò stderr
1988 ¤Ë¿Í´Ö¤Ë²ÄÆɤʷÁ¤Ç°õºþ¤¹¤ë¡£ $INDENT ¤Ï£²¹ÔÌܰʹߤΥ¤¥ó¥Ç¥ó¥È¤ò»ØÄꤹ¤ë¡£
1991 ¤³¤Î´Ø¿ô¤Ï $FACE ¤òÊÖ¤¹¡£ */
1994 mdebug_dump_face (MFace *face, int indent)
1996 char *prefix = (char *) alloca (indent + 1);
1999 memset (prefix, 32, indent);
2001 mfont__set_spec_from_face (&spec, face);
2002 fprintf (stderr, "(face font:\"");
2003 mdebug_dump_font (&spec);
2004 fprintf (stderr, "\"\n %s fore:%s back:%s", prefix,
2005 msymbol_name ((MSymbol) face->property[MFACE_FOREGROUND]),
2006 msymbol_name ((MSymbol) face->property[MFACE_BACKGROUND]));
2007 if (face->property[MFACE_FONTSET])
2008 fprintf (stderr, " non-default-fontset");
2009 fprintf (stderr, " hline:%s", face->property[MFACE_HLINE] ? "yes" : "no");
2010 fprintf (stderr, " box:%s)", face->property[MFACE_BOX] ? "yes" : "no");