1 /* face.c -- face module.
2 Copyright (C) 2003, 2004
3 National Institute of Advanced Industrial Science and Technology (AIST)
4 Registration Number H15PRO112
6 This file is part of the m17n library.
8 The m17n library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public License
10 as published by the Free Software Foundation; either version 2.1 of
11 the License, or (at your option) any later version.
13 The m17n library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
18 You should have received a copy of the GNU Lesser General Public
19 License along with the m17n library; if not, write to the Free
20 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
25 @brief A face is an object to control appearance of M-text.
27 A @e face is an object of the type #MFace and controls how to
28 draw M-texts. A face has a fixed number of @e face @e properties.
29 Like other types of properties, a face property consists of a key
30 and a value. A key is one of the following symbols:
32 #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
33 #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
34 #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg
36 "The face property that belongs to face F and whose key is @c xxx"
37 may be shortened to "the xxx property of F".
39 The M-text drawing functions first search an M-text for the text
40 property whose key is the symbol #Mface, then draw the M-text
41 using the value of that text property. This value must be a
42 pointer to a face object.
44 If there are multiple text properties whose key is @c Mface, and
45 they are not conflicting one another, properties of those faces
48 If no faces specify a certain property, the value of the default
53 @brief ¥Õ¥§¡¼¥¹¤È¤Ï¡¢M-text ¤Î¸«±É¤¨¤òÀ©¸æ¤¹¤ë¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤¢¤ë.
55 @e ¥Õ¥§¡¼¥¹ ¤Ï #MFace ·¿¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤¢¤ê¡¢M-text
56 ¤Îɽ¼¨ÊýË¡¤òÀ©¸æ¤¹¤ë¡£¥Õ¥§¡¼¥¹¤Ï¸ÇÄê¸Ä¤Î @e ¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£ ¤ò»ý¤Ä¡£
57 ¾¤Î¥×¥í¥Ñ¥Æ¥£Æ±ÍÍ¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Ï¥¡¼¤ÈÃͤ«¤é¤Ê¤ê¡¢¥¡¼¤Ï°Ê²¼¤Î¥·¥ó¥Ü¥ë¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë¡£
59 #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
60 #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
61 #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg
63 ¡Ö¥Õ¥§¡¼¥¹ F ¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¤¦¤Á¥¡¼¤¬ @c Mxxx
64 ¤Ç¤¢¤ë¤â¤Î¡×¤Î¤³¤È¤ò´Êñ¤Ë¡ÖF ¤Î xxx ¥×¥í¥Ñ¥Æ¥£¡×¤È¸Æ¤Ö¤³¤È¤¬¤¢¤ë¡£
66 M-text ¤Îɽ¼¨´Ø¿ô¤Ï¡¢¤Þ¤ººÇ½é¤Ë¤½¤Î M-text ¤«¤é¥¡¼¤¬¥·¥ó¥Ü¥ë
67 #Mface ¤Ç¤¢¤ë¤è¤¦¤Ê¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤òõ¤·¡¢¼¡¤Ë¤½¤ÎÃͤ˽¾¤Ã¤Æ
68 M-text ¤òɽ¼¨¤¹¤ë¡£¤³¤ÎÃͤϥե§¡¼¥¹¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
71 ¤ò¥¡¼¤È¤¹¤ë¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤òÊ£¿ô»ý¤Ã¤Æ¤ª¤ê¡¢¤«¤Ä¤½¤ì¤é¤ÎÃͤ¬¾×Æͤ·¤Ê¤¤¤Ê¤é¤Ð¡¢¥Õ¥§¡¼¥¹¾ðÊó¤ÏÁȤ߹ç¤ï¤µ¤ì¤ÆÍѤ¤¤é¤ì¤ë¡£
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)
171 MPLIST_DO (plist, frame->realized_face_list)
173 MRealizedFace *rface = MPLIST_VAL (plist);
175 if (memcmp (rface->face.property, face->property, sizeof face->property)
183 free_face (void *object)
185 MFace *face = (MFace *) object;
187 if (face->property[MFACE_FONTSET])
188 M17N_OBJECT_UNREF (face->property[MFACE_FONTSET]);
189 M17N_OBJECT_UNREF (face->frame_list);
190 M17N_OBJECT_UNREGISTER (face_table, face);
196 serialize_hline (MPlist *plist, MFaceHLineProp *hline)
198 if (hline->width > 0)
200 MPlist *pl = mplist ();
202 mplist_add (pl, Minteger, (void *) hline->type);
203 mplist_add (pl, Minteger, (void *) hline->width);
204 mplist_add (pl, Msymbol, hline->color);
205 plist = mplist_add (plist, Mplist, pl);
206 M17N_OBJECT_UNREF (pl);
212 serialize_box (MPlist *plist, MFaceBoxProp *box)
216 MPlist *pl = mplist ();
218 mplist_add (pl, Minteger, (void *) box->width);
219 mplist_add (pl, Minteger, (void *) box->inner_hmargin);
220 mplist_add (pl, Minteger, (void *) box->inner_vmargin);
221 mplist_add (pl, Minteger, (void *) box->outer_hmargin);
222 mplist_add (pl, Minteger, (void *) box->outer_vmargin);
223 mplist_add (pl, Msymbol, box->color_top);
224 mplist_add (pl, Msymbol, box->color_bottom);
225 mplist_add (pl, Msymbol, box->color_left);
226 mplist_add (pl, Msymbol, box->color_right);
227 plist = mplist_add (plist, Mplist, pl);
228 M17N_OBJECT_UNREF (pl);
234 serialize_face (void *val)
237 MPlist *plist = mplist (), *pl = plist;
242 MPlist *(*func) (MPlist *plist, void *val);
243 } serializer[MFACE_PROPERTY_MAX]
244 = { { &Mfoundry, &Msymbol },
245 { &Mfamily, &Msymbol },
246 { &Mweight, &Msymbol },
247 { &Mstyle, &Msymbol },
248 { &Mstretch, &Msymbol },
249 { &Madstyle, &Msymbol },
250 { &Msize, &Minteger },
252 { &Mforeground, &Msymbol },
253 { &Mbackground, &Msymbol },
256 { &Mvideomode, &Msymbol },
257 { NULL, NULL}, /* MFACE_HOOK_FUNC */
258 { NULL, NULL}, /* MFACE_HOOK_ARG */
259 { &Mratio, &Minteger } };
261 for (i = 0; i < MFACE_PROPERTY_MAX; i++)
262 if (face->property[i] && serializer[i].key)
264 pl = mplist_add (pl, Msymbol, *serializer[i].key);
265 if (serializer[i].type)
266 pl = mplist_add (pl, *serializer[i].type, face->property[i]);
267 else if (i == MFACE_FONTSET)
268 pl = mplist_add (pl, Msymbol, mfontset_name ((MFontset *)
270 else if (i == MFACE_HLINE)
271 pl = serialize_hline (pl, (MFaceHLineProp *) face->property[i]);
272 else if (i == MFACE_BOX)
273 pl = serialize_box (pl, (MFaceBoxProp *) face->property[i]);
280 deserialize_hline (MPlist *plist)
282 MFaceHLineProp hline, *hline_ret;
284 if (! MPLIST_INTEGER_P (plist))
285 MERROR (MERROR_FACE, NULL);
286 hline.type = MPLIST_INTEGER_P (plist);
287 plist = MPLIST_NEXT (plist);
288 if (! MPLIST_INTEGER_P (plist))
289 MERROR (MERROR_FACE, NULL);
290 hline.width = MPLIST_INTEGER_P (plist);
291 plist = MPLIST_NEXT (plist);
292 if (! MPLIST_SYMBOL_P (plist))
293 MERROR (MERROR_FACE, NULL);
294 hline.color = MPLIST_SYMBOL (plist);
295 MSTRUCT_MALLOC (hline_ret, MERROR_FACE);
301 deserialize_box (MPlist *plist)
303 MFaceBoxProp box, *box_ret;
305 if (! MPLIST_INTEGER_P (plist))
306 MERROR (MERROR_FACE, NULL);
307 box.width = MPLIST_INTEGER (plist);
308 plist = MPLIST_NEXT (plist);
309 if (! MPLIST_INTEGER_P (plist))
310 MERROR (MERROR_FACE, NULL);
311 box.inner_hmargin = MPLIST_INTEGER (plist);
312 plist = MPLIST_NEXT (plist);
313 if (! MPLIST_INTEGER_P (plist))
314 MERROR (MERROR_FACE, NULL);
315 box.inner_vmargin = MPLIST_INTEGER (plist);
316 plist = MPLIST_NEXT (plist);
317 if (! MPLIST_INTEGER_P (plist))
318 MERROR (MERROR_FACE, NULL);
319 box.outer_hmargin = MPLIST_INTEGER (plist);
320 plist = MPLIST_NEXT (plist);
321 if (! MPLIST_INTEGER_P (plist))
322 MERROR (MERROR_FACE, NULL);
323 box.outer_vmargin = MPLIST_INTEGER (plist);
324 plist = MPLIST_NEXT (plist);
325 if (! MPLIST_SYMBOL_P (plist))
326 MERROR (MERROR_FACE, NULL);
327 box.color_top = MPLIST_SYMBOL (plist);
328 plist = MPLIST_NEXT (plist);
329 if (! MPLIST_SYMBOL_P (plist))
330 MERROR (MERROR_FACE, NULL);
331 box.color_bottom = MPLIST_SYMBOL (plist);
332 plist = MPLIST_NEXT (plist);
333 if (! MPLIST_SYMBOL_P (plist))
334 MERROR (MERROR_FACE, NULL);
335 box.color_left = MPLIST_SYMBOL (plist);
336 plist = MPLIST_NEXT (plist);
337 if (! MPLIST_SYMBOL_P (plist))
338 MERROR (MERROR_FACE, NULL);
339 box.color_right = MPLIST_SYMBOL (plist);
340 MSTRUCT_MALLOC (box_ret, MERROR_FACE);
346 deserialize_face (MPlist *plist)
348 MFace *face = mface ();
350 MPLIST_DO (plist, plist)
356 if (! MPLIST_SYMBOL_P (plist))
358 key = MPLIST_SYMBOL (plist);
359 index = (int) msymbol_get (key, M_face_prop_index) - 1;
360 plist = MPLIST_NEXT (plist);
361 if (MPLIST_TAIL_P (plist))
363 if (index < 0 || index >= MFACE_PROPERTY_MAX)
365 if (key == Mfoundry || key == Mfamily || key == Mweight || key == Mstyle
366 || key == Mstretch || key == Madstyle
367 || key == Mforeground || key == Mbackground || key == Mvideomode)
369 if (! MPLIST_SYMBOL_P (plist))
371 val = MPLIST_VAL (plist);
373 else if (key == Msize || key == Mratio)
375 if (! MPLIST_INTEGER_P (plist))
377 val = MPLIST_VAL (plist);
379 else if (key == Mfontset)
381 if (! MPLIST_SYMBOL_P (plist))
383 val = mfontset (MSYMBOL_NAME (MPLIST_SYMBOL (plist)));
385 else if (key == Mhline)
387 if (! MPLIST_PLIST_P (plist))
389 val = deserialize_hline (MPLIST_PLIST (plist));
391 else if (key == Mbox)
393 if (! MPLIST_PLIST_P (plist))
395 val = deserialize_box (MPLIST_PLIST (plist));
397 face->property[index] = val;
402 static MGlyphString work_gstring;
408 MFace *mface__default;
414 MFaceHLineProp *hline;
417 face_table.count = 0;
418 Mface = msymbol_as_managing_key ("face");
419 msymbol_put (Mface, Mtext_prop_serializer, (void *) serialize_face);
420 msymbol_put (Mface, Mtext_prop_deserializer, (void *) deserialize_face);
422 Mforeground = msymbol ("foreground");
423 Mbackground = msymbol ("background");
424 Mvideomode = msymbol ("videomode");
425 Mnormal = msymbol ("normal");
426 Mreverse = msymbol ("reverse");
427 Mratio = msymbol ("ratio");
428 Mhline = msymbol ("hline");
429 Mbox = msymbol ("box");
430 Mhook_func = msymbol ("hook-func");
431 Mhook_arg = msymbol ("hook-arg");
433 Mlatin = msymbol ("latin");
434 M_face_prop_index = msymbol (" face-prop-index");
438 /* Pointer to the key symbol of the face property. */
440 /* Index (enum face_property) of the face property. */
442 } mface_prop_data[MFACE_PROPERTY_MAX] =
443 { { &Mfoundry, MFACE_FOUNDRY },
444 { &Mfamily, MFACE_FAMILY },
445 { &Mweight, MFACE_WEIGHT },
446 { &Mstyle, MFACE_STYLE },
447 { &Mstretch, MFACE_STRETCH },
448 { &Madstyle, MFACE_ADSTYLE },
449 { &Msize, MFACE_SIZE },
450 { &Mfontset, MFACE_FONTSET },
451 { &Mforeground, MFACE_FOREGROUND },
452 { &Mbackground, MFACE_BACKGROUND },
453 { &Mhline, MFACE_HLINE },
454 { &Mbox, MFACE_BOX },
455 { &Mvideomode, MFACE_VIDEOMODE },
456 { &Mhook_func, MFACE_HOOK_FUNC },
457 { &Mhook_arg, MFACE_HOOK_ARG },
458 { &Mratio, MFACE_RATIO },
461 for (i = 0; i < MFACE_PROPERTY_MAX; i++)
462 /* We add one to distinguish it from no-property. */
463 msymbol_put (*mface_prop_data[i].key, M_face_prop_index,
464 (void *) (mface_prop_data[i].index + 1));
467 hline_prop_list = mplist ();
468 MSTRUCT_CALLOC (hline, MERROR_FACE);
469 mplist_push (hline_prop_list, Mt, hline);
470 box_prop_list = mplist ();
471 MSTRUCT_CALLOC (box, MERROR_FACE);
472 mplist_push (box_prop_list, Mt, box);
474 mface__default = mface ();
475 mface__default->property[MFACE_FOUNDRY] = msymbol ("misc");
476 mface__default->property[MFACE_FAMILY] = msymbol ("fixed");
477 mface__default->property[MFACE_WEIGHT] = msymbol ("medium");
478 mface__default->property[MFACE_STYLE] = msymbol ("r");
479 mface__default->property[MFACE_STRETCH] = msymbol ("normal");
480 mface__default->property[MFACE_ADSTYLE] = msymbol ("");
481 mface__default->property[MFACE_SIZE] = (void *) 120;
482 mface__default->property[MFACE_FONTSET] = mfontset (NULL);
483 mface__default->property[MFACE_FOREGROUND] = msymbol ("black");
484 mface__default->property[MFACE_BACKGROUND] = msymbol ("white");
485 mface__default->property[MFACE_HLINE] = hline;
486 mface__default->property[MFACE_BOX] = box;
487 mface__default->property[MFACE_VIDEOMODE] = Mnormal;
488 mface__default->property[MFACE_HOOK_FUNC] = (void *) noop_hook;
490 mface_normal_video = mface ();
491 mface_normal_video->property[MFACE_VIDEOMODE] = (void *) Mnormal;
493 mface_reverse_video = mface ();
494 mface_reverse_video->property[MFACE_VIDEOMODE] = (void *) Mreverse;
497 MFaceHLineProp hline_prop;
499 hline_prop.type = MFACE_HLINE_UNDER;
500 hline_prop.width = 1;
501 hline_prop.color = Mnil;
502 mface_underline = mface ();
503 mface_put_prop (mface_underline, Mhline, &hline_prop);
506 mface_medium = mface ();
507 mface_medium->property[MFACE_WEIGHT] = (void *) msymbol ("medium");
508 mface_bold = mface ();
509 mface_bold->property[MFACE_WEIGHT] = (void *) msymbol ("bold");
510 mface_italic = mface ();
511 mface_italic->property[MFACE_STYLE] = (void *) msymbol ("i");
512 mface_bold_italic = mface_copy (mface_bold);
513 mface_bold_italic->property[MFACE_STYLE]
514 = mface_italic->property[MFACE_STYLE];
516 mface_xx_small = mface ();
517 mface_xx_small->property[MFACE_RATIO] = (void *) 50;
518 mface_x_small = mface ();
519 mface_x_small->property[MFACE_RATIO] = (void *) 67;
520 mface_small = mface ();
521 mface_small->property[MFACE_RATIO] = (void *) 75;
522 mface_normalsize = mface ();
523 mface_normalsize->property[MFACE_RATIO] = (void *) 100;
524 mface_large = mface ();
525 mface_large->property[MFACE_RATIO] = (void *) 120;
526 mface_x_large = mface ();
527 mface_x_large->property[MFACE_RATIO] = (void *) 150;
528 mface_xx_large = mface ();
529 mface_xx_large->property[MFACE_RATIO] = (void *) 200;
531 mface_black = mface ();
532 mface_black->property[MFACE_FOREGROUND] = (void *) msymbol ("black");
533 mface_white = mface ();
534 mface_white->property[MFACE_FOREGROUND] = (void *) msymbol ("white");
535 mface_red = mface ();
536 mface_red->property[MFACE_FOREGROUND] = (void *) msymbol ("red");
537 mface_green = mface ();
538 mface_green->property[MFACE_FOREGROUND] = (void *) msymbol ("green");
539 mface_blue = mface ();
540 mface_blue->property[MFACE_FOREGROUND] = (void *) msymbol ("blue");
541 mface_cyan = mface ();
542 mface_cyan->property[MFACE_FOREGROUND] = (void *) msymbol ("cyan");
543 mface_yellow = mface ();
544 mface_yellow->property[MFACE_FOREGROUND] = (void *) msymbol ("yellow");
545 mface_magenta = mface ();
546 mface_magenta->property[MFACE_FOREGROUND] = (void *) msymbol ("magenta");
548 work_gstring.glyphs = malloc (sizeof (MGlyph) * 2);
549 work_gstring.size = 2;
550 work_gstring.used = 0;
551 work_gstring.inc = 1;
560 M17N_OBJECT_UNREF (mface__default);
561 M17N_OBJECT_UNREF (mface_normal_video);
562 M17N_OBJECT_UNREF (mface_reverse_video);
563 M17N_OBJECT_UNREF (mface_underline);
564 M17N_OBJECT_UNREF (mface_medium);
565 M17N_OBJECT_UNREF (mface_bold);
566 M17N_OBJECT_UNREF (mface_italic);
567 M17N_OBJECT_UNREF (mface_bold_italic);
568 M17N_OBJECT_UNREF (mface_xx_small);
569 M17N_OBJECT_UNREF (mface_x_small);
570 M17N_OBJECT_UNREF (mface_small);
571 M17N_OBJECT_UNREF (mface_normalsize);
572 M17N_OBJECT_UNREF (mface_large);
573 M17N_OBJECT_UNREF (mface_x_large);
574 M17N_OBJECT_UNREF (mface_xx_large);
575 M17N_OBJECT_UNREF (mface_black);
576 M17N_OBJECT_UNREF (mface_white);
577 M17N_OBJECT_UNREF (mface_red);
578 M17N_OBJECT_UNREF (mface_green);
579 M17N_OBJECT_UNREF (mface_blue);
580 M17N_OBJECT_UNREF (mface_cyan);
581 M17N_OBJECT_UNREF (mface_yellow);
582 M17N_OBJECT_UNREF (mface_magenta);
584 MPLIST_DO (plist, hline_prop_list)
585 free (MPLIST_VAL (plist));
586 M17N_OBJECT_UNREF (hline_prop_list);
587 MPLIST_DO (plist, box_prop_list)
588 free (MPLIST_VAL (plist));
589 M17N_OBJECT_UNREF (box_prop_list);
591 free (work_gstring.glyphs);
593 mdebug__report_object ("Face", &face_table);
596 /** Return a realized face for ASCII characters from NUM number of
597 base faces pointed by FACES on the frame FRAME. */
600 mface__realize (MFrame *frame, MFace **faces, int num, int size)
602 MRealizedFace *rface;
603 MRealizedFont *rfont;
604 MFace merged_face = *(frame->face);
610 if (num == 0 && frame->rface)
613 for (i = 0; i < MFACE_PROPERTY_MAX; i++)
614 for (j = num - 1; j >= 0; j--)
615 if (faces[j]->property[i])
617 merged_face.property[i] = faces[j]->property[i];
621 if (! mplist_find_by_value (frame->face->frame_list, frame))
622 mplist_push (frame->face->frame_list, Mt, frame);
623 for (i = 0; i < num; i++)
624 if (! mplist_find_by_value (faces[i]->frame_list, frame))
625 mplist_push (faces[i]->frame_list, Mt, frame);
627 if (merged_face.property[MFACE_RATIO])
629 int font_size = (int) merged_face.property[MFACE_SIZE];
631 font_size *= (int) merged_face.property[MFACE_RATIO];
633 merged_face.property[MFACE_SIZE] = (void *) font_size;
634 merged_face.property[MFACE_RATIO] = 0;
637 rface = find_realized_face (frame, &merged_face);
641 MSTRUCT_CALLOC (rface, MERROR_FACE);
642 mplist_push (frame->realized_face_list, Mt, rface);
643 rface->frame = frame;
644 rface->face = merged_face;
645 props = rface->face.property;
646 rface->rfontset = mfont__realize_fontset (frame,
647 (MFontset *) props[MFACE_FONTSET],
649 g.type = GLYPH_SPACE;
652 rfont = mfont__lookup_fontset (rface->rfontset, &g, &num,
653 Mlatin, Mnil, Mnil, size);
656 rface->rfont = rfont;
658 work_gstring.frame = frame;
659 work_gstring.glyphs[0] = g;
660 work_gstring.glyphs[0].rface = rface;
661 work_gstring.glyphs[1].code = MCHAR_INVALID_CODE;
662 work_gstring.glyphs[1].rface = rface;
663 mfont__get_metric (&work_gstring, 0, 2);
664 rface->space_width = work_gstring.glyphs[0].width;
665 rface->ascent = work_gstring.glyphs[1].ascent;
666 rface->descent = work_gstring.glyphs[1].descent;
671 rface->space_width = frame->space_width;
674 rface->hline = (MFaceHLineProp *) props[MFACE_HLINE];
675 if (rface->hline && rface->hline->width == 0)
677 rface->box = (MFaceBoxProp *) props[MFACE_BOX];
678 if (rface->box && rface->box->width == 0)
680 rface->ascii_rface = rface;
681 (*frame->driver->realize_face) (rface);
683 func = (MFaceHookFunc) rface->face.property[MFACE_HOOK_FUNC];
684 if (func && func != noop_hook)
685 (func) (&(rface->face), rface->info, rface->face.property[MFACE_HOOK_ARG]);
687 rface->non_ascii_list = mplist ();
690 MRealizedFace *nofont;
692 MSTRUCT_CALLOC (nofont, MERROR_FACE);
694 nofont->non_ascii_list = NULL;
695 nofont->rfont = NULL;
696 mplist_add (rface->non_ascii_list, Mt, nofont);
704 mface__for_chars (MSymbol script, MSymbol language, MSymbol charset,
705 MGlyph *from_g, MGlyph *to_g, int size)
707 MRealizedFont *rfont;
708 int num = to_g - from_g;
710 rfont = mfont__lookup_fontset (from_g->rface->rfontset, from_g, &num,
711 script, language, charset, size);
716 while (from_g < to_g)
719 MRealizedFace *rface = from_g++->rface;
721 while (from_g < to_g && rface == from_g->rface) from_g++;
722 if (rface->rfont != rfont)
724 MPlist *plist = mplist_find_by_value (rface->non_ascii_list, rfont);
728 new = MPLIST_VAL (plist);
731 MSTRUCT_MALLOC (new, MERROR_FACE);
732 mplist_push (rface->non_ascii_list, Mt, new);
735 new->non_ascii_list = NULL;
738 new->ascent = rfont->ascent;
739 new->descent = rfont->descent;
751 mface__free_realized (MRealizedFace *rface)
755 MPLIST_DO (plist, rface->non_ascii_list)
756 free (MPLIST_VAL (plist));
757 M17N_OBJECT_UNREF (rface->non_ascii_list);
762 mface__update_frame_face (MFrame *frame)
765 frame->rface = mface__realize (frame, NULL, 0, 0);
766 frame->space_width = frame->rface->space_width;
767 frame->ascent = frame->rface->ascent;
768 frame->descent = frame->rface->descent;
772 #endif /* !FOR_DOXYGEN || DOXYGEN_INTERNAL_MODULE */
776 /*** @addtogroup m17nFace */
780 /***en @name Variables: Keys of face property */
781 /***ja @name ÊÑ¿ô: ¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼ */
786 @brief Key of a face property specifying foreground color.
788 The variable #Mforeground is used as a key of face property. The
789 property value must be a symbol whose name is a color name, or
792 #Mnil means that the face does not specify a foreground color.
793 Otherwise, the foreground of an M-text is drawn by the specified
796 @brief Á°·Ê¿§¤ò»ØÄꤹ¤ë¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
798 ÊÑ¿ô #Mforeground ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£
799 ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢¿§Ì¾¤ò̾Á°¤È¤·¤Æ»ý¤Ä¥·¥ó¥Ü¥ë¤« #Mnil ¤Ç¤¢¤ë¡£
801 #Mnil ¤Î¾ì¹ç¡¢Á°·Ê¿§¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð M-text
802 ¤ÎÁ°·Ê¤Ï»ØÄꤵ¤ì¤¿¿§¤Çɽ¼¨¤µ¤ì¤ë¡£ */
807 @brief Key of a face property specifying background color.
809 The variable #Mbackground is used as a key of face property. The
810 property value must be a symbol whose name is a color name, or
813 #Mnil means that the face does not specify a background color.
814 Otherwise, the background of an M-text is drawn by the specified
817 @brief ÇØ·Ê¿§¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
819 ÊÑ¿ô #Mbackground ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£
820 ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢¿§Ì¾¤ò̾Á°¤È¤·¤Æ»ý¤Ä¥·¥ó¥Ü¥ë¤« #Mnil ¤Ç¤¢¤ë¡£
822 #Mnil ¤Î¾ì¹ç¡¢ÇØ·Ê¿§¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð M-text
823 ¤ÎÇطʤϻØÄꤵ¤ì¤¿¿§¤Çɽ¼¨¤µ¤ì¤ë¡£ */
828 @brief Key of a face property specifying video mode.
830 The variable #Mvideomode is used as a key of face property. The
831 property value must be #Mnormal, #Mreverse, or #Mnil.
833 #Mnormal means that an M-text is drawn in normal video mode
834 (i.e. the foreground is drawn by foreground color, the background
835 is drawn by background color).
837 #Mreverse means that an M-text is drawn in reverse video mode
838 (i.e. the foreground is drawn by background color, the background
839 is drawn by foreground color).
841 #Mnil means that the face does not specify a video mode. */
843 @brief ¥Ó¥Ç¥ª¥â¡¼¥É¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
845 ÊÑ¿ô #Mvideomode ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢
846 #Mnormal, #Mreverse, #Mnil ¤Î¤¤¤º¤ì¤«¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
848 #Mnormal ¤Î¾ì¹ç¤Ï¡¢M-text
849 ¤òɸ½à¤Î¥Ó¥Ç¥ª¥â¡¼¥É¡ÊÁ°·Ê¤òÁ°·Ê¿§¤Ç¡¢ÇطʤòÇØ·Ê¿§¤Ç¡Ë¤Çɽ¼¨¤¹¤ë¡£
851 #Mreverse ¤Î¾ì¹ç¤Ï¥ê¥Ð¡¼¥¹¥Ó¥Ç¥ª¥â¡¼¥É¤Ç¡ÊÁ°·Ê¤òÇØ·Ê¿§¤Ç¡¢ÇطʤòÁ°·Ê¿§¤Ç¡Ëɽ¼¨¤¹¤ë¡£
853 #Mnil ¤Î¾ì¹ç¤Ï¥Ó¥Ç¥ª¥â¡¼¥É¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
859 @brief Key of a face property specifying font size ratio.
861 The variable #Mratio is used as a key of face property. The value
862 RATIO must be an integer.
864 The value 0 means that the face does not specify a font size
865 ratio. Otherwise, an M-text is drawn by a font of size (FONTSIZE
866 * RATIO / 100) where FONTSIZE is a font size specified by the face
869 @brief ¥Õ¥©¥ó¥È¤Î¥µ¥¤¥º¤ÎÈæΨ¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
871 ÊÑ¿ô #Mratio ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃÍ RATIO
872 ¤ÏÀ°¿ôÃͤǤʤ¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
874 Ãͤ¬0¤Ê¤é¤Ð¡¢¥Õ¥©¥ó¥È¥µ¥¤¥º¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¡¢M-text
875 ¤Ï(FONTSIZE * RATIO / 100) ¤È¤¤¤¦¥µ¥¤¥º¤Î¥Õ¥©¥ó¥È¤Çɽ¼¨¤µ¤ì¤ë¡£
876 FONTSIZE ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼#Msize ¤Ç»ØÄꤵ¤ì¤¿¥µ¥¤¥º¤Ç¤¢¤ë¡£ */
881 @brief Key of a face property specifying horizontal line.
883 The variable #Mhline is used as a key of face property. The value
884 must be a pointer to an object of type #MFaceHLineProp, or @c
887 The value @c NULL means that the face does not specify this
888 property. Otherwise, an M-text is drawn with a horizontal line by
889 a way specified by the object that the value points to. */
891 @brief ¿åÊ¿Àþ¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
893 ÊÑ¿ô #Mhline ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃͤÏ
894 #MFaceHLineProp ·¿¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤« @c NULL ¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
896 Ãͤ¬ @c NULL ¤Ê¤é¤Ð¡¢¤³¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
897 ¤½¤¦¤Ç¤Ê¤±¤ì¤ÐÃͤ¬»Ø¤¹¥ª¥Ö¥¸¥§¥¯¥È¤Ë»ØÄꤵ¤ì¤¿¤è¤¦¤Ë¿åÊ¿Àþ¤òÉղä·¤Æ M-text
903 @brief Key of a face property specifying box.
905 The variable #Mbox is used as a key of face property. The value
906 must be a pointer to an object of type #MFaceBoxProp, or @c NULL.
908 The value @c NULL means that the face does not specify a box.
909 Otherwise, an M-text is drawn with a surrounding box by a way
910 specified by the object that the value points to. */
912 @brief °Ï¤ßÏȤò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
914 ÊÑ¿ô #Mbox ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃͤÏ
915 #MFaceBoxProp ·¿¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤« @c NULL ¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
917 Ãͤ¬ @c NULL ¤Ê¤é¤Ð¡¢¤³¤Î¥Õ¥§¡¼¥¹¤Ï°Ï¤ßÏȤò»ØÄꤷ¤Æ¤¤¤Ê¤¤¡£
918 ¤½¤¦¤Ç¤Ê¤±¤ì¤ÐÃͤ¬»Ø¤¹¥ª¥Ö¥¸¥§¥¯¥È¤Ë»ØÄꤵ¤ì¤¿¤è¤¦¤Ë°Ï¤ßÏȤòÉղä·¤Æ
919 M-text ¤òɽ¼¨¤¹¤ë¡£*/
924 @brief Key of a face property specifying fontset.
926 The variable #Mfontset is used as a key of face property. The
927 value must be a pointer to an object of type #Mfontset, or @c
930 The value @c NULL means that the face does not specify a fontset.
931 Otherwise, an M-text is drawn with a font selected from what
932 specified in the fontset. */
934 @brief ¥Õ¥©¥ó¥È¥»¥Ã¥È¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
936 ÊÑ¿ô #Mfontset ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃͤÏ
937 #Mfontset ·¿¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤« @c NULL ¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
939 Ãͤ¬ @c NULL ¤Ê¤é¤Ð¡¢¥Õ¥©¥ó¥È¥»¥Ã¥È¤Ï»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£
940 ¤½¤¦¤Ç¤Ê¤±¤ì¤ÐÃͤ¬»Ø¤¹¥ª¥Ö¥¸¥§¥¯¥È¤Ë»ØÄꤵ¤ì¤¿¥Õ¥©¥ó¥È¥»¥Ã¥È¤«¤éÁª¤ó¤À¥Õ¥©¥ó¥È¤Ç
941 M-text ¤òɽ¼¨¤¹¤ë¡£*/
946 @brief Key of a face property specifying hook.
948 The variable #Mhook_func is used as a key of face property. The
949 value must be a function of type #MFaceHookFunc, or @c NULL.
951 The value @c NULL means that the face does not specify a hook.
952 Otherwise, the specified function is called before the face is
955 @brief ¥Õ¥Ã¥¯¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
957 ÊÑ¿ô #Mhook_func ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃͤÏ
958 #MFaceHookFunc ·¿¤Î´Ø¿ô¤« @c NULL ¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
960 Ãͤ¬ @c NULL ¤Ê¤é¤Ð¡¢¥Õ¥Ã¥¯¤Ï»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£
961 ¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¥Õ¥§¡¼¥¹¤ò¼Â¸½¤¹¤ëÁ°¤Ë»ØÄꤵ¤ì¤¿´Ø¿ô¤¬¸Æ¤Ð¤ì¤ë¡£ */
965 @brief Key of a face property specifying argument of hook.
967 The variable #Mhook_arg is used as a key of face property. The
968 value can be anything that is passed a hook function specified by
969 the face property #Mhook_func. */
971 @brief ¥Õ¥Ã¥¯¤Î°ú¿ô¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
973 ÊÑ¿ô #Mhook_arg ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£
974 Ãͤϲ¿¤Ç¤â¤è¤¯¡¢¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£ #Mhook_func ¤Ç»ØÄꤵ¤ì¤ë´Ø¿ô¤ËÅϤµ¤ì¤ë¡£ */
980 /*** @ingroup m17nFace */
981 /***en @name Variables: Possible values of #Mvideomode property of face */
982 /***ja @name ÊÑ¿ô¡§ ¥Õ¥§¡¼¥¹¤Î #Mvideomode ¥×¥í¥Ñ¥Æ¥£¤Î²Äǽ¤ÊÃÍ */
987 See the documentation of the variable #Mvideomode. */
989 ÊÑ¿ô #Mvideomode ¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£ */
995 /*** @ingroup m17nFace */
996 /***en @name Variables: Predefined faces */
997 /***ja @name ÊÑ¿ô: ÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹ */
1002 @brief Normal video face.
1004 The variable #mface_normal_video points to a face that has the
1005 #Mvideomode property with value #Mnormal. The other properties
1006 are not specified. An M-text drawn with this face appear normal
1007 colors (i.e. the foreground is drawn by foreground color, and
1008 background is drawn by background color). */
1010 @brief ɸ½à¥Ó¥Ç¥ª¥Õ¥§¡¼¥¹.
1012 ÊÑ¿ô #mface_normal_video ¤Ï #Mvideomode ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ #Mnormal
1013 ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1014 ¤³¤Î¥Õ¥§¡¼¥¹¤Çɽ¼¨¤µ¤ì¤ëM-text
1015 ¤Ïɸ½à¤Î¿§ (¤¹¤Ê¤ï¤ÁÁ°·Ê¤ÏÁ°·Ê¿§¡¢ÇطʤÏÇØ·Ê¿§¡Ë¤ÇÉÁ¤«¤ì¤ë¡£ */
1017 MFace *mface_normal_video;
1020 @brief Reverse video face.
1022 The variable #mface_reverse_video points to a face that has the
1023 #Mvideomode property with value #Mreverse. The other properties
1024 are not specified. An M-text drawn with this face appear in
1025 reversed colors (i.e. the foreground is drawn by background
1026 color, and background is drawn by foreground color). */
1028 @brief ¥ê¥Ð¡¼¥¹¥Ó¥Ç¥ª¥Õ¥§¡¼¥¹.
1030 ÊÑ¿ô #mface_reverse_video ¤Ï #Mvideomode ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬
1031 #Mreverse ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1032 ¤³¤Î¥Õ¥§¡¼¥¹¤Çɽ¼¨¤µ¤ì¤ëM-text
1033 ¤ÏÁ°·Ê¿§¤ÈÇØ·Ê¿§¤¬Æþ¤ìÂؤï¤Ã¤Æ (¤¹¤Ê¤ï¤ÁÁ°·Ê¤ÏÇØ·Ê¿§¡¢ÇطʤÏÁ°·Ê¿§¡ËÉÁ¤«¤ì¤ë¡£ */
1035 MFace *mface_reverse_video;
1038 @brief Underline face.
1040 The variable #mface_underline points to a face that has the
1041 #Mhline property with value a pointer to an object of type
1042 #MFaceHLineProp. The members of the object are as follows:
1047 type MFACE_HLINE_UNDER
1052 The other properties are not specified. An M-text that has this
1053 face is drawn with an underline. */
1055 @brief ²¼Àþ¥Õ¥§¡¼¥¹.
1057 ÊÑ¿ô #mface_underline ¤Ï #Mhline ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ #MFaceHLineProp
1058 ·¿¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£¥ª¥Ö¥¸¥§¥¯¥È¤Î¥á¥ó¥Ð¤Ï°Ê²¼¤ÎÄ̤ꡣ
1063 type MFACE_HLINE_UNDER
1068 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ï²¼ÀþÉÕ¤¤Çɽ¼¨¤µ¤ì¤ë¡£*/
1070 MFace *mface_underline;
1075 The variable #mface_medium points to a face that has the #Mweight
1076 property with value a symbol of name "medium". The other
1077 properties are not specified. An M-text that has this face is
1078 drawn with a font of medium weight. */
1080 @brief ¥ß¥Ç¥£¥¢¥à¥Õ¥§¡¼¥¹.
1082 ÊÑ¿ô #mface_medium ¤Ï #Mweight ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "medium"
1083 ¤È¤¤¤¦Ì¾Á°¤ò¤â¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1084 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text
1085 ¤Ï¡¢¥ß¥Ç¥£¥¢¥à¥¦¥§¥¤¥È¤Î¥Õ¥©¥ó¥È¤Çɽ¼¨¤µ¤ì¤ë¡£ */
1086 MFace *mface_medium;
1091 The variable #mface_bold points to a face that has the #Mweight
1092 property with value a symbol of name "bold". The other properties
1093 are not specified. An M-text that has this face is drawn with a
1094 font of bold weight. */
1096 @brief ¥Ü¡¼¥ë¥É¥Õ¥§¡¼¥¹.
1098 ÊÑ¿ô #mface_bold ¤Ï #Mweight ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "bold"
1099 ¤È¤¤¤¦Ì¾Á°¤ò¤â¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1100 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text
1101 ¤Ï¡¢¥Ü¡¼¥ë¥É¥Õ¥©¥ó¥È¤Çɽ¼¨¤µ¤ì¤ë¡£ */
1108 The variable #mface_italic points to a face that has the #Mstyle
1109 property with value a symbol of name "italic". The other
1110 properties are not specified. An M-text that has this face is
1111 drawn with a font of italic style. */
1113 @brief ¥¤¥¿¥ê¥Ã¥¯¥Õ¥§¡¼¥¹.
1115 ÊÑ¿ô #mface_italic ¤Ï #Mstyle ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "italic"
1116 ¤È¤¤¤¦Ì¾Á°¤ò¤â¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1117 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text
1118 ¤Ï¡¢¥¤¥¿¥ê¥Ã¥¯ÂΤÇɽ¼¨¤µ¤ì¤ë¡£ */
1120 MFace *mface_italic;
1123 @brief Bold italic face.
1125 The variable #mface_bold_italic points to a face that has the
1126 #Mweight property with value a symbol of name "bold", and #Mstyle
1127 property with value a symbol of name "italic". The other
1128 properties are not specified. An M-text that has this face is
1129 drawn with a font of bold weight and italic style. */
1131 @brief ¥Ü¡¼¥ë¥É¥¤¥¿¥ê¥Ã¥¯¥Õ¥§¡¼¥¹.
1133 ÊÑ¿ô #mface_bold_italic ¤Ï¡¢#Mweight ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "bold"
1134 ¤È¤¤¤¦Ì¾Á°¤ò¤â¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ê¡¢¤«¤Ä #Mstyle ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "italic"
1135 ¤È¤¤¤¦Ì¾Á°¤ò¤â¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1136 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text
1137 ¤Ï¡¢¥Ü¡¼¥ë¥É¥¤¥¿¥ê¥Ã¥¯ÂΤÇɽ¼¨¤µ¤ì¤ë¡£ */
1139 MFace *mface_bold_italic;
1142 @brief Smallest face.
1144 The variable #mface_xx_small points to a face that has the #Mratio
1145 property with value 50. The other properties are not specified.
1146 An M-text that has this face is drawn with a font whose size is
1147 50% of a normal font. */
1149 @brief ºÇ¾®¤Î¥Õ¥§¡¼¥¹.
1151 ÊÑ¿ô #mface_xx_small ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 50
1152 ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1153 ¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ïɸ½à¥Õ¥©¥ó¥È¤Î 50% ¤ÎÂ礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1156 MFace *mface_xx_small;
1159 @brief Smaller face.
1161 The variable #mface_x_small points to a face that has the #Mratio
1162 property with value 66. The other properties are not specified.
1163 An M-text that has this face is drawn with a font whose size is
1164 66% of a normal font. */
1166 @brief ¤è¤ê¾®¤µ¤¤¥Õ¥§¡¼¥¹.
1168 ÊÑ¿ô #mface_x_small ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 66
1169 ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1170 ¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ïɸ½à¥Õ¥©¥ó¥È¤Î 66% ¤ÎÂ礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1173 MFace *mface_x_small;
1178 The variable #mface_x_small points to a face that has the #Mratio
1179 property with value 75. The other properties are not specified.
1180 An M-text that has this face is drawn with a font whose size is
1181 75% of a normal font. */
1183 @brief ¾®¤µ¤¤¥Õ¥§¡¼¥¹.
1185 ÊÑ¿ô #mface_small ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 75
1186 ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1187 ¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ïɸ½à¥Õ¥©¥ó¥È¤Î 75% ¤ÎÂ礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1193 @brief Normalsize face.
1195 The variable #mface_normalsize points to a face that has the
1196 #Mratio property with value 100. The other properties are not
1197 specified. An M-text that has this face is drawn with a font
1198 whose size is the same as a normal font. */
1200 @brief ɸ½à¤ÎÂ礤µ¤Î¥Õ¥§¡¼¥¹.
1202 ÊÑ¿ô #mface_normalsize ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 100
1203 ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1204 ¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ïɸ½à¥Õ¥©¥ó¥È¤ÈƱ¤¸Â礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1207 MFace *mface_normalsize;
1212 The variable #mface_large points to a face that has the #Mratio
1213 property with value 120. The other properties are not specified.
1214 An M-text that has this face is drawn with a font whose size is
1215 120% of a normal font. */
1217 @brief Â礤¤¥Õ¥§¡¼¥¹.
1219 ÊÑ¿ô #mface_large ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 120
1220 ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1221 ¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ïɸ½à¥Õ¥©¥ó¥È¤Î 120% ¤ÎÂ礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1229 The variable #mface_x_large points to a face that has the #Mratio
1230 property with value 150. The other properties are not specified.
1231 An M-text that has this face is drawn with a font whose size is
1232 150% of a normal font. */
1234 @brief ¤â¤Ã¤ÈÂ礤¤¥Õ¥§¡¼¥¹.
1236 ÊÑ¿ô #mface_x_large ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 150
1237 ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1238 ¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ïɸ½à¥Õ¥©¥ó¥È¤Î 150% ¤ÎÂ礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1241 MFace *mface_x_large;
1244 @brief Largest face.
1246 The variable #mface_xx_large points to a face that has the #Mratio
1247 property with value 200. The other properties are not specified.
1248 An M-text that has this face is drawn with a font whose size is
1249 200% of a normal font. */
1251 @brief ºÇÂç¤Î¥Õ¥§¡¼¥¹.
1253 ÊÑ¿ô #mface_xx_large ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 200
1254 ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
1255 ¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ïɸ½à¥Õ¥©¥ó¥È¤Î 200% ¤ÎÂ礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1258 MFace *mface_xx_large;
1263 The variable #mface_black points to a face that has the
1264 #Mforeground property with value a symbol of name "black". The
1265 other properties are not specified. An M-text that has this face
1266 is drawn with black foreground. */
1270 ÊÑ¿ô #mface_black ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "black"
1271 ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1272 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text
1273 ¤ÏÁ°·Ê¿§¤È¤·¤Æ¹õ¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£ */
1280 The variable #mface_white points to a face that has the
1281 #Mforeground property with value a symbol of name "white". The
1282 other properties are not specified. An M-text that has this face
1283 is drawn with white foreground. */
1287 ÊÑ¿ô #mface_white ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "white"
1288 ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1289 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text
1290 ¤ÏÁ°·Ê¿§¤È¤·¤ÆÇò¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£ */
1297 The variable #mface_red points to a face that has the
1298 #Mforeground property with value a symbol of name "red". The
1299 other properties are not specified. An M-text that has this face
1300 is drawn with red foreground. */
1304 ÊÑ¿ô #mface_red ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "red"
1305 ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1306 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text
1307 ¤ÏÁ°·Ê¿§¤È¤·¤ÆÀÖ¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£ */
1314 The variable #mface_green points to a face that has the
1315 #Mforeground property with value a symbol of name "green". The
1316 other properties are not specified. An M-text that has this face
1317 is drawn with green foreground. */
1321 ÊÑ¿ô #mface_green ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "green"
1322 ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1323 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text
1324 ¤ÏÁ°·Ê¿§¤È¤·¤ÆÎФòÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£ */
1331 The variable #mface_blue points to a face that has the
1332 #Mforeground property with value a symbol of name "blue". The
1333 other properties are not specified. An M-text that has this face
1334 is drawn with blue foreground. */
1338 ÊÑ¿ô #mface_blue ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "blue"
1339 ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1340 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text
1341 ¤ÏÁ°·Ê¿§¤È¤·¤ÆÀĤòÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£ */
1348 The variable #mface_cyan points to a face that has the
1349 #Mforeground property with value a symbol of name "cyan". The
1350 other properties are not specified. An M-text that has this face
1351 is drawn with cyan foreground. */
1353 @brief ¥·¥¢¥ó¥Õ¥§¡¼¥¹.
1355 ÊÑ¿ô #mface_cyan ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "cyan"
1356 ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1357 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text
1358 ¤ÏÁ°·Ê¿§¤È¤·¤Æ¥·¥¢¥ó¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£ */
1365 The variable #mface_yellow points to a face that has the
1366 #Mforeground property with value a symbol of name "yellow". The
1367 other properties are not specified. An M-text that has this face
1368 is drawn with yellow foreground. */
1373 ÊÑ¿ô #mface_yellow ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "yellow"
1374 ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1375 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text
1376 ¤ÏÁ°·Ê¿§¤È¤·¤Æ²«¿§¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£ */
1378 MFace *mface_yellow;
1381 @brief Magenta face.
1383 The variable #mface_magenta points to a face that has the
1384 #Mforeground property with value a symbol of name "magenta". The
1385 other properties are not specified. An M-text that has this face
1386 is drawn with magenta foreground. */
1389 @brief ¥Þ¥¼¥ó¥¿¥Õ¥§¡¼¥¹.
1391 ÊÑ¿ô #mface_magenta ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ
1392 "magenta" ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1393 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text
1394 ¤ÏÁ°·Ê¿§¤È¤·¤Æ¥Þ¥¼¥ó¥¿¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£ */
1396 MFace *mface_magenta;
1401 /***en @name Variables: The other symbols for face handling. */
1402 /***ja @name ÊÑ¿ô: ¥Õ¥§¡¼¥¹¤ò¼è¤ê°·¤¦¤¿¤á¤Î¤½¤Î¾¤Î¥·¥ó¥Ü¥ë */
1407 @brief Key of a text property specifying a face.
1409 The variable #Mface is a symbol of name <tt>"face"</tt>. A text
1410 property whose key is this symbol must have a pointer to an object
1411 of type #MFace. This is a managing key. */
1414 @brief ¥Õ¥§¡¼¥¹¤ò»ØÄꤹ¤ë¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼.
1416 ÊÑ¿ô #Mface ¤Ï <tt>"face"</tt>
1417 ¤È¤¤¤¦Ì¾Á°¤ò»ý¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¡£¤³¤Î¥·¥ó¥Ü¥ë¤ò¥¡¼¤È¤¹¤ë¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Ï¡¢
1418 #MFace ·¿¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
1419 ¤³¤ì¤Ï´ÉÍý¥¡¼¤Ç¤¢¤ë¡£ */
1427 @brief Create a new face.
1429 The mface () function creates a new face object that specifies no
1433 This function returns a pointer to the created face. */
1436 @brief ¿·¤·¤¤¥Õ¥§¡¼¥¹¤ò¤Ä¤¯¤ë.
1439 ¤Ï¥×¥í¥Ñ¥Æ¥£¤ò°ìÀÚ»ý¤¿¤Ê¤¤¿·¤·¤¤¥Õ¥§¡¼¥¹¥ª¥Ö¥¸¥§¥¯¥È¤òºî¤ë¡£
1442 ¤³¤Î´Ø¿ô¤Ïºî¤Ã¤¿¥Õ¥§¡¼¥¹¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ */
1449 M17N_OBJECT (face, free_face, MERROR_FACE);
1450 face->frame_list = mplist ();
1451 M17N_OBJECT_REGISTER (face_table, face);
1458 @brief Make a copy of a face.
1460 The mface_copy () function makes a copy of $FACE and returns a
1461 pointer to the created copy. */
1464 @brief ¥Õ¥§¡¼¥¹¤Î¥³¥Ô¡¼¤òºî¤ë.
1466 ´Ø¿ô mface_copy () ¤Ï¥Õ¥§¡¼¥¹ $FACE
1467 ¤Î¥³¥Ô¡¼¤òºî¤ê¡¢¤½¤Î¥³¥Ô¡¼¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ */
1470 mface_copy (MFace *face)
1474 MSTRUCT_CALLOC (copy, MERROR_FACE);
1476 copy->control.ref_count = 1;
1477 M17N_OBJECT_REGISTER (face_table, copy);
1478 copy->frame_list = mplist ();
1479 if (copy->property[MFACE_FONTSET])
1480 M17N_OBJECT_REF (copy->property[MFACE_FONTSET]);
1488 The mface_merge () functions merges the properties of face $SRC
1492 This function returns $DST. */
1495 @brief ¥Õ¥§¡¼¥¹¤òÅý¹ç¤¹¤ë.
1497 ´Ø¿ô mface_merge () ¤Ï¡¢¥Õ¥§¡¼¥¹ $SRC ¤Î¥×¥í¥Ñ¥Æ¥£¤ò¥Õ¥§¡¼¥¹ $DST
1501 ¤³¤Î´Ø¿ô¤Ï $DST ¤òÊÖ¤¹¡£ */
1504 mface_merge (MFace *dst, MFace *src)
1509 for (i = 0; i < MFACE_PROPERTY_MAX; i++)
1510 if (src->property[i])
1512 if (i == MFACE_FONTSET)
1514 M17N_OBJECT_UNREF (dst->property[i]);
1515 M17N_OBJECT_REF (src->property[i]);
1517 dst->property[i] = src->property[i];
1520 MPLIST_DO (plist, dst->frame_list)
1522 MFrame *frame = MPLIST_VAL (plist);
1525 if (dst == frame->face)
1526 mface__update_frame_face (frame);
1535 @brief Make a face from a font.
1537 The mface_from_font () function return a newly created face while
1538 reflecting the properties of $FONT in its properties. */
1541 @brief ¥Õ¥©¥ó¥È¤«¤é¥Õ¥§¡¼¥¹¤òºî¤ë.
1543 ´Ø¿ô mface_from_font () ¤Ï¥Õ¥©¥ó¥È $FONT
1544 ¤Î¥×¥í¥Ñ¥Æ¥£¤ò¥×¥í¥Ñ¥Æ¥£¤È¤·¤Æ»ý¤Ä¿·¤·¤¤¥Õ¥§¡¼¥¹¤òºî¤ê¡¢¤½¤ì¤òÊÖ¤¹¡£ */
1547 mface_from_font (MFont *font)
1549 MFace *face = mface ();
1551 face->property[MFACE_FOUNDRY] = mfont_get_prop (font, Mfoundry);
1552 face->property[MFACE_FAMILY] = mfont_get_prop (font, Mfamily);
1553 face->property[MFACE_WEIGHT] = mfont_get_prop (font, Mweight);
1554 face->property[MFACE_STYLE] = mfont_get_prop (font, Mstyle);
1555 face->property[MFACE_STRETCH] = mfont_get_prop (font, Mstretch);
1556 face->property[MFACE_ADSTYLE] = mfont_get_prop (font, Madstyle);
1557 face->property[MFACE_SIZE] = mfont_get_prop (font, Msize);
1564 @brief Get the value of a face property.
1566 The mface_get_prop () function returns the value of the face
1567 property whose key is $KEY in face $FACE. $KEY must be one of the
1570 #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
1571 #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
1572 #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg
1575 The actual type of the returned value depends of $KEY. See
1576 documentation of the above keys. If an error is detected, it
1577 returns @c NULL and assigns an error code to the external variable
1581 @brief ¥Õ¥§¡¼¥¹¤Î¥×¥í¥Ñ¥Æ¥£¤ÎÃͤòÆÀ¤ë.
1583 ´Ø¿ô mface_get_prop () ¤Ï¡¢¥Õ¥§¡¼¥¹ $FACE
1584 ¤¬»ý¤Ä¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÆâ¡¢¥¡¼¤¬ $KEY ¤Ç¤¢¤ë¤â¤Î¤ÎÃͤòÊÖ¤¹¡£
1585 $KEY ¤Ï²¼µ¤Î¤¤¤º¤ì¤«¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
1587 #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
1588 #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
1589 #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg
1592 Ìá¤êÃͤη¿¤Ï $KEY ¤Ë°Í¸¤¹¤ë¡£¾åµ¤Î¥¡¼¤ÎÀâÌÀ¤ò»²¾È¤¹¤ë¤³¤È¡£
1593 ¥¨¥é¡¼¤¬¸¡½Ð¤µ¤ì¤¿¾ì¹ç¤Ï @c NULL ¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô #merror_code
1594 ¤Ë¥¨¥é¡¼¥³¡¼¥É¤òÀßÄꤹ¤ë¡£ */
1604 mface_get_prop (MFace *face, MSymbol key)
1606 int index = (int) msymbol_get (key, M_face_prop_index) - 1;
1609 MERROR (MERROR_FACE, NULL);
1610 return face->property[index];
1616 @brief Set a value of a face property.
1618 The mface_put_prop () function assigns $VAL to the property whose
1619 key is $KEY in face $FACE. $KEY must be one the followings:
1621 #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
1622 #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
1623 #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg
1625 Among them, font related properties (#Mfoundry through #Msize) are
1626 used as the default values when a font in the fontset of $FACE
1627 does not specify those values.
1629 The actual type of the returned value depends of $KEY. See
1630 documentation of the above keys.
1633 If the operation was successful, mface_put_prop () returns 0.
1634 Otherwise it returns -1 and assigns an error code to the external
1635 variable #merror_code. */
1638 @brief ¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤòÀßÄꤹ¤ë.
1640 ´Ø¿ô mface_put_prop () ¤Ï¡¢¥Õ¥§¡¼¥¹ $FACE Æâ¤Ç¥¡¼¤¬ $KEY
1641 ¤Ç¤¢¤ë¥×¥í¥Ñ¥Æ¥£¤ÎÃͤò $VAL ¤ËÀßÄꤹ¤ë¡£$KEY
1642 ¤Ï°Ê²¼¤Î¤¤¤º¤ì¤«¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
1644 #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
1645 #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
1646 #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg.
1648 ¤³¤ì¤é¤Î¤¦¤Á¤Î¡¢¥Õ¥©¥ó¥È´ØÏ¢¤Î¥×¥í¥Ñ¥Æ¥£ (#Mfamily ¤«¤é #Msize
1649 ¤Þ¤Ç) ¤Ï¡¢¥Õ¥§¡¼¥¹¤Î¥Õ¥©¥ó¥È¥»¥Ã¥ÈÃæ¤Î¥Õ¥©¥ó¥È¤Ë´Ø¤¹¤ë¥Ç¥Õ¥©¥ë¥ÈÃͤȤʤꡢ¸Ä¡¹¤Î¥Õ¥©¥ó¥È¤¬Ãͤò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¤ËÍѤ¤¤é¤ì¤ë¡£
1651 Ìá¤êÃͤη¿¤Ï $KEY ¤Ë°Í¸¤¹¤ë¡£¾åµ¤Î¥¡¼¤ÎÀâÌÀ¤ò»²¾È¤¹¤ë¤³¤È¡£
1654 ½èÍý¤¬À®¸ù¤·¤¿¾ì¹ç¡¢mface_put_prop () ¤Ï 0 ¤òÊÖ¤¹¡£¼ºÇÔ¤·¤¿¾ì¹ç¤Ï
1655 -1 ¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô #merror_code ¤Ë¥¨¥é¡¼¥³¡¼¥É¤òÀßÄꤹ¤ë¡£ */
1665 mface_put_prop (MFace *face, MSymbol key, void *val)
1667 int index = (int) msymbol_get (key, M_face_prop_index) - 1;
1671 MERROR (MERROR_FACE, -1);
1672 if (key == Mfontset)
1674 if (face->property[index])
1675 M17N_OBJECT_UNREF (face->property[index]);
1676 M17N_OBJECT_REF (val);
1678 else if (key == Mhline)
1679 val = get_hline_create (val);
1680 else if (key == Mbox)
1681 val = get_box_create (val);
1683 if (face->property[index] == val)
1685 face->property[index] = val;
1687 MPLIST_DO (plist, face->frame_list)
1689 MFrame *frame = MPLIST_VAL (plist);
1692 if (face == frame->face)
1693 mface__update_frame_face (frame);
1702 @brief Update a face.
1704 The mface_update () function update face $FACE on frame $FRAME by
1705 calling a hook function of $FACE (if any). */
1708 @brief ¥Õ¥§¡¼¥¹¤ò¹¹¿·¤¹¤ë.
1710 ´Ø¿ô mface_update () ¤Ï¥Õ¥ì¡¼¥à $FRAME ¤Î¥Õ¥§¡¼¥¹ $FACE ¤ò $FACE
1711 ¤Î¥Õ¥Ã¥¯´Ø¿ô¤ò¡Ê¤¢¤ì¤Ð¡Ë¸Æ¤ó¤Ç¹¹¿·¤¹¤ë¡£ */
1714 mface_update (MFrame *frame, MFace *face)
1716 MFaceHookFunc func = (MFaceHookFunc) face->property[MFACE_HOOK_FUNC];
1718 MRealizedFace *rface;
1720 if (func && func != noop_hook)
1722 MPLIST_DO (rface_list, frame->realized_face_list)
1724 rface = MPLIST_VAL (rface_list);
1725 if ((MFaceHookFunc) rface->face.property[MFACE_HOOK_FUNC] == func)
1726 (func) (&(rface->face), rface->face.property[MFACE_HOOK_ARG],
1736 /*** @addtogroup m17nDebug */
1743 The mdebug_dump_face () function prints face $FACE in a human readable
1744 way to the stderr. $INDENT specifies how many columns to indent
1745 the lines but the first one.
1748 This function returns $FACE. */
1751 @brief ¥Õ¥§¡¼¥¹¤ò¥À¥ó¥×¤¹¤ë.
1753 ´Ø¿ô mdebug_dump_face () ¤Ï¥Õ¥§¡¼¥¹ $FACE ¤ò stderr
1754 ¤Ë¿Í´Ö¤Ë²ÄÆɤʷÁ¤Ç°õºþ¤¹¤ë¡£ $INDENT ¤Ï£²¹ÔÌܰʹߤΥ¤¥ó¥Ç¥ó¥È¤ò»ØÄꤹ¤ë¡£
1757 ¤³¤Î´Ø¿ô¤Ï $FACE ¤òÊÖ¤¹¡£ */
1760 mdebug_dump_face (MFace *face, int indent)
1762 char *prefix = (char *) alloca (indent + 1);
1765 memset (prefix, 32, indent);
1767 mfont__set_spec_from_face (&spec, face);
1768 fprintf (stderr, "(face font:\"");
1769 mdebug_dump_font (&spec);
1770 fprintf (stderr, "\"\n %s fore:%s back:%s", prefix,
1771 msymbol_name ((MSymbol) face->property[MFACE_FOREGROUND]),
1772 msymbol_name ((MSymbol) face->property[MFACE_BACKGROUND]));
1773 if (face->property[MFACE_FONTSET])
1774 fprintf (stderr, " non-default-fontset");
1775 fprintf (stderr, " hline:%s", face->property[MFACE_HLINE] ? "yes" : "no");
1776 fprintf (stderr, " box:%s)", face->property[MFACE_BOX] ? "yes" : "no");