1 /* face.c -- face module.
2 Copyright (C) 2003, 2004
3 National Institute of Advanced Industrial Science and Technology (AIST)
4 Registration Number H15PRO112
6 This file is part of the m17n library.
8 The m17n library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public License
10 as published by the Free Software Foundation; either version 2.1 of
11 the License, or (at your option) any later version.
13 The m17n library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
18 You should have received a copy of the GNU Lesser General Public
19 License along with the m17n library; if not, write to the Free
20 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
25 @brief A face is an object to control appearance of M-text.
27 A @e face is an object of the type #MFace and controls how to
28 draw M-texts. A face has a fixed number of @e face @e properties.
29 Like other types of properties, a face property consists of a key
30 and a value. A key is one of the following symbols:
32 #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
33 #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
34 #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg
36 "The face property that belongs to face F and whose key is @c xxx"
37 may be shortened to "the xxx property of F".
39 The M-text drawing functions first search an M-text for the text
40 property whose key is the symbol #Mface, then draw the M-text
41 using the value of that text property. This value must be a
42 pointer to a face object.
44 If there are multiple text properties whose key is @c Mface, and
45 they are not conflicting one another, properties of those faces
48 If no faces specify a certain property, the value of the default
53 @brief ¥Õ¥§¡¼¥¹¤È¤Ï¡¢M-text ¤Îɽ¼¨¤òÀ©¸æ¤¹¤ë¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤¢¤ë.
55 @e ¥Õ¥§¡¼¥¹ ¤Ï #MFace ·¿¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤¢¤ê¡¢M-text ¤Îɽ¼¨ÊýË¡
56 ¤òÀ©¸æ¤¹¤ë¡£¥Õ¥§¡¼¥¹¤Ï¸ÇÄê¸Ä¿ô¤Î @e ¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£ ¤ò»ý¤Ä¡£
57 ¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Ï¥¡¼¤ÈÃͤ«¤é¤Ê¤ë¡£¥¡¼¤Ï¥·¥ó¥Ü¥ë¤Ç¤¢¤ê¡¢
59 #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
60 #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
61 #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg
63 ¡Ö¥Õ¥§¡¼¥¹ F ¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¤¦¤Á¥¡¼¤¬ @c Mxxx ¤Ç¤¢¤ë¤â¤Î¡×
64 ¤Î¤³¤È¤ò´Êñ¤Ë¡ÖF ¤Î xxx ¥×¥í¥Ñ¥Æ¥£¡×¤È¸Æ¤Ö¤³¤È¤¬¤¢¤ë¡£
66 M-text ¤Îɽ¼¨´Ø¿ô¤Ï¡¢¤Þ¤ººÇ½é¤Ë¤½¤Î M-text ¤«¤é¥¡¼¤¬¥·¥ó¥Ü¥ë
67 #Mface ¤Ç¤¢¤ë¤è¤¦¤Ê¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤òõ¤·¡¢¼¡¤Ë¤½¤ÎÃͤ˽¾¤Ã¤Æ
68 M-text ¤òɽ¼¨¤¹¤ë¡£¤³¤ÎÃͤϥե§¡¼¥¹¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±
71 M-text ¤¬¡¢#Mface ¤ò¥¡¼¤È¤¹¤ë¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤òÊ£¿ô»ý¤Ã¤Æ¤ª¤ê¡¢
72 ¤«¤Ä¤½¤ì¤é¤ÎÃͤδ֤˾×Æͤ¬¤Ê¤¤¤Ê¤é¤Ð¡¢¥Õ¥§¡¼¥¹¾ðÊó¤ÏÁȤ߹ç¤ï¤µ¤ì¤Æ
75 ¤¢¤ë¥Æ¥¥¹¥È°À¤¬¤É¤Î¥Õ¥§¡¼¥¹¤Ë¤è¤Ã¤Æ¤â»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢¥Ç
76 ¥Õ¥©¥ë¥È¥Õ¥§¡¼¥¹¤ÎÃͤ¬ÍѤ¤¤é¤ì¤ë¡£ */
80 #if !defined (FOR_DOXYGEN) || defined (DOXYGEN_INTERNAL_MODULE)
81 /*** @addtogroup m17nInternal
90 #include "m17n-misc.h"
97 #include "internal-gui.h"
102 static M17NObjectArray face_table;
104 static MSymbol Mlatin;
106 static MSymbol M_face_prop_index;
108 /** Find a realized face registered on FRAME that is realized from
109 FACE and using font RFONT. If RFONT is NULL, find any that
112 static MRealizedFace *
113 find_realized_face (MFrame *frame, MFace *face, MRealizedFont *rfont)
116 MRealizedFace *rface;
119 MPLIST_DO (rface_list, frame->realized_face_list)
121 rface = MPLIST_VAL (rface_list);
123 || rface->rfont == rfont)
125 for (i = 0; i < MFACE_RATIO; i++)
126 if (rface->face.property[i] != face->property[i])
128 if (i == MFACE_RATIO)
136 free_face (void *object)
138 MFace *face = (MFace *) object;
140 if (face->property[MFACE_FONTSET])
141 M17N_OBJECT_UNREF (face->property[MFACE_FONTSET]);
142 if (face->property[MFACE_HLINE])
143 free (face->property[MFACE_HLINE]);
144 if (face->property[MFACE_BOX])
145 free (face->property[MFACE_BOX]);
146 M17N_OBJECT_UNREGISTER (face_table, face);
152 serialize_hline (MPlist *plist, MFaceHLineProp *hline)
154 MPlist *pl = mplist ();
156 mplist_add (pl, Minteger, (void *) hline->type);
157 mplist_add (pl, Minteger, (void *) hline->width);
158 mplist_add (pl, Msymbol, hline->color);
159 plist = mplist_add (plist, Mplist, pl);
160 M17N_OBJECT_UNREF (pl);
165 serialize_box (MPlist *plist, MFaceBoxProp *box)
167 MPlist *pl = mplist ();
169 mplist_add (pl, Minteger, (void *) box->width);
170 mplist_add (pl, Minteger, (void *) box->inner_hmargin);
171 mplist_add (pl, Minteger, (void *) box->inner_vmargin);
172 mplist_add (pl, Minteger, (void *) box->outer_hmargin);
173 mplist_add (pl, Minteger, (void *) box->outer_vmargin);
174 mplist_add (pl, Msymbol, box->color_top);
175 mplist_add (pl, Msymbol, box->color_bottom);
176 mplist_add (pl, Msymbol, box->color_left);
177 mplist_add (pl, Msymbol, box->color_right);
178 plist = mplist_add (plist, Mplist, pl);
179 M17N_OBJECT_UNREF (pl);
184 serialize_face (void *val)
187 MPlist *plist = mplist (), *pl = plist;
192 MPlist *(*func) (MPlist *plist, void *val);
193 } serializer[MFACE_PROPERTY_MAX]
194 = { { &Mfoundry, &Msymbol },
195 { &Mfamily, &Msymbol },
196 { &Mweight, &Msymbol },
197 { &Mstyle, &Msymbol },
198 { &Mstretch, &Msymbol },
199 { &Madstyle, &Msymbol },
200 { &Msize, &Minteger },
202 { &Mforeground, &Msymbol },
203 { &Mbackground, &Msymbol },
206 { &Mvideomode, &Msymbol },
207 { NULL, NULL}, /* MFACE_HOOK_FUNC */
208 { NULL, NULL}, /* MFACE_HOOK_ARG */
209 { &Mratio, &Minteger } };
211 for (i = 0; i < MFACE_PROPERTY_MAX; i++)
212 if (face->property[i] && serializer[i].key)
214 pl = mplist_add (pl, Msymbol, *serializer[i].key);
215 if (serializer[i].type)
216 pl = mplist_add (pl, *serializer[i].type, face->property[i]);
217 else if (i == MFACE_FONTSET)
218 pl = mplist_add (pl, Msymbol, mfontset_name ((MFontset *)
220 else if (i == MFACE_HLINE)
221 pl = serialize_hline (pl, (MFaceHLineProp *) face->property[i]);
222 else if (i == MFACE_BOX)
223 pl = serialize_box (pl, (MFaceBoxProp *) face->property[i]);
230 deserialize_hline (MPlist *plist)
232 MFaceHLineProp hline, *hline_ret;
234 if (! MPLIST_INTEGER_P (plist))
235 MERROR (MERROR_FACE, NULL);
236 hline.type = MPLIST_INTEGER_P (plist);
237 plist = MPLIST_NEXT (plist);
238 if (! MPLIST_INTEGER_P (plist))
239 MERROR (MERROR_FACE, NULL);
240 hline.width = MPLIST_INTEGER_P (plist);
241 plist = MPLIST_NEXT (plist);
242 if (! MPLIST_SYMBOL_P (plist))
243 MERROR (MERROR_FACE, NULL);
244 hline.color = MPLIST_SYMBOL (plist);
245 MSTRUCT_MALLOC (hline_ret, MERROR_FACE);
251 deserialize_box (MPlist *plist)
253 MFaceBoxProp box, *box_ret;
255 if (! MPLIST_INTEGER_P (plist))
256 MERROR (MERROR_FACE, NULL);
257 box.width = MPLIST_INTEGER (plist);
258 plist = MPLIST_NEXT (plist);
259 if (! MPLIST_INTEGER_P (plist))
260 MERROR (MERROR_FACE, NULL);
261 box.inner_hmargin = MPLIST_INTEGER (plist);
262 plist = MPLIST_NEXT (plist);
263 if (! MPLIST_INTEGER_P (plist))
264 MERROR (MERROR_FACE, NULL);
265 box.inner_vmargin = MPLIST_INTEGER (plist);
266 plist = MPLIST_NEXT (plist);
267 if (! MPLIST_INTEGER_P (plist))
268 MERROR (MERROR_FACE, NULL);
269 box.outer_hmargin = MPLIST_INTEGER (plist);
270 plist = MPLIST_NEXT (plist);
271 if (! MPLIST_INTEGER_P (plist))
272 MERROR (MERROR_FACE, NULL);
273 box.outer_vmargin = MPLIST_INTEGER (plist);
274 plist = MPLIST_NEXT (plist);
275 if (! MPLIST_SYMBOL_P (plist))
276 MERROR (MERROR_FACE, NULL);
277 box.color_top = MPLIST_SYMBOL (plist);
278 plist = MPLIST_NEXT (plist);
279 if (! MPLIST_SYMBOL_P (plist))
280 MERROR (MERROR_FACE, NULL);
281 box.color_bottom = MPLIST_SYMBOL (plist);
282 plist = MPLIST_NEXT (plist);
283 if (! MPLIST_SYMBOL_P (plist))
284 MERROR (MERROR_FACE, NULL);
285 box.color_left = MPLIST_SYMBOL (plist);
286 plist = MPLIST_NEXT (plist);
287 if (! MPLIST_SYMBOL_P (plist))
288 MERROR (MERROR_FACE, NULL);
289 box.color_right = MPLIST_SYMBOL (plist);
290 MSTRUCT_MALLOC (box_ret, MERROR_FACE);
296 deserialize_face (MPlist *plist)
298 MFace *face = mface ();
300 MPLIST_DO (plist, plist)
306 if (! MPLIST_SYMBOL_P (plist))
308 key = MPLIST_SYMBOL (plist);
309 index = (int) msymbol_get (key, M_face_prop_index) - 1;
310 plist = MPLIST_NEXT (plist);
311 if (MPLIST_TAIL_P (plist))
313 if (index < 0 || index >= MFACE_PROPERTY_MAX)
315 if (key == Mfoundry || key == Mfamily || key == Mweight || key == Mstyle
316 || key == Mstretch || key == Madstyle
317 || key == Mforeground || key == Mbackground || key == Mvideomode)
319 if (! MPLIST_SYMBOL_P (plist))
321 val = MPLIST_VAL (plist);
323 else if (key == Msize || key == Mratio)
325 if (! MPLIST_INTEGER_P (plist))
327 val = MPLIST_VAL (plist);
329 else if (key == Mfontset)
331 if (! MPLIST_SYMBOL_P (plist))
333 val = mfontset (MSYMBOL_NAME (MPLIST_SYMBOL (plist)));
335 else if (key == Mhline)
337 if (! MPLIST_PLIST_P (plist))
339 val = deserialize_hline (MPLIST_PLIST (plist));
341 else if (key == Mbox)
343 if (! MPLIST_PLIST_P (plist))
345 val = deserialize_box (MPLIST_PLIST (plist));
347 face->property[index] = val;
352 static MGlyphString work_gstring;
358 MFace *mface__default;
365 face_table.count = 0;
366 Mface = msymbol_as_managing_key ("face");
367 msymbol_put (Mface, Mtext_prop_serializer, (void *) serialize_face);
368 msymbol_put (Mface, Mtext_prop_deserializer, (void *) deserialize_face);
370 Mforeground = msymbol ("foreground");
371 Mbackground = msymbol ("background");
372 Mvideomode = msymbol ("videomode");
373 Mnormal = msymbol ("normal");
374 Mreverse = msymbol ("reverse");
375 Mratio = msymbol ("ratio");
376 Mhline = msymbol ("hline");
377 Mbox = msymbol ("box");
378 Mhook_func = msymbol ("hook-func");
379 Mhook_arg = msymbol ("hook-arg");
381 Mlatin = msymbol ("latin");
382 M_face_prop_index = msymbol (" face-prop-index");
386 /* Pointer to the key symbol of the face property. */
388 /* Index (enum face_property) of the face property. */
390 } mface_prop_data[MFACE_PROPERTY_MAX] =
391 { { &Mfoundry, MFACE_FOUNDRY },
392 { &Mfamily, MFACE_FAMILY },
393 { &Mweight, MFACE_WEIGHT },
394 { &Mstyle, MFACE_STYLE },
395 { &Mstretch, MFACE_STRETCH },
396 { &Madstyle, MFACE_ADSTYLE },
397 { &Msize, MFACE_SIZE },
398 { &Mfontset, MFACE_FONTSET },
399 { &Mforeground, MFACE_FOREGROUND },
400 { &Mbackground, MFACE_BACKGROUND },
401 { &Mhline, MFACE_HLINE },
402 { &Mbox, MFACE_BOX },
403 { &Mvideomode, MFACE_VIDEOMODE },
404 { &Mhook_func, MFACE_HOOK_FUNC },
405 { &Mhook_arg, MFACE_HOOK_ARG },
406 { &Mratio, MFACE_RATIO },
409 for (i = 0; i < MFACE_PROPERTY_MAX; i++)
410 /* We add one to distinguish it from no-property. */
411 msymbol_put (*mface_prop_data[i].key, M_face_prop_index,
412 (void *) (mface_prop_data[i].index + 1));
415 mface__default = mface ();
416 mface__default->property[MFACE_WEIGHT] = msymbol ("medium");
417 mface__default->property[MFACE_STYLE] = msymbol ("r");
418 mface__default->property[MFACE_STRETCH] = msymbol ("normal");
419 mface__default->property[MFACE_SIZE] = (void *) 120;
420 mface__default->property[MFACE_FONTSET] = mfontset (NULL);
421 M17N_OBJECT_REF (mface__default->property[MFACE_FONTSET]);
422 /* mface__default->property[MFACE_FOREGROUND] =msymbol ("black"); */
423 /* mface__default->property[MFACE_BACKGROUND] =msymbol ("white"); */
425 mface_normal_video = mface ();
426 mface_normal_video->property[MFACE_VIDEOMODE] = (void *) Mnormal;
428 mface_reverse_video = mface ();
429 mface_reverse_video->property[MFACE_VIDEOMODE] = (void *) Mreverse;
432 MFaceHLineProp *hline_prop;
434 MSTRUCT_MALLOC (hline_prop, MERROR_FACE);
435 hline_prop->type = MFACE_HLINE_UNDER;
436 hline_prop->width = 1;
437 hline_prop->color = Mnil;
438 mface_underline = mface ();
439 mface_underline->property[MFACE_HLINE] = (void *) hline_prop;
442 mface_medium = mface ();
443 mface_medium->property[MFACE_WEIGHT] = (void *) msymbol ("medium");
444 mface_bold = mface ();
445 mface_bold->property[MFACE_WEIGHT] = (void *) msymbol ("bold");
446 mface_italic = mface ();
447 mface_italic->property[MFACE_STYLE] = (void *) msymbol ("i");
448 mface_bold_italic = mface_copy (mface_bold);
449 mface_bold_italic->property[MFACE_STYLE]
450 = mface_italic->property[MFACE_STYLE];
452 mface_xx_small = mface ();
453 mface_xx_small->property[MFACE_RATIO] = (void *) 50;
454 mface_x_small = mface ();
455 mface_x_small->property[MFACE_RATIO] = (void *) 67;
456 mface_small = mface ();
457 mface_small->property[MFACE_RATIO] = (void *) 75;
458 mface_normalsize = mface ();
459 mface_normalsize->property[MFACE_RATIO] = (void *) 100;
460 mface_large = mface ();
461 mface_large->property[MFACE_RATIO] = (void *) 120;
462 mface_x_large = mface ();
463 mface_x_large->property[MFACE_RATIO] = (void *) 150;
464 mface_xx_large = mface ();
465 mface_xx_large->property[MFACE_RATIO] = (void *) 200;
467 mface_black = mface ();
468 mface_black->property[MFACE_FOREGROUND] = (void *) msymbol ("black");
469 mface_white = mface ();
470 mface_white->property[MFACE_FOREGROUND] = (void *) msymbol ("white");
471 mface_red = mface ();
472 mface_red->property[MFACE_FOREGROUND] = (void *) msymbol ("red");
473 mface_green = mface ();
474 mface_green->property[MFACE_FOREGROUND] = (void *) msymbol ("green");
475 mface_blue = mface ();
476 mface_blue->property[MFACE_FOREGROUND] = (void *) msymbol ("blue");
477 mface_cyan = mface ();
478 mface_cyan->property[MFACE_FOREGROUND] = (void *) msymbol ("cyan");
479 mface_yellow = mface ();
480 mface_yellow->property[MFACE_FOREGROUND] = (void *) msymbol ("yellow");
481 mface_magenta = mface ();
482 mface_magenta->property[MFACE_FOREGROUND] = (void *) msymbol ("magenta");
484 work_gstring.glyphs = malloc (sizeof (MGlyph) * 2);
485 work_gstring.size = 2;
486 work_gstring.used = 0;
487 work_gstring.inc = 1;
494 M17N_OBJECT_UNREF (mface__default);
495 M17N_OBJECT_UNREF (mface_normal_video);
496 M17N_OBJECT_UNREF (mface_reverse_video);
497 M17N_OBJECT_UNREF (mface_underline);
498 M17N_OBJECT_UNREF (mface_medium);
499 M17N_OBJECT_UNREF (mface_bold);
500 M17N_OBJECT_UNREF (mface_italic);
501 M17N_OBJECT_UNREF (mface_bold_italic);
502 M17N_OBJECT_UNREF (mface_xx_small);
503 M17N_OBJECT_UNREF (mface_x_small);
504 M17N_OBJECT_UNREF (mface_small);
505 M17N_OBJECT_UNREF (mface_normalsize);
506 M17N_OBJECT_UNREF (mface_large);
507 M17N_OBJECT_UNREF (mface_x_large);
508 M17N_OBJECT_UNREF (mface_xx_large);
509 M17N_OBJECT_UNREF (mface_black);
510 M17N_OBJECT_UNREF (mface_white);
511 M17N_OBJECT_UNREF (mface_red);
512 M17N_OBJECT_UNREF (mface_green);
513 M17N_OBJECT_UNREF (mface_blue);
514 M17N_OBJECT_UNREF (mface_cyan);
515 M17N_OBJECT_UNREF (mface_yellow);
516 M17N_OBJECT_UNREF (mface_magenta);
517 free (work_gstring.glyphs);
519 mdebug__report_object ("Face", &face_table);
522 /** Return a realized face for ASCII characters from NUM number of
523 base faces pointed by FACES on the frame FRAME. */
526 mface__realize (MFrame *frame, MFace **faces, int num,
527 MSymbol language, MSymbol charset, int size)
529 MRealizedFace *rface;
530 MRealizedFont *rfont;
531 MFace merged_face = *(frame->face);
537 if (num == 0 && language == Mnil && charset == Mnil && frame->rface)
540 for (i = 0; i < MFACE_PROPERTY_MAX; i++)
541 for (j = num - 1; j >= 0; j--)
542 if (faces[j]->property[i])
544 merged_face.property[i] = faces[j]->property[i];
548 for (i = 0, tick = 0; i < num; i++)
549 tick += faces[i]->tick;
551 if (merged_face.property[MFACE_RATIO])
553 int font_size = (int) merged_face.property[MFACE_SIZE];
555 font_size *= (int) merged_face.property[MFACE_RATIO];
557 merged_face.property[MFACE_SIZE] = (void *) font_size;
560 rface = find_realized_face (frame, &merged_face, NULL);
561 if (rface && rface->tick == tick)
562 return rface->ascii_rface;
564 MSTRUCT_CALLOC (rface, MERROR_FACE);
565 rface->frame = frame;
566 rface->face = merged_face;
568 props = rface->face.property;
570 rface->rfontset = mfont__realize_fontset (frame,
571 (MFontset *) props[MFACE_FONTSET],
575 rfont = mfont__lookup_fontset (rface->rfontset, &g, &num,
576 msymbol ("latin"), language, Mnil,
581 rface->rfont = rfont;
583 work_gstring.glyphs[0] = g;
584 work_gstring.glyphs[0].rface = rface;
585 work_gstring.glyphs[1].code = MCHAR_INVALID_CODE;
586 work_gstring.glyphs[1].rface = rface;
587 mfont__get_metric (&work_gstring, 0, 2);
588 rface->space_width = work_gstring.glyphs[0].width;
589 rface->ascent = work_gstring.glyphs[1].ascent;
590 rface->descent = work_gstring.glyphs[1].descent;
595 rface->space_width = frame->space_width;
598 rface->hline = (MFaceHLineProp *) props[MFACE_HLINE];
599 rface->box = (MFaceBoxProp *) props[MFACE_BOX];
600 rface->ascii_rface = rface;
601 mwin__realize_face (rface);
603 mplist_add (frame->realized_face_list, Mt, rface);
607 MSTRUCT_CALLOC (rface->nofont_rface, MERROR_FACE);
608 *rface->nofont_rface = *rface;
609 rface->nofont_rface->rfont = NULL;
612 rface->nofont_rface = rface;
619 mface__for_chars (MSymbol script, MSymbol language, MSymbol charset,
620 MGlyph *from_g, MGlyph *to_g, int size)
622 MRealizedFace *rface;
623 MRealizedFont *rfont;
624 int num = to_g - from_g, i;
626 rfont = mfont__lookup_fontset (from_g->rface->rfontset, from_g, &num,
627 script, language, charset, size);
630 from_g->rface = from_g->rface->nofont_rface;
633 rface = find_realized_face (from_g->rface->frame, &(from_g->rface->face),
637 MSTRUCT_MALLOC (rface, MERROR_FACE);
638 *rface = *from_g->rface->ascii_rface;
639 rface->rfont = rfont;
641 work_gstring.glyphs[0].code = MCHAR_INVALID_CODE;
642 work_gstring.glyphs[0].rface = rface;
643 mfont__get_metric (&work_gstring, 0, 1);
644 rface->ascent = work_gstring.glyphs[0].ascent;
645 rface->descent = work_gstring.glyphs[0].descent;
647 mwin__realize_face (rface);
648 mplist_add (from_g->rface->frame->realized_face_list, Mt, rface);
651 for (i = 0; i < num; i++, from_g++)
652 from_g->rface = rface;
658 mface__free_realized (MRealizedFace *rface)
660 mwin__free_realized_face (rface);
661 if (rface == rface->ascii_rface)
663 if (! rface->nofont_rface)
666 free (rface->nofont_rface);
667 rface->nofont_rface = NULL;
673 #endif /* !FOR_DOXYGEN || DOXYGEN_INTERNAL_MODULE */
677 /*** @addtogroup m17nFace */
681 /***en @name Variables: Keys of face property */
682 /***ja @name ÊÑ¿ô: ¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼ */
687 @brief Key of a face property specifying foreground color
689 The variable #Mforeground is used as a key of face property. The
690 property value must be a symbol whose name is a color name, or
693 #Mnil means that the face does not specify a foreground color.
694 Otherwise, the foreground of an M-text is drawn by the specified
698 @brief Á°·Ê¿§¤ò»ØÄꤹ¤ë¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼
700 ÊÑ¿ô #Mforeground ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£
701 ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢¿§Ì¾¤ò̾Á°¤È¤·¤Æ»ý¤Ä¥·¥ó¥Ü¥ë¤« #Mnil ¤Ç¤¢¤ë¡£
703 #Mnil ¤Î¾ì¹ç¡¢Á°·Ê¿§¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤ì¤Ê¤±¤ì¤Ð M-text ¤ÎÁ°·Ê¤Ï
704 »ØÄꤵ¤ì¤¿¿§¤Çɽ¼¨¤µ¤ì¤ë¡£ */
709 @brief Key of a face property specifying background color
711 The variable #Mbackground is used as a key of face property. The
712 property value must be a symbol whose name is a color name, or
715 #Mnil means that the face does not specify a background color.
716 Otherwise, the background of an M-text is drawn by the specified
720 @brief ÇØ·Ê¿§¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼
722 ÊÑ¿ô #Mbackground ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£
723 ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢¿§Ì¾¤ò̾Á°¤È¤·¤Æ»ý¤Ä¥·¥ó¥Ü¥ë¤« #Mnil ¤Ç¤¢¤ë¡£
725 #Mnil ¤Î¾ì¹ç¡¢ÇØ·Ê¿§¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤ì¤Ê¤±¤ì¤Ð M-text ¤ÎÇطʤÏ
726 »ØÄꤵ¤ì¤¿¿§¤Çɽ¼¨¤µ¤ì¤ë¡£ */
731 @brief Key of a face property specifying video mode
733 The variable #Mvideomode is used as a key of face property. The
734 property value must be #Mnormal, #Mreverse, or #Mnil.
736 #Mnormal means that an M-text is drawn in normal video mode
737 (i.e. the foreground is drawn by foreground color, the background
738 is drawn by background color).
740 #Mreverse means that an M-text is drawn in reverse video mode
741 (i.e. the foreground is drawn by background color, the background
742 is drawn by foreground color).
744 #Mnil means that the face does not specify a video mode. */
747 @brief ¥Ó¥Ç¥ª¥â¡¼¥É¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼
749 ÊÑ¿ô #Mvideomode ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£
750 ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢#Mnormal, #Mreverse, #Mnil ¤Î¤¤¤º¤ì¤«¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
752 #Mnormal ¤Î¾ì¹ç¤Ï¡¢M-text ¤Ïɸ½à¤Î¥Ó¥Ç¥ª¥â¡¼¥É¡ÊÁ°·Ê¤òÁ°·Ê¿§¤Ç¡¢ÇØ
753 ·Ê¤òÇØ·Ê¿§¤Ç¡Ë¤Çɽ¼¨¤¹¤ë¡£
755 #Mreverse ¤Î¾ì¹ç¤Ï¥ê¥Ð¡¼¥¹¥Ó¥Ç¥ª¥â¡¼¥É¤Ç¡ÊÁ°·Ê¤òÇØ·Ê¿§¤Ç¡¢ÇطʤòÁ°
758 #Mnil ¤Î¾ì¹ç¤Ï¥Ó¥Ç¥ª¥â¡¼¥É¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
764 @brief Key of a face property specifying font size ratio
766 The variable #Mratio is used as a key of face property. The value
767 RATIO must be an integer.
769 The value 0 means that the face does not specify a font size
770 ratio. Otherwise, an M-text is drawn by a font of size (FONTSIZE
771 * RATIO / 100) where FONTSIZE is a font size specified by the face
774 @brief ¥µ¥¤¥º¤ÎÈæΨ¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼
776 ÊÑ¿ô #Mratio ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃÍ RATIO
777 ¤ÏÀ°¿ôÃͤǤʤ¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
779 Ãͤ¬0¤Ê¤é¤Ð¡¢¥Õ¥©¥ó¥È¥µ¥¤¥º¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¡¢M-text
780 ¤Ï(FONTSIZE * RATIO / 100) ¤È¤¤¤¦¥µ¥¤¥º¤Î¥Õ¥©¥ó¥È¤Çɽ¼¨¤µ¤ì¤ë¡£¤³
781 ¤³¤Ç FONTSIZE ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼ #Msize ¤Ç»ØÄꤵ¤ì¤¿¥µ¥¤¥º¤Ç¤¢
787 @brief Key of a face property specifying horizontal line
789 The variable #Mhline is used as a key of face property. The value
790 must be a pointer to an object of type #MFaceHLineProp, or @c
793 The value @c NULL means that the face does not specify this
794 property. Otherwise, an M-text is drawn with a horizontal line by
795 a way specified by the object that the value points to. */
798 @brief ¿åÊ¿Àþ¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼
800 ÊÑ¿ô #Mhline ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃͤÏ
801 #MFaceHLineProp ·¿¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤« @c NULL ¤Ç¤Ê¤¯¤Æ¤Ï¤Ê
804 Ãͤ¬ @c NULL ¤Ê¤é¤Ð¡¢¤³¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤±¤ì¤ÐÃÍ
805 ¤¬»Ø¤¹¥ª¥Ö¥¸¥§¥¯¥È¤Ë»ØÄꤵ¤ì¤¿¤è¤¦¤Ë¿åÊ¿Àþ¤òÉղä·¤Æ M-text ¤òɽ¼¨
811 @brief Key of a face property specifying box
813 The variable #Mbox is used as a key of face property. The value
814 must be a pointer to an object of type #MFaceBoxProp, or @c NULL.
816 The value @c NULL means that the face does not specify a box.
817 Otherwise, an M-text is drawn with a surrounding box by a way
818 specified by the object that the value points to. */
821 @brief °Ï¤ßÏȤò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼
823 ÊÑ¿ô #Mbox ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃͤÏ
824 #MFaceBoxProp ·¿¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤« @c NULL ¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é
827 Ãͤ¬ @c NULL ¤Ê¤é¤Ð¡¢¤³¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤±¤ì¤ÐÃÍ
828 ¤¬»Ø¤¹¥ª¥Ö¥¸¥§¥¯¥È¤Ë»ØÄꤵ¤ì¤¿¤è¤¦¤Ë°Ï¤ßÏȤòÉղä·¤Æ M-text ¤òɽ¼¨
834 @brief Key of a face property specifying fontset
836 The variable #Mfontset is used as a key of face property. The
837 value must be a pointer to an object of type #Mfontset, or @c
840 The value @c NULL means that the face does not specify a fontset.
841 Otherwise, an M-text is drawn with a font selected from what
842 specified in the fontset. */
845 @brief ¥Õ¥©¥ó¥È¥»¥Ã¥È¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼
847 ÊÑ¿ô #Mfontset ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃͤÏ
848 #Mfontset ·¿¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤« @c NULL ¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
850 Ãͤ¬ @c NULL ¤Ê¤é¤Ð¡¢¥Õ¥©¥ó¥È¥»¥Ã¥È¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤±¤ì¤ÐÃÍ
851 ¤¬»Ø¤¹¥ª¥Ö¥¸¥§¥¯¥È¤Ë»ØÄꤵ¤ì¤¿¥Õ¥©¥ó¥È¥»¥Ã¥È¤«¤éÁª¤ó¤À¥Õ¥©¥ó¥È¤Ç
852 M-text ¤òɽ¼¨¤¹¤ë¡£*/
857 @brief Key of a face property specifying hook
859 The variable #Mhook_func is used as a key of face property. The
860 value must be a function of type #MFaceHookFunc, or @c NULL.
862 The value @c NULL means that the face does not specify a hook.
863 Otherwise, the specified function is called before the face is
866 @brief ¥Õ¥Ã¥¯¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼
868 ÊÑ¿ô #Mhook_func ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃͤÏ
869 #MFaceHookFunc ·¿¤Î´Ø¿ô¤« @c NULL ¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
871 Ãͤ¬ @c NULL ¤Ê¤é¤Ð¡¢¥Õ¥Ã¥¯¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤±¤ì¤Ð¥Õ¥§¡¼¥¹¤ò
872 ¼Â¸½¤¹¤ëÁ°¤Ë»ØÄꤷ¤¿´Ø¿ô¤¬¸Æ¤Ð¤ì¤ë¡£ */
876 @brief Key of a face property specifying argument of hook
878 The variable #Mhook_arg is used as a key of face property. The
879 value can be anything that is passed a hook function specified by
880 the face property #Mhook_func. */
882 @brief ¥Õ¥Ã¥¯¤Î°ú¿ô¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼
884 ÊÑ¿ô #Mhook_arg ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃͤÏ
885 ²¿¤Ç¤â¤è¤¯¡¢¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£ #Mhook_func ¤Ç»ØÄꤵ¤ì¤ë´Ø¿ô¤ËÅϤµ
892 /*** @ingroup m17nFace */
893 /***en @name Variables: Possible values of #Mvideomode property of face */
894 /***ja @name ÊÑ¿ô¡§ ¥Õ¥§¡¼¥¹¤Î #Mvideomode ¥×¥í¥Ñ¥Æ¥£¤Î²Äǽ¤ÊÃÍ */
899 See the documentation of the variable #Mvideomode. */
901 ÊÑ¿ô #Mvideomode ¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£ */
907 /*** @ingroup m17nFace */
908 /***en @name Variables: Predefined faces */
909 /***ja @name ÊÑ¿ô: ÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹ */
914 @brief Normal video face
916 The variable #mface_normal_video points to a face that has the
917 #Mvideomode property with value #Mnormal. The other properties
918 are not specified. An M-text drawn with this face appear normal
919 colors (i.e. the foreground is drawn by foreground color, and
920 background is drawn by background color). */
922 @brief ɸ½à¥Ó¥Ç¥ª¥Õ¥§¡¼¥¹
924 ÊÑ¿ô #mface_normal_video ¤Ï #Mvideomode ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ #Mnormal
925 ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
926 ¤³¤Î¥Õ¥§¡¼¥¹¤Çɽ¼¨¤µ¤ì¤ëM-text ¤Ïɸ½à¤Î¿§ (¤¹¤Ê¤ï¤ÁÁ°·Ê¤ÏÁ°·Ê¿§¡¢
927 ÇطʤÏÇØ·Ê¿§¡Ë¤ÇÉÁ¤«¤ì¤ë¡£ */
929 MFace *mface_normal_video;
932 @brief Reverse video face
934 The variable #mface_reverse_video points to a face that has the
935 #Mvideomode property with value #Mreverse. The other properties
936 are not specified. An M-text drawn with this face appear in
937 reversed colors (i.e. the foreground is drawn by background
938 color, and background is drawn by foreground color). */
940 @brief ¥ê¥Ð¡¼¥¹¥Ó¥Ç¥ª¥Õ¥§¡¼¥¹
942 ÊÑ¿ô #mface_reverse_video ¤Ï #Mvideomode ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬
943 #Mreverse ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄê
944 ¤µ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤Çɽ¼¨¤µ¤ì¤ëM-text ¤ÏÁ°·Ê¿§¤ÈÇØ·Ê¿§¤¬Æþ¤ìÂØ
945 ¤ï¤Ã¤Æ (¤¹¤Ê¤ï¤ÁÁ°·Ê¤ÏÇØ·Ê¿§¡¢ÇطʤÏÁ°·Ê¿§¡ËÉÁ¤«¤ì¤ë¡£ */
947 MFace *mface_reverse_video;
950 @brief Underline face
952 The variable #mface_underline points to a face that has the
953 #Mhline property with value a pointer to an object of type
954 #MFaceHLineProp. The members of the object are as follows:
959 type MFACE_HLINE_UNDER
964 The other properties are not specified. An M-text that has this
965 face is drawn with an underline. */
969 ÊÑ¿ô #mface_underline ¤Ï #Mhline ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ #MFaceHLineProp
970 ·¿¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£¥ª¥Ö
971 ¥¸¥§¥¯¥È¤Î¥á¥ó¥Ð¤Ï°Ê²¼¤ÎÄ̤ꡣ
976 type MFACE_HLINE_UNDER
981 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ï²¼ÀþÉÕ¤
984 MFace *mface_underline;
989 The variable #mface_medium points to a face that has the #Mweight
990 property with value a symbol of name "medium". The other
991 properties are not specified. An M-text that has this face is
992 drawn with a font of medium weight. */
994 @brief ¥ß¥Ç¥£¥¢¥à¥Õ¥§¡¼¥¹
996 ÊÑ¿ô #mface_medium ¤Ï #Mweight ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "medium" ¤È¤¤¤¦Ì¾
997 Á°¤ò¤â¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í
998 ¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ï¡¢¥ß¥Ç¥£¥¢¥à¥¦¥§
999 ¥¤¥È¤Î¥Õ¥©¥ó¥È¤Çɽ¼¨¤µ¤ì¤ë¡£ */
1000 MFace *mface_medium;
1005 The variable #mface_bold points to a face that has the #Mweight
1006 property with value a symbol of name "bold". The other properties
1007 are not specified. An M-text that has this face is drawn with a
1008 font of bold weight. */
1011 @brief ¥Ü¡¼¥ë¥É¥Õ¥§¡¼¥¹
1013 ÊÑ¿ô #mface_bold ¤Ï #Mweight ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "bold" ¤È¤¤¤¦Ì¾Á°¤ò
1014 ¤â¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£
1015 ¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ï¡¢¥Ü¡¼¥ë¥É¤Î¥Õ¥©¥ó¥È¤Ç
1024 The variable #mface_italic points to a face that has the #Mstyle
1025 property with value a symbol of name "italic". The other
1026 properties are not specified. An M-text that has this face is
1027 drawn with a font of italic style. */
1030 @brief ¥¤¥¿¥ê¥Ã¥¯¥Õ¥§¡¼¥¹
1032 ÊÑ¿ô #mface_italic ¤Ï #Mstyle ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "italic" ¤È¤¤¤¦Ì¾Á°
1033 ¤ò¤â¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ
1034 ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ï¡¢¥¤¥¿¥ê¥Ã¥¯ÂΤÇɽ
1038 MFace *mface_italic;
1041 @brief Bold italic face
1043 The variable #mface_bold_italic points to a face that has the
1044 #Mweight property with value a symbol of name "bold", and #Mstyle
1045 property with value a symbol of name "italic". The other
1046 properties are not specified. An M-text that has this face is
1047 drawn with a font of bold weight and italic style. */
1050 @brief ¥Ü¡¼¥ë¥É¥¤¥¿¥ê¥Ã¥¯¥Õ¥§¡¼¥¹
1052 ÊÑ¿ô #mface_bold_italic ¤Ï¡¢#Mweight ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "bold" ¤È¤¤
1053 ¤¦Ì¾Á°¤ò¤â¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ê¡¢¤«¤Ä #Mstyle ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "italic"
1054 ¤È¤¤¤¦Ì¾Á°¤ò¤â¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1055 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ï¡¢¥Ü¡¼¥ë
1056 ¥É¥¤¥¿¥ê¥Ã¥¯ÂΤÇɽ¼¨¤µ¤ì¤ë¡£
1059 MFace *mface_bold_italic;
1062 @brief Smallest face
1064 The variable #mface_xx_small points to a face that has the #Mratio
1065 property with value 50. The other properties are not specified.
1066 An M-text that has this face is drawn with a font whose size is
1067 50% of a normal font. */
1070 @brief ºÇ¾®¤Î¥Õ¥§¡¼¥¹
1072 ÊÑ¿ô #mface_xx_small ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 50 ¤Ç¤¢¤ë¥Õ¥§¡¼
1073 ¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹
1074 ¤ò»ý¤Ä M-text ¤Ïɸ½à¤Î 50% ¤ÎÂ礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1077 MFace *mface_xx_small;
1082 The variable #mface_x_small points to a face that has the #Mratio
1083 property with value 66. The other properties are not specified.
1084 An M-text that has this face is drawn with a font whose size is
1085 66% of a normal font. */
1088 @brief ¤â¤Ã¤È¾®¤µ¤¤¥Õ¥§¡¼¥¹
1090 ÊÑ¿ô #mface_x_small ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 66 ¤Ç¤¢¤ë¥Õ¥§¡¼
1091 ¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹
1092 ¤ò»ý¤Ä M-text ¤Ïɸ½à¤Î 66% ¤ÎÂ礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1095 MFace *mface_x_small;
1100 The variable #mface_x_small points to a face that has the #Mratio
1101 property with value 75. The other properties are not specified.
1102 An M-text that has this face is drawn with a font whose size is
1103 75% of a normal font. */
1106 @brief ¾®¤µ¤¤¥Õ¥§¡¼¥¹
1108 ÊÑ¿ô #mface_small ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 75 ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò
1109 »Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý
1110 ¤Ä M-text ¤Ïɸ½à¤Î 75% ¤ÎÂ礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1116 @brief Normalsize face
1118 The variable #mface_normalsize points to a face that has the
1119 #Mratio property with value 100. The other properties are not
1120 specified. An M-text that has this face is drawn with a font
1121 whose size is the same as a normal font. */
1124 @brief ɸ½à¤ÎÂ礤µ¤Î¥Õ¥§¡¼¥¹
1126 ÊÑ¿ô #mface_normalsize ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 100 ¤Ç¤¢¤ë¥Õ¥§¡¼
1127 ¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹
1128 ¤ò»ý¤Ä M-text ¤Ïɸ½à¤ÈƱ¤¸Â礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1131 MFace *mface_normalsize;
1136 The variable #mface_large points to a face that has the #Mratio
1137 property with value 120. The other properties are not specified.
1138 An M-text that has this face is drawn with a font whose size is
1139 120% of a normal font. */
1142 @brief Â礤¤¥Õ¥§¡¼¥¹
1144 ÊÑ¿ô #mface_large ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 120 ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹
1145 ¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò
1146 »ý¤Ä M-text ¤Ïɸ½à¤Î 120% ¤ÎÂ礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1154 The variable #mface_x_large points to a face that has the #Mratio
1155 property with value 150. The other properties are not specified.
1156 An M-text that has this face is drawn with a font whose size is
1157 150% of a normal font. */
1160 @brief ¤â¤Ã¤ÈÂ礤¤¥Õ¥§¡¼¥¹
1162 ÊÑ¿ô #mface_x_large ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 150 ¤Ç¤¢¤ë¥Õ¥§¡¼
1163 ¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹
1164 ¤ò»ý¤Ä M-text ¤Ïɸ½à¤Î 150% ¤ÎÂ礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1167 MFace *mface_x_large;
1172 The variable #mface_xx_large points to a face that has the #Mratio
1173 property with value 200. The other properties are not specified.
1174 An M-text that has this face is drawn with a font whose size is
1175 200% of a normal font. */
1178 @brief ºÇÂç¤Î¥Õ¥§¡¼¥¹
1180 ÊÑ¿ô #mface_xx_large ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 200 ¤Ç¤¢¤ë¥Õ¥§¡¼
1181 ¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹
1182 ¤ò»ý¤Ä M-text ¤Ïɸ½à¤Î 200% ¤ÎÂ礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1185 MFace *mface_xx_large;
1190 The variable #mface_black points to a face that has the
1191 #Mforeground property with value a symbol of name "black". The
1192 other properties are not specified. An M-text that has this face
1193 is drawn with black foreground. */
1195 /***ja @brief ¹õ¥Õ¥§¡¼¥¹
1197 ÊÑ¿ô #mface_black ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "black" ¤È
1198 ¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×
1199 ¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤ÏÁ°·Ê¿§¤ò¹õ¤È¤·
1207 The variable #mface_white points to a face that has the
1208 #Mforeground property with value a symbol of name "white". The
1209 other properties are not specified. An M-text that has this face
1210 is drawn with white foreground. */
1215 ÊÑ¿ô #mface_white ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "white" ¤È
1216 ¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×
1217 ¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤ÏÁ°·Ê¿§¤òÇò¤È¤·
1225 The variable #mface_red points to a face that has the
1226 #Mforeground property with value a symbol of name "red". The
1227 other properties are not specified. An M-text that has this face
1228 is drawn with red foreground. */
1233 ÊÑ¿ô #mface_red ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "red" ¤È¤¤¤¦
1234 ̾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ
1235 ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤ÏÁ°·Ê¿§¤òÀ֤Ȥ·¤Æɽ
1243 The variable #mface_green points to a face that has the
1244 #Mforeground property with value a symbol of name "green". The
1245 other properties are not specified. An M-text that has this face
1246 is drawn with green foreground. */
1251 ÊÑ¿ô #mface_green ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "green" ¤È
1252 ¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×
1253 ¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤ÏÁ°·Ê¿§¤òÎФȤ·
1261 The variable #mface_blue points to a face that has the
1262 #Mforeground property with value a symbol of name "blue". The
1263 other properties are not specified. An M-text that has this face
1264 is drawn with blue foreground. */
1269 ÊÑ¿ô #mface_blue ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "blue" ¤È¤¤
1270 ¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í
1271 ¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤ÏÁ°·Ê¿§¤òÀĤȤ·¤Æ
1279 The variable #mface_cyan points to a face that has the
1280 #Mforeground property with value a symbol of name "cyan". The
1281 other properties are not specified. An M-text that has this face
1282 is drawn with cyan foreground. */
1285 @brief ¥·¥¢¥ó¥Õ¥§¡¼¥¹
1287 ÊÑ¿ô #mface_cyan ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "cyan" ¤È¤¤
1288 ¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í
1289 ¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤ÏÁ°·Ê¿§¤ò¥·¥¢¥ó¤È
1297 The variable #mface_yellow points to a face that has the
1298 #Mforeground property with value a symbol of name "yellow". The
1299 other properties are not specified. An M-text that has this face
1300 is drawn with yellow foreground. */
1305 ÊÑ¿ô #mface_yellow ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "yellow"
1306 ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î
1307 ¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤ÏÁ°·Ê¿§¤ò²«¿§
1308 ¤È¤·¤Æɽ¼¨¤µ¤ì¤ë¡£ */
1310 MFace *mface_yellow;
1315 The variable #mface_magenta points to a face that has the
1316 #Mforeground property with value a symbol of name "magenta". The
1317 other properties are not specified. An M-text that has this face
1318 is drawn with magenta foreground. */
1321 @brief ¥Þ¥¼¥ó¥¿¥Õ¥§¡¼¥¹
1323 ÊÑ¿ô #mface_magenta ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ
1324 "magenta" ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç
1325 ¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤ÏÁ°
1326 ·Ê¿§¤ò¥Þ¥¼¥ó¥¿¤È¤·¤Æɽ¼¨¤µ¤ì¤ë¡£ */
1328 MFace *mface_magenta;
1333 /***en @name Variables: The other symbols for face handling. */
1334 /***ja @name ÊÑ¿ô: ¥Õ¥§¡¼¥¹¤ò¼è¤ê°·¤¦¤¿¤á¤Î¤½¤Î¾¤Î¥·¥ó¥Ü¥ë */
1339 @brief Key of a text property specifying a face.
1341 The variable #Mface is a symbol of name <tt>"face"</tt>. A text
1342 property whose key is this symbol must have a pointer to an object
1343 of type #MFace. This is a managing key. */
1346 @brief ¥Õ¥§¡¼¥¹¤ò»ØÄꤹ¤ë¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼
1348 ÊÑ¿ô #Mface ¤Ï <tt>"face"</tt> ¤È¤¤¤¦Ì¾Á°¤ò»ý¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¡£¤³
1349 ¤Î¥·¥ó¥Ü¥ë¤ò¥¡¼¤È¤¹¤ë¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Ï¡¢#MFace ·¿¤Î¥ª¥Ö¥¸¥§¥¯
1350 ¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£¤³¤ì¤Ï´ÉÍý¥¡¼¤Ç¤¢¤ë¡£ */
1358 @brief Create a new face.
1360 The mface () function creates a new face object that specifies no
1364 This function returns a pointer to the created face. */
1367 @brief ¿·¤·¤¤¥Õ¥§¡¼¥¹¤ò¤Ä¤¯¤ë
1369 ´Ø¿ô mface () ¤Ï¥×¥í¥Ñ¥Æ¥£¤ò°ìÀÚ»ý¤¿¤Ê¤¤¿·¤·¤¤¥Õ¥§¡¼¥¹¥ª¥Ö¥¸¥§¥¯¥È
1373 ¤³¤Î´Ø¿ô¤Ïºî¤Ã¤¿¥Õ¥§¡¼¥¹¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ */
1380 M17N_OBJECT (face, free_face, MERROR_FACE);
1381 M17N_OBJECT_REGISTER (face_table, face);
1388 @brief Make a copy of a face.
1390 The mface_copy () function makes a copy of $FACE and returns a
1391 pointer to the created copy. */
1394 @brief ¥Õ¥§¡¼¥¹¤Î¥³¥Ô¡¼¤òºî¤ë.
1396 ´Ø¿ô mface_copy () ¤Ï¥Õ¥§¡¼¥¹ $FACE ¤Î¥³¥Ô¡¼¤òºî¤ê¡¢¤½¤Î¥³¥Ô¡¼¤Ø¤Î
1400 mface_copy (MFace *face)
1404 MSTRUCT_CALLOC (copy, MERROR_FACE);
1406 copy->control.ref_count = 1;
1407 M17N_OBJECT_REGISTER (face_table, copy);
1408 if (copy->property[MFACE_FONTSET])
1409 M17N_OBJECT_REF (copy->property[MFACE_FONTSET]);
1410 if (copy->property[MFACE_HLINE])
1412 MFaceHLineProp *val;
1414 MSTRUCT_MALLOC (val, MERROR_FACE);
1415 *val = *((MFaceHLineProp *) copy->property[MFACE_HLINE]);
1416 copy->property[MFACE_HLINE] = val;
1418 if (copy->property[MFACE_BOX])
1422 MSTRUCT_MALLOC (val, MERROR_FACE);
1423 *val = *((MFaceBoxProp *) copy->property[MFACE_BOX]);
1424 copy->property[MFACE_BOX] = val;
1434 The mface_merge () functions merges the properties of face $SRC
1438 This function returns $DST. */
1441 @brief ¥Õ¥§¡¼¥¹¤òÅý¹ç¤¹¤ë.
1443 ´Ø¿ô mface_merge () ¤Ï¡¢¥Õ¥§¡¼¥¹ $SRC ¤Î¥×¥í¥Ñ¥Æ¥£¤ò¥Õ¥§¡¼¥¹ $DST
1447 ¤³¤Î´Ø¿ô¤Ï $DST ¤òÊÖ¤¹¡£ */
1450 mface_merge (MFace *dst, MFace *src)
1454 for (i = 0; i < MFACE_PROPERTY_MAX; i++)
1455 if (src->property[i])
1457 dst->property[i] = src->property[i];
1458 if (i == MFACE_FONTSET)
1459 M17N_OBJECT_REF (dst->property[i]);
1460 else if (i == MFACE_HLINE)
1462 MFaceHLineProp *val;
1464 MSTRUCT_MALLOC (val, MERROR_FACE);
1465 *val = *((MFaceHLineProp *) dst->property[MFACE_HLINE]);
1466 dst->property[MFACE_HLINE] = val;
1468 else if (i == MFACE_BOX)
1472 MSTRUCT_MALLOC (val, MERROR_FACE);
1473 *val = *((MFaceBoxProp *) dst->property[MFACE_BOX]);
1474 dst->property[MFACE_BOX] = val;
1483 @brief Make a face from a font.
1485 The mface_from_font () function return a newly created face while
1486 reflecting the properties of $FONT in its properties. */
1489 @brief ¥Õ¥©¥ó¥È¤«¤é¥Õ¥§¡¼¥¹¤òºî¤ë.
1491 ´Ø¿ô mface_from_font () ¤Ï¥Õ¥©¥ó¥È $FONT ¤Î¥×¥í¥Ñ¥Æ¥£¤ò¥×¥í¥Ñ¥Æ¥£
1492 ¤È¤·¤Æ»ý¤Ä¿·¤·¤¤¥Õ¥§¡¼¥¹¤òºî¤ê¡¢¤½¤ì¤òÊÖ¤¹¡£ */
1495 mface_from_font (MFont *font)
1497 MFace *face = mface ();
1499 face->property[MFACE_FOUNDRY] = mfont_get_prop (font, Mfoundry);
1500 face->property[MFACE_FAMILY] = mfont_get_prop (font, Mfamily);
1501 face->property[MFACE_WEIGHT] = mfont_get_prop (font, Mweight);
1502 face->property[MFACE_STYLE] = mfont_get_prop (font, Mstyle);
1503 face->property[MFACE_STRETCH] = mfont_get_prop (font, Mstretch);
1504 face->property[MFACE_ADSTYLE] = mfont_get_prop (font, Madstyle);
1505 face->property[MFACE_SIZE] = mfont_get_prop (font, Msize);
1512 @brief Get the value of a face property.
1514 The mface_get_prop () function returns the value of the face
1515 property whose key is $KEY in face $FACE. $KEY must be one of the
1518 #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
1519 #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
1520 #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg
1523 The actual type of the returned value depends of $KEY. See
1524 documentation of the above keys. If an error is detected, it
1525 returns @c NULL and assigns an error code to the external variable
1529 @brief ¥Õ¥§¡¼¥¹¤Î¥×¥í¥Ñ¥Æ¥£¤ÎÃͤòÆÀ¤ë
1531 ´Ø¿ô mface_get_prop () ¤Ï¡¢¥Õ¥§¡¼¥¹ $FACE ¤¬»ý¤Ä¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£
1532 ¤ÎÆâ¡¢¥¡¼¤¬ $KEY ¤Ç¤¢¤ë¤â¤Î¤ÎÃͤòÊÖ¤¹¡£$KEY ¤Ï²¼µ¤Î¤¤¤º¤ì¤«¤Ç¤Ê
1535 #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
1536 #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
1537 #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg
1540 Ìá¤êÃͤη¿¤Ï $KEY ¤Ë°Í¸¤¹¤ë¡£¾åµ¤Î¥¡¼¤ÎÀâÌÀ¤ò»²¾È¤¹¤ë¤³
1541 ¤È¡£¥¨¥é¡¼¤¬¸¡½Ð¤µ¤ì¤¿¾ì¹ç¤Ï @c NULL ¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô #merror_code
1542 ¤Ë¥¨¥é¡¼¥³¡¼¥É¤òÀßÄꤹ¤ë¡£ */
1552 mface_get_prop (MFace *face, MSymbol key)
1554 int index = (int) msymbol_get (key, M_face_prop_index) - 1;
1557 MERROR (MERROR_FACE, NULL);
1558 return face->property[index];
1564 @brief Set a value of a face property.
1566 The mface_put_prop () function assigns $VAL to the property whose
1567 key is $KEY in face $FACE. $KEY must be one the followings:
1569 #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
1570 #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
1571 #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg
1573 Among them, font related properties (#Mfoundry through #Msize) are
1574 used as the default values when a font in the fontset of $FACE
1575 does not specify those values.
1577 The actual type of the returned value depends of $KEY. See
1578 documentation of the above keys.
1581 If the operation was successful, mface_put_prop returns () 0.
1582 Otherwise it returns -1 and assigns an error code to the external
1583 variable #merror_code. */
1586 @brief ¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤòÀßÄꤹ¤ë
1588 ´Ø¿ô mface_put_prop () ¤Ï¡¢¥Õ¥§¡¼¥¹ $FACE Æâ¤Ç¥¡¼¤¬ $KEY ¤Ç¤¢¤ë¥×
1589 ¥í¥Ñ¥Æ¥£¤ÎÃͤò $VAL ¤ËÀßÄꤹ¤ë¡£$KEY ¤Ï°Ê²¼¤Î¤¤¤º¤ì¤«¤Ç¤Ê¤¯¤Æ¤Ï¤Ê
1592 #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
1593 #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
1594 #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg.
1596 ¤³¤ì¤é¤Î¤¦¤Á¤Î¡¢¥Õ¥©¥ó¥È´ØÏ¢¤Î¥×¥í¥Ñ¥Æ¥£ (#Mfamily ¤«¤é #Msize
1597 ¤Þ¤Ç) ¤Ï¡¢¥Õ¥§¡¼¥¹¤Î¥Õ¥©¥ó¥È¥»¥Ã¥ÈÃæ¤Î¥Õ¥©¥ó¥È¤Ë´Ø¤¹¤ë¥Ç¥Õ¥©¥ë¥ÈÃÍ
1598 ¤È¤Ê¤ê¡¢¸Ä¡¹¤Î¥Õ¥©¥ó¥È¤¬Ãͤò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¤ËÍѤ¤¤é¤ì¤ë¡£
1600 Ìá¤êÃͤη¿¤Ï $KEY ¤Ë°Í¸¤¹¤ë¡£¾åµ¤Î¥¡¼¤ÎÀâÌÀ¤ò»²¾È¤¹¤ë¤³¤È¡£
1603 ½èÍý¤¬À®¸ù¤·¤¿¾ì¹ç¡¢mface_put_prop () ¤Ï 0 ¤òÊÖ¤¹¡£¼ºÇÔ¤·¤¿¾ì¹ç¤Ï
1604 -1 ¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô #merror_code ¤Ë¥¨¥é¡¼¥³¡¼¥É¤òÀßÄꤹ¤ë¡£ */
1614 mface_put_prop (MFace *face, MSymbol key, void *val)
1616 int index = (int) msymbol_get (key, M_face_prop_index) - 1;
1619 MERROR (MERROR_FACE, -1);
1620 if (key == Mfontset)
1621 M17N_OBJECT_REF (val);
1622 else if (key == Mhline)
1624 MFaceHLineProp *newval;
1626 MSTRUCT_MALLOC (newval, MERROR_FACE);
1627 *newval = *((MFaceHLineProp *) val);
1630 else if (key == Mbox)
1632 MFaceBoxProp *newval;
1634 MSTRUCT_MALLOC (newval, MERROR_FACE);
1635 *newval = *((MFaceBoxProp *) val);
1638 face->property[index] = val;
1647 @brief Update a face.
1649 The mface_update () function update face $FACE on frame $FRAME by
1650 calling a hook function of $FACE (if any). */
1653 @brief ¥Õ¥§¡¼¥¹¤ò¹¹¿·¤¹¤ë.
1655 ´Ø¿ô mface_update () ¤Ï¥Õ¥ì¡¼¥à $FRAME ¤Î¥Õ¥§¡¼¥¹ $FACE ¤ò $FACE
1656 ¤Î¥Õ¥Ã¥¯´Ø¿ô¤ò¡Ê¤¢¤ì¤Ð¡Ë¸Æ¤ó¤Ç¹¹¿·¤¹¤ë¡£ */
1659 mface_update (MFrame *frame, MFace *face)
1661 MFaceHookFunc func = (MFaceHookFunc) face->property[MFACE_HOOK_FUNC];
1663 MRealizedFace *rface;
1667 MPLIST_DO (rface_list, frame->realized_face_list)
1669 rface = MPLIST_VAL (rface_list);
1670 if ((MFaceHookFunc) rface->face.property[MFACE_HOOK_FUNC] == func)
1671 (func) (&(rface->face), rface->face.property[MFACE_HOOK_ARG],
1681 /*** @addtogroup m17nDebug */
1688 The mdebug_dump_face () function prints face $FACE in a human readable
1689 way to the stderr. $INDENT specifies how many columns to indent
1690 the lines but the first one.
1693 This function returns $FACE. */
1696 @brief ¥Õ¥§¡¼¥¹¤ò¥À¥ó¥×¤¹¤ë.
1698 ´Ø¿ô mdebug_dump_face () ¤Ï¥Õ¥§¡¼¥¹ $FACE ¤ò stderr ¤Ë¿Í´Ö ¤Ë²ÄÆÉ
1699 ¤Ê·Á¤Ç°õºþ¤¹¤ë¡£ $INDENT ¤Ï£²¹ÔÌܰʹߤΥ¤¥ó¥Ç¥ó¥È¤ò»ØÄꤹ¤ë¡£
1702 ¤³¤Î´Ø¿ô¤Ï $FACE ¤òÊÖ¤¹¡£ */
1705 mdebug_dump_face (MFace *face, int indent)
1707 char *prefix = (char *) alloca (indent + 1);
1710 memset (prefix, 32, indent);
1712 mfont__set_spec_from_face (&spec, face);
1713 fprintf (stderr, "(face font:\"");
1714 mdebug_dump_font (&spec);
1715 fprintf (stderr, "\"\n %s fore:%s back:%s", prefix,
1716 msymbol_name ((MSymbol) face->property[MFACE_FOREGROUND]),
1717 msymbol_name ((MSymbol) face->property[MFACE_BACKGROUND]));
1718 if (face->property[MFACE_FONTSET])
1719 fprintf (stderr, " non-default-fontset");
1720 fprintf (stderr, " hline:%s", face->property[MFACE_HLINE] ? "yes" : "no");
1721 fprintf (stderr, " box:%s)", face->property[MFACE_BOX] ? "yes" : "no");