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_RATIO + 1]
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 { &Mratio, &Minteger } };
262 for (i = 0; i <= MFACE_RATIO; i++)
263 if (face->property[i] && serializer[i].key)
265 pl = mplist_add (pl, Msymbol, *serializer[i].key);
266 if (serializer[i].type)
267 pl = mplist_add (pl, *serializer[i].type, face->property[i]);
268 else if (i == MFACE_FONTSET)
269 pl = mplist_add (pl, Msymbol, mfontset_name ((MFontset *)
271 else if (i == MFACE_HLINE)
272 pl = serialize_hline (pl, (MFaceHLineProp *) face->property[i]);
273 else if (i == MFACE_BOX)
274 pl = serialize_box (pl, (MFaceBoxProp *) face->property[i]);
281 deserialize_hline (MPlist *plist)
283 MFaceHLineProp hline, *hline_ret;
285 if (! MPLIST_INTEGER_P (plist))
286 MERROR (MERROR_FACE, NULL);
287 hline.type = MPLIST_INTEGER_P (plist);
288 plist = MPLIST_NEXT (plist);
289 if (! MPLIST_INTEGER_P (plist))
290 MERROR (MERROR_FACE, NULL);
291 hline.width = MPLIST_INTEGER_P (plist);
292 plist = MPLIST_NEXT (plist);
293 if (! MPLIST_SYMBOL_P (plist))
294 MERROR (MERROR_FACE, NULL);
295 hline.color = MPLIST_SYMBOL (plist);
296 MSTRUCT_MALLOC (hline_ret, MERROR_FACE);
302 deserialize_box (MPlist *plist)
304 MFaceBoxProp box, *box_ret;
306 if (! MPLIST_INTEGER_P (plist))
307 MERROR (MERROR_FACE, NULL);
308 box.width = MPLIST_INTEGER (plist);
309 plist = MPLIST_NEXT (plist);
310 if (! MPLIST_INTEGER_P (plist))
311 MERROR (MERROR_FACE, NULL);
312 box.inner_hmargin = MPLIST_INTEGER (plist);
313 plist = MPLIST_NEXT (plist);
314 if (! MPLIST_INTEGER_P (plist))
315 MERROR (MERROR_FACE, NULL);
316 box.inner_vmargin = MPLIST_INTEGER (plist);
317 plist = MPLIST_NEXT (plist);
318 if (! MPLIST_INTEGER_P (plist))
319 MERROR (MERROR_FACE, NULL);
320 box.outer_hmargin = MPLIST_INTEGER (plist);
321 plist = MPLIST_NEXT (plist);
322 if (! MPLIST_INTEGER_P (plist))
323 MERROR (MERROR_FACE, NULL);
324 box.outer_vmargin = MPLIST_INTEGER (plist);
325 plist = MPLIST_NEXT (plist);
326 if (! MPLIST_SYMBOL_P (plist))
327 MERROR (MERROR_FACE, NULL);
328 box.color_top = MPLIST_SYMBOL (plist);
329 plist = MPLIST_NEXT (plist);
330 if (! MPLIST_SYMBOL_P (plist))
331 MERROR (MERROR_FACE, NULL);
332 box.color_bottom = MPLIST_SYMBOL (plist);
333 plist = MPLIST_NEXT (plist);
334 if (! MPLIST_SYMBOL_P (plist))
335 MERROR (MERROR_FACE, NULL);
336 box.color_left = MPLIST_SYMBOL (plist);
337 plist = MPLIST_NEXT (plist);
338 if (! MPLIST_SYMBOL_P (plist))
339 MERROR (MERROR_FACE, NULL);
340 box.color_right = MPLIST_SYMBOL (plist);
341 MSTRUCT_MALLOC (box_ret, MERROR_FACE);
347 deserialize_face (MPlist *plist)
349 MFace *face = mface ();
351 MPLIST_DO (plist, plist)
357 if (! MPLIST_SYMBOL_P (plist))
359 key = MPLIST_SYMBOL (plist);
360 index = (int) msymbol_get (key, M_face_prop_index) - 1;
361 plist = MPLIST_NEXT (plist);
362 if (MPLIST_TAIL_P (plist))
364 if (index < 0 || index > MFACE_RATIO)
366 if (key == Mfoundry || key == Mfamily || key == Mweight || key == Mstyle
367 || key == Mstretch || key == Madstyle
368 || key == Mforeground || key == Mbackground || key == Mvideomode)
370 if (! MPLIST_SYMBOL_P (plist))
372 val = MPLIST_VAL (plist);
374 else if (key == Msize || key == Mratio)
376 if (! MPLIST_INTEGER_P (plist))
378 val = MPLIST_VAL (plist);
380 else if (key == Mfontset)
382 if (! MPLIST_SYMBOL_P (plist))
384 val = mfontset (MSYMBOL_NAME (MPLIST_SYMBOL (plist)));
386 else if (key == Mhline)
388 if (! MPLIST_PLIST_P (plist))
390 val = deserialize_hline (MPLIST_PLIST (plist));
392 else if (key == Mbox)
394 if (! MPLIST_PLIST_P (plist))
396 val = deserialize_box (MPLIST_PLIST (plist));
398 face->property[index] = val;
403 static MGlyphString work_gstring;
409 MFace *mface__default;
415 MFaceHLineProp *hline;
418 M17N_OBJECT_ADD_ARRAY (face_table, "Face");
419 Mface = msymbol_as_managing_key ("face");
420 msymbol_put_func (Mface, Mtext_prop_serializer,
421 M17N_FUNC (serialize_face));
422 msymbol_put_func (Mface, Mtext_prop_deserializer,
423 M17N_FUNC (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_HOOK_ARG + 1] =
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 { &Mratio, MFACE_RATIO },
460 { &Mhook_arg, MFACE_HOOK_ARG } };
462 for (i = 0; i < MFACE_PROPERTY_MAX; i++)
463 /* We add one to distinguish it from no-property. */
464 msymbol_put (*mface_prop_data[i].key, M_face_prop_index,
465 (void *) (mface_prop_data[i].index + 1));
468 hline_prop_list = mplist ();
469 MSTRUCT_CALLOC (hline, MERROR_FACE);
470 mplist_push (hline_prop_list, Mt, hline);
471 box_prop_list = mplist ();
472 MSTRUCT_CALLOC (box, MERROR_FACE);
473 mplist_push (box_prop_list, Mt, box);
475 mface__default = mface ();
476 mface__default->property[MFACE_FOUNDRY] = msymbol ("misc");
477 mface__default->property[MFACE_FAMILY] = msymbol ("fixed");
478 mface__default->property[MFACE_WEIGHT] = msymbol ("medium");
479 mface__default->property[MFACE_STYLE] = msymbol ("r");
480 mface__default->property[MFACE_STRETCH] = msymbol ("normal");
481 mface__default->property[MFACE_ADSTYLE] = msymbol ("");
482 mface__default->property[MFACE_SIZE] = (void *) 120;
483 mface__default->property[MFACE_FONTSET] = mfontset (NULL);
484 mface__default->property[MFACE_FOREGROUND] = msymbol ("black");
485 mface__default->property[MFACE_BACKGROUND] = msymbol ("white");
486 mface__default->property[MFACE_HLINE] = hline;
487 mface__default->property[MFACE_BOX] = box;
488 mface__default->property[MFACE_VIDEOMODE] = Mnormal;
489 mface__default->hook = noop_hook;
491 mface_normal_video = mface ();
492 mface_normal_video->property[MFACE_VIDEOMODE] = (void *) Mnormal;
494 mface_reverse_video = mface ();
495 mface_reverse_video->property[MFACE_VIDEOMODE] = (void *) Mreverse;
498 MFaceHLineProp hline_prop;
500 hline_prop.type = MFACE_HLINE_UNDER;
501 hline_prop.width = 1;
502 hline_prop.color = Mnil;
503 mface_underline = mface ();
504 mface_put_prop (mface_underline, Mhline, &hline_prop);
507 mface_medium = mface ();
508 mface_medium->property[MFACE_WEIGHT] = (void *) msymbol ("medium");
509 mface_bold = mface ();
510 mface_bold->property[MFACE_WEIGHT] = (void *) msymbol ("bold");
511 mface_italic = mface ();
512 mface_italic->property[MFACE_STYLE] = (void *) msymbol ("i");
513 mface_bold_italic = mface_copy (mface_bold);
514 mface_bold_italic->property[MFACE_STYLE]
515 = mface_italic->property[MFACE_STYLE];
517 mface_xx_small = mface ();
518 mface_xx_small->property[MFACE_RATIO] = (void *) 50;
519 mface_x_small = mface ();
520 mface_x_small->property[MFACE_RATIO] = (void *) 67;
521 mface_small = mface ();
522 mface_small->property[MFACE_RATIO] = (void *) 75;
523 mface_normalsize = mface ();
524 mface_normalsize->property[MFACE_RATIO] = (void *) 100;
525 mface_large = mface ();
526 mface_large->property[MFACE_RATIO] = (void *) 120;
527 mface_x_large = mface ();
528 mface_x_large->property[MFACE_RATIO] = (void *) 150;
529 mface_xx_large = mface ();
530 mface_xx_large->property[MFACE_RATIO] = (void *) 200;
532 mface_black = mface ();
533 mface_black->property[MFACE_FOREGROUND] = (void *) msymbol ("black");
534 mface_white = mface ();
535 mface_white->property[MFACE_FOREGROUND] = (void *) msymbol ("white");
536 mface_red = mface ();
537 mface_red->property[MFACE_FOREGROUND] = (void *) msymbol ("red");
538 mface_green = mface ();
539 mface_green->property[MFACE_FOREGROUND] = (void *) msymbol ("green");
540 mface_blue = mface ();
541 mface_blue->property[MFACE_FOREGROUND] = (void *) msymbol ("blue");
542 mface_cyan = mface ();
543 mface_cyan->property[MFACE_FOREGROUND] = (void *) msymbol ("cyan");
544 mface_yellow = mface ();
545 mface_yellow->property[MFACE_FOREGROUND] = (void *) msymbol ("yellow");
546 mface_magenta = mface ();
547 mface_magenta->property[MFACE_FOREGROUND] = (void *) msymbol ("magenta");
549 work_gstring.glyphs = malloc (sizeof (MGlyph) * 2);
550 work_gstring.size = 2;
551 work_gstring.used = 0;
552 work_gstring.inc = 1;
561 M17N_OBJECT_UNREF (mface__default);
562 M17N_OBJECT_UNREF (mface_normal_video);
563 M17N_OBJECT_UNREF (mface_reverse_video);
564 M17N_OBJECT_UNREF (mface_underline);
565 M17N_OBJECT_UNREF (mface_medium);
566 M17N_OBJECT_UNREF (mface_bold);
567 M17N_OBJECT_UNREF (mface_italic);
568 M17N_OBJECT_UNREF (mface_bold_italic);
569 M17N_OBJECT_UNREF (mface_xx_small);
570 M17N_OBJECT_UNREF (mface_x_small);
571 M17N_OBJECT_UNREF (mface_small);
572 M17N_OBJECT_UNREF (mface_normalsize);
573 M17N_OBJECT_UNREF (mface_large);
574 M17N_OBJECT_UNREF (mface_x_large);
575 M17N_OBJECT_UNREF (mface_xx_large);
576 M17N_OBJECT_UNREF (mface_black);
577 M17N_OBJECT_UNREF (mface_white);
578 M17N_OBJECT_UNREF (mface_red);
579 M17N_OBJECT_UNREF (mface_green);
580 M17N_OBJECT_UNREF (mface_blue);
581 M17N_OBJECT_UNREF (mface_cyan);
582 M17N_OBJECT_UNREF (mface_yellow);
583 M17N_OBJECT_UNREF (mface_magenta);
585 MPLIST_DO (plist, hline_prop_list)
586 free (MPLIST_VAL (plist));
587 M17N_OBJECT_UNREF (hline_prop_list);
588 MPLIST_DO (plist, box_prop_list)
589 free (MPLIST_VAL (plist));
590 M17N_OBJECT_UNREF (box_prop_list);
592 free (work_gstring.glyphs);
595 /** Return a face realized from NUM number of base faces pointed by
596 FACES on the frame FRAME. If SIZE is nonzero, it specifies the
597 maximum font size. */
600 mface__realize (MFrame *frame, MFace **faces, int num, int size, MFont *font)
602 MRealizedFace *rface;
603 MRealizedFont *rfont;
604 MFace merged_face = *(frame->face);
609 if (num == 0 && frame->rface && ! font)
612 if (! mplist_find_by_value (frame->face->frame_list, frame))
613 mplist_push (frame->face->frame_list, Mt, frame);
614 for (i = 0; i < num; i++)
615 if (! mplist_find_by_value (faces[i]->frame_list, frame))
616 mplist_push (faces[i]->frame_list, Mt, frame);
618 for (i = 0; i < MFACE_PROPERTY_MAX; i++)
619 for (j = num - 1; j >= 0; j--)
620 if (faces[j]->property[i])
622 merged_face.property[i] = faces[j]->property[i];
628 if (font->type != MFONT_TYPE_REALIZED)
629 font = mfont_copy (font);
630 for (i = 0; i <= MFACE_ADSTYLE; i++)
631 if (font->property[i])
632 merged_face.property[i] = FONT_PROPERTY (font, i);
638 font->size = ((double) (- font->size)) * frame->dpi / 72.27 + 0.5;
639 font_size = font->size;
640 merged_face.property[MFACE_SIZE] = (void *) font_size;
641 merged_face.property[MFACE_RATIO] = (void *) 0;
645 if (! font || ! font->size)
647 double font_size = (int) merged_face.property[MFACE_SIZE];
651 font_size = - font_size * frame->dpi / 72.27;
652 if (merged_face.property[MFACE_RATIO]
653 && (int) merged_face.property[MFACE_RATIO] != 100)
655 font_size *= (int) merged_face.property[MFACE_RATIO];
658 ifont_size = font_size + 0.5;
659 merged_face.property[MFACE_SIZE] = (void *) ifont_size;
660 merged_face.property[MFACE_RATIO] = (void *) 0;
663 merged_face.property[MFACE_FOUNDRY] = Mnil;
664 rface = find_realized_face (frame, &merged_face, font);
667 if (font && font->type != MFONT_TYPE_REALIZED)
672 MSTRUCT_CALLOC (rface, MERROR_FACE);
673 mplist_push (frame->realized_face_list, Mt, rface);
674 rface->frame = frame;
675 rface->face = merged_face;
680 if (font->type == MFONT_TYPE_SPEC)
681 rfont = (MRealizedFont *) mfont_find (frame, font, NULL, 0);
682 else if (font->type == MFONT_TYPE_OBJECT)
685 spec.size = (int) merged_face.property[MFONT_SIZE];
686 if (font->property[MFONT_REGISTRY])
687 spec.property[MFONT_REGISTRY] = font->property[MFONT_REGISTRY];
689 mfont_put_prop (&spec, Mregistry,
690 (font->source == MFONT_SOURCE_X
691 ? Miso8859_1 : Municode_bmp));
692 rfont = mfont__open (frame, font, &spec);
695 rfont = (MRealizedFont *) font;
699 MFontset *fontset = (MFontset *) merged_face.property[MFACE_FONTSET];
701 rface->rfontset = mfont__realize_fontset (frame, fontset, &merged_face,
704 mfont__set_spec_from_face (&spec, &merged_face);
705 mfont_put_prop (&spec, Mregistry, Miso8859_1);
706 spec.source = MFONT_SOURCE_X;
707 font = mfont__select (frame, &spec, 0);
709 rfont = mfont__open (frame, font, &spec);
712 mfont_put_prop (&spec, Mregistry, Municode_bmp);
713 spec.source = MFONT_SOURCE_FT;
714 font = mfont__select (frame, &spec, 0);
716 rfont = mfont__open (frame, font, &spec);
721 rfont = mfont__lookup_fontset (rface->rfontset, NULL, &num,
722 Mlatin, Mnil, Mnil, size, 0);
728 rface->rfont = rfont;
729 rface->layouter = rfont->layouter;
730 rfont->layouter = Mnil;
731 work_gstring.glyphs[0].rface = rface;
732 work_gstring.glyphs[0].code = MCHAR_INVALID_CODE;
733 mfont__get_metric (&work_gstring, 0, 1);
734 rface->ascent = work_gstring.glyphs[0].ascent;
735 rface->descent = work_gstring.glyphs[0].descent;
736 work_gstring.glyphs[0].code
737 = mfont__encode_char (frame, (MFont *) rfont, NULL, ' ');
738 if (work_gstring.glyphs[0].code != MCHAR_INVALID_CODE)
740 mfont__get_metric (&work_gstring, 0, 1);
741 rface->space_width = work_gstring.glyphs[0].width;
744 rface->space_width = rfont->spec.size / 10;
745 if (rfont->average_width)
746 rface->average_width = rfont->average_width;
749 work_gstring.glyphs[0].code
750 = mfont__encode_char (frame, (MFont *) rfont, NULL, 'x');
751 if (work_gstring.glyphs[0].code != MCHAR_INVALID_CODE)
753 mfont__get_metric (&work_gstring, 0, 1);
754 rface->average_width = work_gstring.glyphs[0].width;
757 rface->average_width = rface->space_width;
763 rface->space_width = frame->space_width;
766 rface->hline = (MFaceHLineProp *) merged_face.property[MFACE_HLINE];
767 if (rface->hline && rface->hline->width == 0)
769 rface->box = (MFaceBoxProp *) merged_face.property[MFACE_BOX];
770 if (rface->box && rface->box->width == 0)
772 rface->ascii_rface = rface;
773 (*frame->driver->realize_face) (rface);
775 func = rface->face.hook;
776 if (func && func != noop_hook)
777 (func) (&(rface->face), rface->info, rface->face.property[MFACE_HOOK_ARG]);
779 rface->non_ascii_list = mplist ();
782 MRealizedFace *nofont;
784 MSTRUCT_CALLOC (nofont, MERROR_FACE);
786 nofont->non_ascii_list = NULL;
787 nofont->rfont = NULL;
788 mplist_add (rface->non_ascii_list, Mt, nofont);
796 mface__for_chars (MSymbol script, MSymbol language, MSymbol charset,
797 MGlyph *from_g, MGlyph *to_g, int size)
799 MRealizedFont *rfont = from_g->rface->rfont;
801 int num = to_g - from_g;
804 if (from_g->rface->font)
806 MRealizedFace *rface = from_g->rface, *new;
809 rfont = mfontset__get_font (rface->frame,
810 rface->face.property[MFACE_FONTSET],
813 else if (script != Mlatin)
814 rfont = mfontset__get_font (rface->frame,
815 rface->face.property[MFACE_FONTSET],
817 (MFont *) rfont, NULL);
820 for (; from_g < to_g && from_g->rface->font; from_g++)
821 from_g->code = MCHAR_INVALID_CODE;
825 if (rface->rfont == rfont && rfont->layouter == Mnil)
829 MSTRUCT_MALLOC (new, MERROR_FACE);
830 mplist_push (rface->non_ascii_list, Mt, new);
833 new->layouter = rfont->layouter;
834 rfont->layouter = Mnil;
835 new->non_ascii_list = NULL;
836 new->ascent = rfont->ascent;
837 new->descent = rfont->descent;
839 for (; from_g < to_g && from_g->rface->font; from_g++)
844 from_g->code = mfont__flt_encode_char (new->layouter,
846 if (from_g->code == MCHAR_INVALID_CODE)
848 from_g->rface = rface;
849 from_g->code = mfont__encode_char (rfont->frame,
855 from_g->code = mfont__encode_char (rfont->frame,
863 if (rfont && script == Mlatin)
865 for (i = 0; i < num; i++)
867 unsigned code = mfont__encode_char (rfont->frame, (MFont *) rfont,
869 if (code == MCHAR_INVALID_CODE)
871 from_g[i].code = code;
873 if (i == num || from_g[i].rface->font)
877 rfont = mfont__lookup_fontset (from_g->rface->rfontset, from_g, &num,
878 script, language, charset, size, 0);
881 layouter = rfont->layouter;
882 rfont->layouter = Mnil;
886 from_g->code = MCHAR_INVALID_CODE;
893 while (from_g < to_g)
896 MRealizedFace *rface = from_g++->rface;
898 while (from_g < to_g && rface == from_g->rface) from_g++;
899 if (rface->rfont != rfont
900 || rface->layouter != layouter)
902 MPlist *plist = mplist_find_by_value (rface->non_ascii_list, rfont);
903 MRealizedFace *new = NULL;
907 new = MPLIST_VAL (plist);
908 if (new->layouter == layouter)
910 plist = mplist_find_by_value (MPLIST_NEXT (plist), rfont);
914 MSTRUCT_MALLOC (new, MERROR_FACE);
915 mplist_push (rface->non_ascii_list, Mt, new);
918 new->layouter = layouter;
919 new->non_ascii_list = NULL;
922 new->ascent = rfont->ascent;
923 new->descent = rfont->descent;
935 mface__free_realized (MRealizedFace *rface)
939 MPLIST_DO (plist, rface->non_ascii_list)
940 free (MPLIST_VAL (plist));
941 M17N_OBJECT_UNREF (rface->non_ascii_list);
942 if (rface->font && rface->font->type != MFONT_TYPE_REALIZED)
948 mface__update_frame_face (MFrame *frame)
951 frame->rface = mface__realize (frame, NULL, 0, 0, NULL);
952 frame->space_width = frame->rface->space_width;
953 frame->average_width = frame->rface->average_width;
954 frame->ascent = frame->rface->ascent;
955 frame->descent = frame->rface->descent;
959 #endif /* !FOR_DOXYGEN || DOXYGEN_INTERNAL_MODULE */
963 /*** @addtogroup m17nFace */
967 /***en @name Variables: Keys of face property */
968 /***ja @name ÊÑ¿ô: ¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼ */
973 @brief Key of a face property specifying foreground color.
975 The variable #Mforeground is used as a key of face property. The
976 property value must be a symbol whose name is a color name, or
979 #Mnil means that the face does not specify a foreground color.
980 Otherwise, the foreground of an M-text is drawn by the specified
983 @brief Á°·Ê¿§¤ò»ØÄꤹ¤ë¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
985 ÊÑ¿ô #Mforeground ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£
986 ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢¿§Ì¾¤ò̾Á°¤È¤·¤Æ»ý¤Ä¥·¥ó¥Ü¥ë¤« #Mnil ¤Ç¤¢¤ë¡£
988 #Mnil ¤Î¾ì¹ç¡¢Á°·Ê¿§¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð M-text
989 ¤ÎÁ°·Ê¤Ï»ØÄꤵ¤ì¤¿¿§¤Çɽ¼¨¤µ¤ì¤ë¡£ */
994 @brief Key of a face property specifying background color.
996 The variable #Mbackground is used as a key of face property. The
997 property value must be a symbol whose name is a color name, or
1000 #Mnil means that the face does not specify a background color.
1001 Otherwise, the background of an M-text is drawn by the specified
1004 @brief ÇØ·Ê¿§¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
1006 ÊÑ¿ô #Mbackground ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£
1007 ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢¿§Ì¾¤ò̾Á°¤È¤·¤Æ»ý¤Ä¥·¥ó¥Ü¥ë¤« #Mnil ¤Ç¤¢¤ë¡£
1009 #Mnil ¤Î¾ì¹ç¡¢ÇØ·Ê¿§¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð M-text
1010 ¤ÎÇطʤϻØÄꤵ¤ì¤¿¿§¤Çɽ¼¨¤µ¤ì¤ë¡£ */
1012 MSymbol Mbackground;
1015 @brief Key of a face property specifying video mode.
1017 The variable #Mvideomode is used as a key of face property. The
1018 property value must be #Mnormal, #Mreverse, or #Mnil.
1020 #Mnormal means that an M-text is drawn in normal video mode
1021 (i.e. the foreground is drawn by foreground color, the background
1022 is drawn by background color).
1024 #Mreverse means that an M-text is drawn in reverse video mode
1025 (i.e. the foreground is drawn by background color, the background
1026 is drawn by foreground color).
1028 #Mnil means that the face does not specify a video mode. */
1030 @brief ¥Ó¥Ç¥ª¥â¡¼¥É¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
1032 ÊÑ¿ô #Mvideomode ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢
1033 #Mnormal, #Mreverse, #Mnil ¤Î¤¤¤º¤ì¤«¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
1035 #Mnormal ¤Î¾ì¹ç¤Ï¡¢M-text
1036 ¤òɸ½à¤Î¥Ó¥Ç¥ª¥â¡¼¥É¡ÊÁ°·Ê¤òÁ°·Ê¿§¤Ç¡¢ÇطʤòÇØ·Ê¿§¤Ç¡Ë¤Çɽ¼¨¤¹¤ë¡£
1038 #Mreverse ¤Î¾ì¹ç¤Ï¥ê¥Ð¡¼¥¹¥Ó¥Ç¥ª¥â¡¼¥É¤Ç¡ÊÁ°·Ê¤òÇØ·Ê¿§¤Ç¡¢ÇطʤòÁ°·Ê¿§¤Ç¡Ëɽ¼¨¤¹¤ë¡£
1040 #Mnil ¤Î¾ì¹ç¤Ï¥Ó¥Ç¥ª¥â¡¼¥É¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1046 @brief Key of a face property specifying font size ratio.
1048 The variable #Mratio is used as a key of face property. The value
1049 RATIO must be an integer.
1051 The value 0 means that the face does not specify a font size
1052 ratio. Otherwise, an M-text is drawn by a font of size (FONTSIZE
1053 * RATIO / 100) where FONTSIZE is a font size specified by the face
1056 @brief ¥Õ¥©¥ó¥È¤Î¥µ¥¤¥º¤ÎÈæΨ¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
1058 ÊÑ¿ô #Mratio ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃÍ RATIO
1059 ¤ÏÀ°¿ôÃͤǤʤ¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
1061 Ãͤ¬0¤Ê¤é¤Ð¡¢¥Õ¥©¥ó¥È¥µ¥¤¥º¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¡¢M-text
1062 ¤Ï(FONTSIZE * RATIO / 100) ¤È¤¤¤¦¥µ¥¤¥º¤Î¥Õ¥©¥ó¥È¤Çɽ¼¨¤µ¤ì¤ë¡£
1063 FONTSIZE ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼#Msize ¤Ç»ØÄꤵ¤ì¤¿¥µ¥¤¥º¤Ç¤¢¤ë¡£ */
1068 @brief Key of a face property specifying horizontal line.
1070 The variable #Mhline is used as a key of face property. The value
1071 must be a pointer to an object of type #MFaceHLineProp, or @c
1074 The value @c NULL means that the face does not specify this
1075 property. Otherwise, an M-text is drawn with a horizontal line by
1076 a way specified by the object that the value points to. */
1078 @brief ¿åÊ¿Àþ¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
1080 ÊÑ¿ô #Mhline ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃͤÏ
1081 #MFaceHLineProp ·¿¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤« @c NULL ¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
1083 Ãͤ¬ @c NULL ¤Ê¤é¤Ð¡¢¤³¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1084 ¤½¤¦¤Ç¤Ê¤±¤ì¤ÐÃͤ¬»Ø¤¹¥ª¥Ö¥¸¥§¥¯¥È¤Ë»ØÄꤵ¤ì¤¿¤è¤¦¤Ë¿åÊ¿Àþ¤òÉղä·¤Æ M-text
1090 @brief Key of a face property specifying box.
1092 The variable #Mbox is used as a key of face property. The value
1093 must be a pointer to an object of type #MFaceBoxProp, or @c NULL.
1095 The value @c NULL means that the face does not specify a box.
1096 Otherwise, an M-text is drawn with a surrounding box by a way
1097 specified by the object that the value points to. */
1099 @brief °Ï¤ßÏȤò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
1101 ÊÑ¿ô #Mbox ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃͤÏ
1102 #MFaceBoxProp ·¿¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤« @c NULL ¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
1104 Ãͤ¬ @c NULL ¤Ê¤é¤Ð¡¢¤³¤Î¥Õ¥§¡¼¥¹¤Ï°Ï¤ßÏȤò»ØÄꤷ¤Æ¤¤¤Ê¤¤¡£
1105 ¤½¤¦¤Ç¤Ê¤±¤ì¤ÐÃͤ¬»Ø¤¹¥ª¥Ö¥¸¥§¥¯¥È¤Ë»ØÄꤵ¤ì¤¿¤è¤¦¤Ë°Ï¤ßÏȤòÉղä·¤Æ
1106 M-text ¤òɽ¼¨¤¹¤ë¡£*/
1111 @brief Key of a face property specifying fontset.
1113 The variable #Mfontset is used as a key of face property. The
1114 value must be a pointer to an object of type #Mfontset, or @c
1117 The value @c NULL means that the face does not specify a fontset.
1118 Otherwise, an M-text is drawn with a font selected from what
1119 specified in the fontset. */
1121 @brief ¥Õ¥©¥ó¥È¥»¥Ã¥È¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
1123 ÊÑ¿ô #Mfontset ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃͤÏ
1124 #Mfontset ·¿¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤« @c NULL ¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
1126 Ãͤ¬ @c NULL ¤Ê¤é¤Ð¡¢¥Õ¥©¥ó¥È¥»¥Ã¥È¤Ï»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£
1127 ¤½¤¦¤Ç¤Ê¤±¤ì¤ÐÃͤ¬»Ø¤¹¥ª¥Ö¥¸¥§¥¯¥È¤Ë»ØÄꤵ¤ì¤¿¥Õ¥©¥ó¥È¥»¥Ã¥È¤«¤éÁª¤ó¤À¥Õ¥©¥ó¥È¤Ç
1128 M-text ¤òɽ¼¨¤¹¤ë¡£*/
1133 @brief Key of a face property specifying hook.
1135 The variable #Mhook_func is used as a key of face property. The
1136 value must be a function of type #MFaceHookFunc, or @c NULL.
1138 The value @c NULL means that the face does not specify a hook.
1139 Otherwise, the specified function is called before the face is
1142 @brief ¥Õ¥Ã¥¯¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
1144 ÊÑ¿ô #Mhook_func ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃͤÏ
1145 #MFaceHookFunc ·¿¤Î´Ø¿ô¤« @c NULL ¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
1147 Ãͤ¬ @c NULL ¤Ê¤é¤Ð¡¢¥Õ¥Ã¥¯¤Ï»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£
1148 ¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¥Õ¥§¡¼¥¹¤ò¼Â¸½¤¹¤ëÁ°¤Ë»ØÄꤵ¤ì¤¿´Ø¿ô¤¬¸Æ¤Ð¤ì¤ë¡£ */
1152 @brief Key of a face property specifying argument of hook.
1154 The variable #Mhook_arg is used as a key of face property. The
1155 value can be anything that is passed a hook function specified by
1156 the face property #Mhook_func. */
1158 @brief ¥Õ¥Ã¥¯¤Î°ú¿ô¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
1160 ÊÑ¿ô #Mhook_arg ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£
1161 Ãͤϲ¿¤Ç¤â¤è¤¯¡¢¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£ #Mhook_func ¤Ç»ØÄꤵ¤ì¤ë´Ø¿ô¤ËÅϤµ¤ì¤ë¡£ */
1167 /*** @ingroup m17nFace */
1168 /***en @name Variables: Possible values of #Mvideomode property of face */
1169 /***ja @name ÊÑ¿ô¡§ ¥Õ¥§¡¼¥¹¤Î #Mvideomode ¥×¥í¥Ñ¥Æ¥£¤Î²Äǽ¤ÊÃÍ */
1174 See the documentation of the variable #Mvideomode. */
1176 ÊÑ¿ô #Mvideomode ¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£ */
1182 /*** @ingroup m17nFace */
1183 /***en @name Variables: Predefined faces */
1184 /***ja @name ÊÑ¿ô: ÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹ */
1189 @brief Normal video face.
1191 The variable #mface_normal_video points to a face that has the
1192 #Mvideomode property with value #Mnormal. The other properties
1193 are not specified. An M-text drawn with this face appear normal
1194 colors (i.e. the foreground is drawn by foreground color, and
1195 background is drawn by background color). */
1197 @brief ɸ½à¥Ó¥Ç¥ª¥Õ¥§¡¼¥¹.
1199 ÊÑ¿ô #mface_normal_video ¤Ï #Mvideomode ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ #Mnormal
1200 ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1201 ¤³¤Î¥Õ¥§¡¼¥¹¤Çɽ¼¨¤µ¤ì¤ëM-text
1202 ¤Ïɸ½à¤Î¿§ (¤¹¤Ê¤ï¤ÁÁ°·Ê¤ÏÁ°·Ê¿§¡¢ÇطʤÏÇØ·Ê¿§¡Ë¤ÇÉÁ¤«¤ì¤ë¡£ */
1204 MFace *mface_normal_video;
1207 @brief Reverse video face.
1209 The variable #mface_reverse_video points to a face that has the
1210 #Mvideomode property with value #Mreverse. The other properties
1211 are not specified. An M-text drawn with this face appear in
1212 reversed colors (i.e. the foreground is drawn by background
1213 color, and background is drawn by foreground color). */
1215 @brief ¥ê¥Ð¡¼¥¹¥Ó¥Ç¥ª¥Õ¥§¡¼¥¹.
1217 ÊÑ¿ô #mface_reverse_video ¤Ï #Mvideomode ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬
1218 #Mreverse ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1219 ¤³¤Î¥Õ¥§¡¼¥¹¤Çɽ¼¨¤µ¤ì¤ëM-text
1220 ¤ÏÁ°·Ê¿§¤ÈÇØ·Ê¿§¤¬Æþ¤ìÂؤï¤Ã¤Æ (¤¹¤Ê¤ï¤ÁÁ°·Ê¤ÏÇØ·Ê¿§¡¢ÇطʤÏÁ°·Ê¿§¡ËÉÁ¤«¤ì¤ë¡£ */
1222 MFace *mface_reverse_video;
1225 @brief Underline face.
1227 The variable #mface_underline points to a face that has the
1228 #Mhline property with value a pointer to an object of type
1229 #MFaceHLineProp. The members of the object are as follows:
1234 type MFACE_HLINE_UNDER
1239 The other properties are not specified. An M-text that has this
1240 face is drawn with an underline. */
1242 @brief ²¼Àþ¥Õ¥§¡¼¥¹.
1244 ÊÑ¿ô #mface_underline ¤Ï #Mhline ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ #MFaceHLineProp
1245 ·¿¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£¥ª¥Ö¥¸¥§¥¯¥È¤Î¥á¥ó¥Ð¤Ï°Ê²¼¤ÎÄ̤ꡣ
1250 type MFACE_HLINE_UNDER
1255 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ï²¼ÀþÉÕ¤¤Çɽ¼¨¤µ¤ì¤ë¡£*/
1257 MFace *mface_underline;
1262 The variable #mface_medium points to a face that has the #Mweight
1263 property with value a symbol of name "medium". The other
1264 properties are not specified. An M-text that has this face is
1265 drawn with a font of medium weight. */
1267 @brief ¥ß¥Ç¥£¥¢¥à¥Õ¥§¡¼¥¹.
1269 ÊÑ¿ô #mface_medium ¤Ï #Mweight ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "medium"
1270 ¤È¤¤¤¦Ì¾Á°¤ò¤â¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1271 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text
1272 ¤Ï¡¢¥ß¥Ç¥£¥¢¥à¥¦¥§¥¤¥È¤Î¥Õ¥©¥ó¥È¤Çɽ¼¨¤µ¤ì¤ë¡£ */
1273 MFace *mface_medium;
1278 The variable #mface_bold points to a face that has the #Mweight
1279 property with value a symbol of name "bold". The other properties
1280 are not specified. An M-text that has this face is drawn with a
1281 font of bold weight. */
1283 @brief ¥Ü¡¼¥ë¥É¥Õ¥§¡¼¥¹.
1285 ÊÑ¿ô #mface_bold ¤Ï #Mweight ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "bold"
1286 ¤È¤¤¤¦Ì¾Á°¤ò¤â¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1287 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text
1288 ¤Ï¡¢¥Ü¡¼¥ë¥É¥Õ¥©¥ó¥È¤Çɽ¼¨¤µ¤ì¤ë¡£ */
1295 The variable #mface_italic points to a face that has the #Mstyle
1296 property with value a symbol of name "italic". The other
1297 properties are not specified. An M-text that has this face is
1298 drawn with a font of italic style. */
1300 @brief ¥¤¥¿¥ê¥Ã¥¯¥Õ¥§¡¼¥¹.
1302 ÊÑ¿ô #mface_italic ¤Ï #Mstyle ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "italic"
1303 ¤È¤¤¤¦Ì¾Á°¤ò¤â¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1304 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text
1305 ¤Ï¡¢¥¤¥¿¥ê¥Ã¥¯ÂΤÇɽ¼¨¤µ¤ì¤ë¡£ */
1307 MFace *mface_italic;
1310 @brief Bold italic face.
1312 The variable #mface_bold_italic points to a face that has the
1313 #Mweight property with value a symbol of name "bold", and #Mstyle
1314 property with value a symbol of name "italic". The other
1315 properties are not specified. An M-text that has this face is
1316 drawn with a font of bold weight and italic style. */
1318 @brief ¥Ü¡¼¥ë¥É¥¤¥¿¥ê¥Ã¥¯¥Õ¥§¡¼¥¹.
1320 ÊÑ¿ô #mface_bold_italic ¤Ï¡¢#Mweight ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "bold"
1321 ¤È¤¤¤¦Ì¾Á°¤ò¤â¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ê¡¢¤«¤Ä #Mstyle ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "italic"
1322 ¤È¤¤¤¦Ì¾Á°¤ò¤â¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1323 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text
1324 ¤Ï¡¢¥Ü¡¼¥ë¥É¥¤¥¿¥ê¥Ã¥¯ÂΤÇɽ¼¨¤µ¤ì¤ë¡£ */
1326 MFace *mface_bold_italic;
1329 @brief Smallest face.
1331 The variable #mface_xx_small points to a face that has the #Mratio
1332 property with value 50. The other properties are not specified.
1333 An M-text that has this face is drawn with a font whose size is
1334 50% of a normal font. */
1336 @brief ºÇ¾®¤Î¥Õ¥§¡¼¥¹.
1338 ÊÑ¿ô #mface_xx_small ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 50
1339 ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1340 ¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ïɸ½à¥Õ¥©¥ó¥È¤Î 50% ¤ÎÂ礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1343 MFace *mface_xx_small;
1346 @brief Smaller face.
1348 The variable #mface_x_small points to a face that has the #Mratio
1349 property with value 66. The other properties are not specified.
1350 An M-text that has this face is drawn with a font whose size is
1351 66% of a normal font. */
1353 @brief ¤è¤ê¾®¤µ¤¤¥Õ¥§¡¼¥¹.
1355 ÊÑ¿ô #mface_x_small ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 66
1356 ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1357 ¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ïɸ½à¥Õ¥©¥ó¥È¤Î 66% ¤ÎÂ礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1360 MFace *mface_x_small;
1365 The variable #mface_x_small points to a face that has the #Mratio
1366 property with value 75. The other properties are not specified.
1367 An M-text that has this face is drawn with a font whose size is
1368 75% of a normal font. */
1370 @brief ¾®¤µ¤¤¥Õ¥§¡¼¥¹.
1372 ÊÑ¿ô #mface_small ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 75
1373 ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1374 ¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ïɸ½à¥Õ¥©¥ó¥È¤Î 75% ¤ÎÂ礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1380 @brief Normalsize face.
1382 The variable #mface_normalsize points to a face that has the
1383 #Mratio property with value 100. The other properties are not
1384 specified. An M-text that has this face is drawn with a font
1385 whose size is the same as a normal font. */
1387 @brief ɸ½à¤ÎÂ礤µ¤Î¥Õ¥§¡¼¥¹.
1389 ÊÑ¿ô #mface_normalsize ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 100
1390 ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1391 ¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ïɸ½à¥Õ¥©¥ó¥È¤ÈƱ¤¸Â礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1394 MFace *mface_normalsize;
1399 The variable #mface_large points to a face that has the #Mratio
1400 property with value 120. The other properties are not specified.
1401 An M-text that has this face is drawn with a font whose size is
1402 120% of a normal font. */
1404 @brief Â礤¤¥Õ¥§¡¼¥¹.
1406 ÊÑ¿ô #mface_large ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 120
1407 ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1408 ¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ïɸ½à¥Õ¥©¥ó¥È¤Î 120% ¤ÎÂ礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1416 The variable #mface_x_large points to a face that has the #Mratio
1417 property with value 150. The other properties are not specified.
1418 An M-text that has this face is drawn with a font whose size is
1419 150% of a normal font. */
1421 @brief ¤â¤Ã¤ÈÂ礤¤¥Õ¥§¡¼¥¹.
1423 ÊÑ¿ô #mface_x_large ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 150
1424 ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1425 ¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ïɸ½à¥Õ¥©¥ó¥È¤Î 150% ¤ÎÂ礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1428 MFace *mface_x_large;
1431 @brief Largest face.
1433 The variable #mface_xx_large points to a face that has the #Mratio
1434 property with value 200. The other properties are not specified.
1435 An M-text that has this face is drawn with a font whose size is
1436 200% of a normal font. */
1438 @brief ºÇÂç¤Î¥Õ¥§¡¼¥¹.
1440 ÊÑ¿ô #mface_xx_large ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 200
1441 ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1442 ¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ïɸ½à¥Õ¥©¥ó¥È¤Î 200% ¤ÎÂ礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1445 MFace *mface_xx_large;
1450 The variable #mface_black points to a face that has the
1451 #Mforeground property with value a symbol of name "black". The
1452 other properties are not specified. An M-text that has this face
1453 is drawn with black foreground. */
1457 ÊÑ¿ô #mface_black ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "black"
1458 ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1459 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text
1460 ¤ÏÁ°·Ê¿§¤È¤·¤Æ¹õ¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£ */
1467 The variable #mface_white points to a face that has the
1468 #Mforeground property with value a symbol of name "white". The
1469 other properties are not specified. An M-text that has this face
1470 is drawn with white foreground. */
1474 ÊÑ¿ô #mface_white ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "white"
1475 ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1476 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text
1477 ¤ÏÁ°·Ê¿§¤È¤·¤ÆÇò¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£ */
1484 The variable #mface_red points to a face that has the
1485 #Mforeground property with value a symbol of name "red". The
1486 other properties are not specified. An M-text that has this face
1487 is drawn with red foreground. */
1491 ÊÑ¿ô #mface_red ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "red"
1492 ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1493 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text
1494 ¤ÏÁ°·Ê¿§¤È¤·¤ÆÀÖ¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£ */
1501 The variable #mface_green points to a face that has the
1502 #Mforeground property with value a symbol of name "green". The
1503 other properties are not specified. An M-text that has this face
1504 is drawn with green foreground. */
1508 ÊÑ¿ô #mface_green ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "green"
1509 ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1510 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text
1511 ¤ÏÁ°·Ê¿§¤È¤·¤ÆÎФòÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£ */
1518 The variable #mface_blue points to a face that has the
1519 #Mforeground property with value a symbol of name "blue". The
1520 other properties are not specified. An M-text that has this face
1521 is drawn with blue foreground. */
1525 ÊÑ¿ô #mface_blue ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "blue"
1526 ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1527 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text
1528 ¤ÏÁ°·Ê¿§¤È¤·¤ÆÀĤòÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£ */
1535 The variable #mface_cyan points to a face that has the
1536 #Mforeground property with value a symbol of name "cyan". The
1537 other properties are not specified. An M-text that has this face
1538 is drawn with cyan foreground. */
1540 @brief ¥·¥¢¥ó¥Õ¥§¡¼¥¹.
1542 ÊÑ¿ô #mface_cyan ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "cyan"
1543 ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1544 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text
1545 ¤ÏÁ°·Ê¿§¤È¤·¤Æ¥·¥¢¥ó¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£ */
1552 The variable #mface_yellow points to a face that has the
1553 #Mforeground property with value a symbol of name "yellow". The
1554 other properties are not specified. An M-text that has this face
1555 is drawn with yellow foreground. */
1560 ÊÑ¿ô #mface_yellow ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "yellow"
1561 ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1562 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text
1563 ¤ÏÁ°·Ê¿§¤È¤·¤Æ²«¿§¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£ */
1565 MFace *mface_yellow;
1568 @brief Magenta face.
1570 The variable #mface_magenta points to a face that has the
1571 #Mforeground property with value a symbol of name "magenta". The
1572 other properties are not specified. An M-text that has this face
1573 is drawn with magenta foreground. */
1576 @brief ¥Þ¥¼¥ó¥¿¥Õ¥§¡¼¥¹.
1578 ÊÑ¿ô #mface_magenta ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ
1579 "magenta" ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1580 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text
1581 ¤ÏÁ°·Ê¿§¤È¤·¤Æ¥Þ¥¼¥ó¥¿¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£ */
1583 MFace *mface_magenta;
1588 /***en @name Variables: The other symbols for face handling. */
1589 /***ja @name ÊÑ¿ô: ¥Õ¥§¡¼¥¹¤ò¼è¤ê°·¤¦¤¿¤á¤Î¤½¤Î¾¤Î¥·¥ó¥Ü¥ë */
1594 @brief Key of a text property specifying a face.
1596 The variable #Mface is a symbol of name <tt>"face"</tt>. A text
1597 property whose key is this symbol must have a pointer to an object
1598 of type #MFace. This is a managing key. */
1601 @brief ¥Õ¥§¡¼¥¹¤ò»ØÄꤹ¤ë¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼.
1603 ÊÑ¿ô #Mface ¤Ï <tt>"face"</tt>
1604 ¤È¤¤¤¦Ì¾Á°¤ò»ý¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¡£¤³¤Î¥·¥ó¥Ü¥ë¤ò¥¡¼¤È¤¹¤ë¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Ï¡¢
1605 #MFace ·¿¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
1606 ¤³¤ì¤Ï´ÉÍý¥¡¼¤Ç¤¢¤ë¡£ */
1614 @brief Create a new face.
1616 The mface () function creates a new face object that specifies no
1620 This function returns a pointer to the created face. */
1623 @brief ¿·¤·¤¤¥Õ¥§¡¼¥¹¤ò¤Ä¤¯¤ë.
1626 ¤Ï¥×¥í¥Ñ¥Æ¥£¤ò°ìÀÚ»ý¤¿¤Ê¤¤¿·¤·¤¤¥Õ¥§¡¼¥¹¥ª¥Ö¥¸¥§¥¯¥È¤òºî¤ë¡£
1629 ¤³¤Î´Ø¿ô¤Ïºî¤Ã¤¿¥Õ¥§¡¼¥¹¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ */
1636 M17N_OBJECT (face, free_face, MERROR_FACE);
1637 face->frame_list = mplist ();
1638 M17N_OBJECT_REGISTER (face_table, face);
1645 @brief Make a copy of a face.
1647 The mface_copy () function makes a copy of $FACE and returns a
1648 pointer to the created copy. */
1651 @brief ¥Õ¥§¡¼¥¹¤Î¥³¥Ô¡¼¤òºî¤ë.
1653 ´Ø¿ô mface_copy () ¤Ï¥Õ¥§¡¼¥¹ $FACE
1654 ¤Î¥³¥Ô¡¼¤òºî¤ê¡¢¤½¤Î¥³¥Ô¡¼¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ */
1657 mface_copy (MFace *face)
1661 MSTRUCT_CALLOC (copy, MERROR_FACE);
1663 copy->control.ref_count = 1;
1664 M17N_OBJECT_REGISTER (face_table, copy);
1665 copy->frame_list = mplist ();
1666 if (copy->property[MFACE_FONTSET])
1667 M17N_OBJECT_REF (copy->property[MFACE_FONTSET]);
1673 @brief Compare faces.
1675 The mface_equal () function compares faces $FACE1 and $FACE2.
1677 @return If two faces have the same property values, return 1.
1678 Otherwise return 0. */
1681 mface_equal (MFace *face1, MFace *face2)
1683 MFaceHLineProp *hline1, *hline2;
1684 MFaceBoxProp *box1, *box2;
1689 if (memcmp (face1->property, face2->property, sizeof face1->property) == 0)
1691 for (i = MFACE_FOUNDRY; i <= MFACE_BACKGROUND; i++)
1692 if (face1->property[i] != face2->property[i])
1694 for (i = MFACE_VIDEOMODE; i <= MFACE_RATIO; i++)
1695 if (face1->property[i] != face2->property[i])
1697 hline1 = (MFaceHLineProp *) face1->property[MFACE_HLINE];
1698 hline2 = (MFaceHLineProp *) face2->property[MFACE_HLINE];
1699 if (hline1 != hline2)
1701 if (! hline1 || ! hline2)
1703 if (memcmp (hline1, hline2, sizeof (MFaceHLineProp)) != 0)
1706 box1 = (MFaceBoxProp *) face1->property[MFACE_BOX];
1707 box2 = (MFaceBoxProp *) face2->property[MFACE_BOX];
1710 if (! box1 || ! box2)
1712 if (memcmp (box1, box2, sizeof (MFaceBoxProp)) != 0)
1723 The mface_merge () functions merges the properties of face $SRC
1727 This function returns $DST. */
1730 @brief ¥Õ¥§¡¼¥¹¤òÅý¹ç¤¹¤ë.
1732 ´Ø¿ô mface_merge () ¤Ï¡¢¥Õ¥§¡¼¥¹ $SRC ¤Î¥×¥í¥Ñ¥Æ¥£¤ò¥Õ¥§¡¼¥¹ $DST
1736 ¤³¤Î´Ø¿ô¤Ï $DST ¤òÊÖ¤¹¡£ */
1739 mface_merge (MFace *dst, MFace *src)
1744 for (i = 0; i < MFACE_PROPERTY_MAX; i++)
1745 if (src->property[i])
1747 if (i == MFACE_FONTSET)
1749 M17N_OBJECT_UNREF (dst->property[i]);
1750 M17N_OBJECT_REF (src->property[i]);
1752 dst->property[i] = src->property[i];
1755 MPLIST_DO (plist, dst->frame_list)
1757 MFrame *frame = MPLIST_VAL (plist);
1760 if (dst == frame->face)
1761 mface__update_frame_face (frame);
1770 @brief Make a face from a font.
1772 The mface_from_font () function return a newly created face while
1773 reflecting the properties of $FONT in its properties. */
1776 @brief ¥Õ¥©¥ó¥È¤«¤é¥Õ¥§¡¼¥¹¤òºî¤ë.
1778 ´Ø¿ô mface_from_font () ¤Ï¥Õ¥©¥ó¥È $FONT
1779 ¤Î¥×¥í¥Ñ¥Æ¥£¤ò¥×¥í¥Ñ¥Æ¥£¤È¤·¤Æ»ý¤Ä¿·¤·¤¤¥Õ¥§¡¼¥¹¤òºî¤ê¡¢¤½¤ì¤òÊÖ¤¹¡£ */
1782 mface_from_font (MFont *font)
1784 MFace *face = mface ();
1786 face->property[MFACE_FOUNDRY] = mfont_get_prop (font, Mfoundry);
1787 face->property[MFACE_FAMILY] = mfont_get_prop (font, Mfamily);
1788 face->property[MFACE_WEIGHT] = mfont_get_prop (font, Mweight);
1789 face->property[MFACE_STYLE] = mfont_get_prop (font, Mstyle);
1790 face->property[MFACE_STRETCH] = mfont_get_prop (font, Mstretch);
1791 face->property[MFACE_ADSTYLE] = mfont_get_prop (font, Madstyle);
1792 face->property[MFACE_SIZE] = mfont_get_prop (font, Msize);
1799 @brief Get the value of a face property.
1801 The mface_get_prop () function returns the value of the face
1802 property whose key is $KEY in face $FACE. $KEY must be one of the
1805 #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
1806 #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
1807 #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg
1810 The actual type of the returned value depends of $KEY. See
1811 documentation of the above keys. If an error is detected, it
1812 returns @c NULL and assigns an error code to the external variable
1816 @brief ¥Õ¥§¡¼¥¹¤Î¥×¥í¥Ñ¥Æ¥£¤ÎÃͤòÆÀ¤ë.
1818 ´Ø¿ô mface_get_prop () ¤Ï¡¢¥Õ¥§¡¼¥¹ $FACE
1819 ¤¬»ý¤Ä¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÆâ¡¢¥¡¼¤¬ $KEY ¤Ç¤¢¤ë¤â¤Î¤ÎÃͤòÊÖ¤¹¡£
1820 $KEY ¤Ï²¼µ¤Î¤¤¤º¤ì¤«¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
1822 #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
1823 #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
1824 #Msize, #Mfontset, #Mratio, #Mhook_arg
1827 Ìá¤êÃͤη¿¤Ï $KEY ¤Ë°Í¸¤¹¤ë¡£¾åµ¤Î¥¡¼¤ÎÀâÌÀ¤ò»²¾È¤¹¤ë¤³¤È¡£
1828 ¥¨¥é¡¼¤¬¸¡½Ð¤µ¤ì¤¿¾ì¹ç¤Ï @c NULL ¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô #merror_code
1829 ¤Ë¥¨¥é¡¼¥³¡¼¥É¤òÀßÄꤹ¤ë¡£ */
1833 mface_put_prop (), mface_put_hook ()
1839 mface_get_prop (MFace *face, MSymbol key)
1841 int index = (int) msymbol_get (key, M_face_prop_index) - 1;
1845 if (key == Mhook_func)
1846 /* This unsafe code is for backward compatiblity. */
1847 return *(void **) &face->hook;
1848 MERROR (MERROR_FACE, NULL);
1850 return face->property[index];
1856 @brief Get the hook function of a face.
1858 The mface_get_hook () function returns the hook function of face
1862 @brief ¥Õ¥§¡¼¥¹¤Î¥Õ¥Ã¥¯´Ø¿ô¤òÆÀ¤ë.
1864 ´Ø¿ô mface_get_hook () ¤Ï¥Õ¥§¡¼¥¹ $FACE ¤Î¥Õ¥Ã¥¯´Ø¿ô¤òÊÖ¤¹¡£ */
1867 mface_get_hook (MFace *face)
1875 @brief Set a value of a face property.
1877 The mface_put_prop () function assigns $VAL to the property whose
1878 key is $KEY in face $FACE. $KEY must be one the followings:
1880 #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
1881 #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
1882 #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg
1884 Among them, font related properties (#Mfoundry through #Msize) are
1885 used as the default values when a font in the fontset of $FACE
1886 does not specify those values.
1888 The actual type of the returned value depends of $KEY. See
1889 documentation of the above keys.
1892 If the operation was successful, mface_put_prop () returns 0.
1893 Otherwise it returns -1 and assigns an error code to the external
1894 variable #merror_code. */
1897 @brief ¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤòÀßÄꤹ¤ë.
1899 ´Ø¿ô mface_put_prop () ¤Ï¡¢¥Õ¥§¡¼¥¹ $FACE Æâ¤Ç¥¡¼¤¬ $KEY
1900 ¤Ç¤¢¤ë¥×¥í¥Ñ¥Æ¥£¤ÎÃͤò $VAL ¤ËÀßÄꤹ¤ë¡£$KEY
1901 ¤Ï°Ê²¼¤Î¤¤¤º¤ì¤«¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
1903 #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
1904 #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
1905 #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg.
1907 ¤³¤ì¤é¤Î¤¦¤Á¤Î¡¢¥Õ¥©¥ó¥È´ØÏ¢¤Î¥×¥í¥Ñ¥Æ¥£ (#Mfamily ¤«¤é #Msize
1908 ¤Þ¤Ç) ¤Ï¡¢¥Õ¥§¡¼¥¹¤Î¥Õ¥©¥ó¥È¥»¥Ã¥ÈÃæ¤Î¥Õ¥©¥ó¥È¤Ë´Ø¤¹¤ë¥Ç¥Õ¥©¥ë¥ÈÃͤȤʤꡢ¸Ä¡¹¤Î¥Õ¥©¥ó¥È¤¬Ãͤò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¤ËÍѤ¤¤é¤ì¤ë¡£
1910 Ìá¤êÃͤη¿¤Ï $KEY ¤Ë°Í¸¤¹¤ë¡£¾åµ¤Î¥¡¼¤ÎÀâÌÀ¤ò»²¾È¤¹¤ë¤³¤È¡£
1913 ½èÍý¤¬À®¸ù¤·¤¿¾ì¹ç¡¢mface_put_prop () ¤Ï 0 ¤òÊÖ¤¹¡£¼ºÇÔ¤·¤¿¾ì¹ç¤Ï
1914 -1 ¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô #merror_code ¤Ë¥¨¥é¡¼¥³¡¼¥É¤òÀßÄꤹ¤ë¡£ */
1924 mface_put_prop (MFace *face, MSymbol key, void *val)
1926 int index = (int) msymbol_get (key, M_face_prop_index) - 1;
1929 if (key == Mhook_func)
1931 /* This unsafe code is for backward compatiblity. */
1932 if (*(void **) &face->hook == val)
1934 *(void **) &face->hook = val;
1939 MERROR (MERROR_FACE, -1);
1940 if (key == Mfontset)
1942 if (face->property[index])
1943 M17N_OBJECT_UNREF (face->property[index]);
1944 M17N_OBJECT_REF (val);
1946 else if (key == Mhline)
1947 val = get_hline_create (val);
1948 else if (key == Mbox)
1949 val = get_box_create (val);
1951 if (face->property[index] == val)
1953 face->property[index] = val;
1956 MPLIST_DO (plist, face->frame_list)
1958 MFrame *frame = MPLIST_VAL (plist);
1961 if (face == frame->face)
1962 mface__update_frame_face (frame);
1971 @brief Set a hook function to a face.
1973 The mface_set_hook () function sets the hook function of face
1977 @brief ¥Õ¥§¡¼¥¹¤Î¥Õ¥Ã¥¯´Ø¿ô¤òÀßÄꤹ¤ë.
1979 ´Ø¿ô mface_set_hook () ¤Ï¡¢¥Õ¥§¡¼¥¹ $FACE ¤Î¥Õ¥Ã¥¯´Ø¿ô¤ò$FUNC ¤ËÀß
1983 mface_put_hook (MFace *face, MFaceHookFunc func)
1985 if (face->hook != func)
1990 MPLIST_DO (plist, face->frame_list)
1992 MFrame *frame = MPLIST_VAL (plist);
1995 if (face == frame->face)
1996 mface__update_frame_face (frame);
2005 @brief Update a face.
2007 The mface_update () function update face $FACE on frame $FRAME by
2008 calling a hook function of $FACE (if any). */
2011 @brief ¥Õ¥§¡¼¥¹¤ò¹¹¿·¤¹¤ë.
2013 ´Ø¿ô mface_update () ¤Ï¥Õ¥ì¡¼¥à $FRAME ¤Î¥Õ¥§¡¼¥¹ $FACE ¤ò $FACE
2014 ¤Î¥Õ¥Ã¥¯´Ø¿ô¤ò¡Ê¤¢¤ì¤Ð¡Ë¸Æ¤ó¤Ç¹¹¿·¤¹¤ë¡£ */
2017 mface_update (MFrame *frame, MFace *face)
2019 MFaceHookFunc func = face->hook;
2021 MRealizedFace *rface;
2023 if (func && func != noop_hook)
2025 MPLIST_DO (rface_list, frame->realized_face_list)
2027 rface = MPLIST_VAL (rface_list);
2028 if (rface->face.hook == func)
2029 (func) (&(rface->face), rface->face.property[MFACE_HOOK_ARG],
2039 /*** @addtogroup m17nDebug */
2046 The mdebug_dump_face () function prints face $FACE in a human readable
2047 way to the stderr. $INDENT specifies how many columns to indent
2048 the lines but the first one.
2051 This function returns $FACE. */
2054 @brief ¥Õ¥§¡¼¥¹¤ò¥À¥ó¥×¤¹¤ë.
2056 ´Ø¿ô mdebug_dump_face () ¤Ï¥Õ¥§¡¼¥¹ $FACE ¤ò stderr
2057 ¤Ë¿Í´Ö¤Ë²ÄÆɤʷÁ¤Ç°õºþ¤¹¤ë¡£ $INDENT ¤Ï£²¹ÔÌܰʹߤΥ¤¥ó¥Ç¥ó¥È¤ò»ØÄꤹ¤ë¡£
2060 ¤³¤Î´Ø¿ô¤Ï $FACE ¤òÊÖ¤¹¡£ */
2063 mdebug_dump_face (MFace *face, int indent)
2065 char *prefix = (char *) alloca (indent + 1);
2068 memset (prefix, 32, indent);
2070 mfont__set_spec_from_face (&spec, face);
2071 fprintf (stderr, "(face font:\"");
2072 mdebug_dump_font (&spec);
2073 fprintf (stderr, "\"\n %s fore:%s back:%s", prefix,
2074 msymbol_name ((MSymbol) face->property[MFACE_FOREGROUND]),
2075 msymbol_name ((MSymbol) face->property[MFACE_BACKGROUND]));
2076 if (face->property[MFACE_FONTSET])
2077 fprintf (stderr, " non-default-fontset");
2078 fprintf (stderr, " hline:%s", face->property[MFACE_HLINE] ? "yes" : "no");
2079 fprintf (stderr, " box:%s)", face->property[MFACE_BOX] ? "yes" : "no");