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 /** From FRAME->realized_face_list, find a plist element whose value
109 is a realized face realized from FACE and using font RFONT. If
110 RFONT is NULL, find one from faces for ASCII (which are in the
111 head of FRAME->realized_face_list), otherwise find one that uses
115 find_realized_face (MFrame *frame, MFace *face, MRealizedFont *rfont)
118 MRealizedFace *rface;
121 MPLIST_DO (rface_list, frame->realized_face_list)
123 rface = MPLIST_VAL (rface_list);
126 if (rface != rface->ascii_rface)
131 if (rface->rfont != rfont)
134 for (i = 0; i < MFACE_RATIO; i++)
135 if (rface->face.property[i] != face->property[i])
137 if (i == MFACE_RATIO)
144 free_face (void *object)
146 MFace *face = (MFace *) object;
148 if (face->property[MFACE_FONTSET])
149 M17N_OBJECT_UNREF (face->property[MFACE_FONTSET]);
150 if (face->property[MFACE_HLINE])
151 free (face->property[MFACE_HLINE]);
152 if (face->property[MFACE_BOX])
153 free (face->property[MFACE_BOX]);
154 M17N_OBJECT_UNREF (face->realized_face_list);
155 M17N_OBJECT_UNREGISTER (face_table, face);
161 serialize_hline (MPlist *plist, MFaceHLineProp *hline)
163 MPlist *pl = mplist ();
165 mplist_add (pl, Minteger, (void *) hline->type);
166 mplist_add (pl, Minteger, (void *) hline->width);
167 mplist_add (pl, Msymbol, hline->color);
168 plist = mplist_add (plist, Mplist, pl);
169 M17N_OBJECT_UNREF (pl);
174 serialize_box (MPlist *plist, MFaceBoxProp *box)
176 MPlist *pl = mplist ();
178 mplist_add (pl, Minteger, (void *) box->width);
179 mplist_add (pl, Minteger, (void *) box->inner_hmargin);
180 mplist_add (pl, Minteger, (void *) box->inner_vmargin);
181 mplist_add (pl, Minteger, (void *) box->outer_hmargin);
182 mplist_add (pl, Minteger, (void *) box->outer_vmargin);
183 mplist_add (pl, Msymbol, box->color_top);
184 mplist_add (pl, Msymbol, box->color_bottom);
185 mplist_add (pl, Msymbol, box->color_left);
186 mplist_add (pl, Msymbol, box->color_right);
187 plist = mplist_add (plist, Mplist, pl);
188 M17N_OBJECT_UNREF (pl);
193 serialize_face (void *val)
196 MPlist *plist = mplist (), *pl = plist;
201 MPlist *(*func) (MPlist *plist, void *val);
202 } serializer[MFACE_PROPERTY_MAX]
203 = { { &Mfoundry, &Msymbol },
204 { &Mfamily, &Msymbol },
205 { &Mweight, &Msymbol },
206 { &Mstyle, &Msymbol },
207 { &Mstretch, &Msymbol },
208 { &Madstyle, &Msymbol },
209 { &Msize, &Minteger },
211 { &Mforeground, &Msymbol },
212 { &Mbackground, &Msymbol },
215 { &Mvideomode, &Msymbol },
216 { NULL, NULL}, /* MFACE_HOOK_FUNC */
217 { NULL, NULL}, /* MFACE_HOOK_ARG */
218 { &Mratio, &Minteger } };
220 for (i = 0; i < MFACE_PROPERTY_MAX; i++)
221 if (face->property[i] && serializer[i].key)
223 pl = mplist_add (pl, Msymbol, *serializer[i].key);
224 if (serializer[i].type)
225 pl = mplist_add (pl, *serializer[i].type, face->property[i]);
226 else if (i == MFACE_FONTSET)
227 pl = mplist_add (pl, Msymbol, mfontset_name ((MFontset *)
229 else if (i == MFACE_HLINE)
230 pl = serialize_hline (pl, (MFaceHLineProp *) face->property[i]);
231 else if (i == MFACE_BOX)
232 pl = serialize_box (pl, (MFaceBoxProp *) face->property[i]);
239 deserialize_hline (MPlist *plist)
241 MFaceHLineProp hline, *hline_ret;
243 if (! MPLIST_INTEGER_P (plist))
244 MERROR (MERROR_FACE, NULL);
245 hline.type = MPLIST_INTEGER_P (plist);
246 plist = MPLIST_NEXT (plist);
247 if (! MPLIST_INTEGER_P (plist))
248 MERROR (MERROR_FACE, NULL);
249 hline.width = MPLIST_INTEGER_P (plist);
250 plist = MPLIST_NEXT (plist);
251 if (! MPLIST_SYMBOL_P (plist))
252 MERROR (MERROR_FACE, NULL);
253 hline.color = MPLIST_SYMBOL (plist);
254 MSTRUCT_MALLOC (hline_ret, MERROR_FACE);
260 deserialize_box (MPlist *plist)
262 MFaceBoxProp box, *box_ret;
264 if (! MPLIST_INTEGER_P (plist))
265 MERROR (MERROR_FACE, NULL);
266 box.width = MPLIST_INTEGER (plist);
267 plist = MPLIST_NEXT (plist);
268 if (! MPLIST_INTEGER_P (plist))
269 MERROR (MERROR_FACE, NULL);
270 box.inner_hmargin = MPLIST_INTEGER (plist);
271 plist = MPLIST_NEXT (plist);
272 if (! MPLIST_INTEGER_P (plist))
273 MERROR (MERROR_FACE, NULL);
274 box.inner_vmargin = MPLIST_INTEGER (plist);
275 plist = MPLIST_NEXT (plist);
276 if (! MPLIST_INTEGER_P (plist))
277 MERROR (MERROR_FACE, NULL);
278 box.outer_hmargin = MPLIST_INTEGER (plist);
279 plist = MPLIST_NEXT (plist);
280 if (! MPLIST_INTEGER_P (plist))
281 MERROR (MERROR_FACE, NULL);
282 box.outer_vmargin = MPLIST_INTEGER (plist);
283 plist = MPLIST_NEXT (plist);
284 if (! MPLIST_SYMBOL_P (plist))
285 MERROR (MERROR_FACE, NULL);
286 box.color_top = MPLIST_SYMBOL (plist);
287 plist = MPLIST_NEXT (plist);
288 if (! MPLIST_SYMBOL_P (plist))
289 MERROR (MERROR_FACE, NULL);
290 box.color_bottom = MPLIST_SYMBOL (plist);
291 plist = MPLIST_NEXT (plist);
292 if (! MPLIST_SYMBOL_P (plist))
293 MERROR (MERROR_FACE, NULL);
294 box.color_left = MPLIST_SYMBOL (plist);
295 plist = MPLIST_NEXT (plist);
296 if (! MPLIST_SYMBOL_P (plist))
297 MERROR (MERROR_FACE, NULL);
298 box.color_right = MPLIST_SYMBOL (plist);
299 MSTRUCT_MALLOC (box_ret, MERROR_FACE);
305 deserialize_face (MPlist *plist)
307 MFace *face = mface ();
309 MPLIST_DO (plist, plist)
315 if (! MPLIST_SYMBOL_P (plist))
317 key = MPLIST_SYMBOL (plist);
318 index = (int) msymbol_get (key, M_face_prop_index) - 1;
319 plist = MPLIST_NEXT (plist);
320 if (MPLIST_TAIL_P (plist))
322 if (index < 0 || index >= MFACE_PROPERTY_MAX)
324 if (key == Mfoundry || key == Mfamily || key == Mweight || key == Mstyle
325 || key == Mstretch || key == Madstyle
326 || key == Mforeground || key == Mbackground || key == Mvideomode)
328 if (! MPLIST_SYMBOL_P (plist))
330 val = MPLIST_VAL (plist);
332 else if (key == Msize || key == Mratio)
334 if (! MPLIST_INTEGER_P (plist))
336 val = MPLIST_VAL (plist);
338 else if (key == Mfontset)
340 if (! MPLIST_SYMBOL_P (plist))
342 val = mfontset (MSYMBOL_NAME (MPLIST_SYMBOL (plist)));
344 else if (key == Mhline)
346 if (! MPLIST_PLIST_P (plist))
348 val = deserialize_hline (MPLIST_PLIST (plist));
350 else if (key == Mbox)
352 if (! MPLIST_PLIST_P (plist))
354 val = deserialize_box (MPLIST_PLIST (plist));
356 face->property[index] = val;
361 static MGlyphString work_gstring;
367 MFace *mface__default;
374 face_table.count = 0;
375 Mface = msymbol_as_managing_key ("face");
376 msymbol_put (Mface, Mtext_prop_serializer, (void *) serialize_face);
377 msymbol_put (Mface, Mtext_prop_deserializer, (void *) deserialize_face);
379 Mforeground = msymbol ("foreground");
380 Mbackground = msymbol ("background");
381 Mvideomode = msymbol ("videomode");
382 Mnormal = msymbol ("normal");
383 Mreverse = msymbol ("reverse");
384 Mratio = msymbol ("ratio");
385 Mhline = msymbol ("hline");
386 Mbox = msymbol ("box");
387 Mhook_func = msymbol ("hook-func");
388 Mhook_arg = msymbol ("hook-arg");
390 Mlatin = msymbol ("latin");
391 M_face_prop_index = msymbol (" face-prop-index");
395 /* Pointer to the key symbol of the face property. */
397 /* Index (enum face_property) of the face property. */
399 } mface_prop_data[MFACE_PROPERTY_MAX] =
400 { { &Mfoundry, MFACE_FOUNDRY },
401 { &Mfamily, MFACE_FAMILY },
402 { &Mweight, MFACE_WEIGHT },
403 { &Mstyle, MFACE_STYLE },
404 { &Mstretch, MFACE_STRETCH },
405 { &Madstyle, MFACE_ADSTYLE },
406 { &Msize, MFACE_SIZE },
407 { &Mfontset, MFACE_FONTSET },
408 { &Mforeground, MFACE_FOREGROUND },
409 { &Mbackground, MFACE_BACKGROUND },
410 { &Mhline, MFACE_HLINE },
411 { &Mbox, MFACE_BOX },
412 { &Mvideomode, MFACE_VIDEOMODE },
413 { &Mhook_func, MFACE_HOOK_FUNC },
414 { &Mhook_arg, MFACE_HOOK_ARG },
415 { &Mratio, MFACE_RATIO },
418 for (i = 0; i < MFACE_PROPERTY_MAX; i++)
419 /* We add one to distinguish it from no-property. */
420 msymbol_put (*mface_prop_data[i].key, M_face_prop_index,
421 (void *) (mface_prop_data[i].index + 1));
424 mface__default = mface ();
425 mface__default->property[MFACE_WEIGHT] = msymbol ("medium");
426 mface__default->property[MFACE_STYLE] = msymbol ("r");
427 mface__default->property[MFACE_STRETCH] = msymbol ("normal");
428 mface__default->property[MFACE_SIZE] = (void *) 120;
429 mface__default->property[MFACE_FONTSET] = mfontset (NULL);
430 M17N_OBJECT_REF (mface__default->property[MFACE_FONTSET]);
431 /* mface__default->property[MFACE_FOREGROUND] =msymbol ("black"); */
432 /* mface__default->property[MFACE_BACKGROUND] =msymbol ("white"); */
434 mface_normal_video = mface ();
435 mface_normal_video->property[MFACE_VIDEOMODE] = (void *) Mnormal;
437 mface_reverse_video = mface ();
438 mface_reverse_video->property[MFACE_VIDEOMODE] = (void *) Mreverse;
441 MFaceHLineProp *hline_prop;
443 MSTRUCT_MALLOC (hline_prop, MERROR_FACE);
444 hline_prop->type = MFACE_HLINE_UNDER;
445 hline_prop->width = 1;
446 hline_prop->color = Mnil;
447 mface_underline = mface ();
448 mface_underline->property[MFACE_HLINE] = (void *) hline_prop;
451 mface_medium = mface ();
452 mface_medium->property[MFACE_WEIGHT] = (void *) msymbol ("medium");
453 mface_bold = mface ();
454 mface_bold->property[MFACE_WEIGHT] = (void *) msymbol ("bold");
455 mface_italic = mface ();
456 mface_italic->property[MFACE_STYLE] = (void *) msymbol ("i");
457 mface_bold_italic = mface_copy (mface_bold);
458 mface_bold_italic->property[MFACE_STYLE]
459 = mface_italic->property[MFACE_STYLE];
461 mface_xx_small = mface ();
462 mface_xx_small->property[MFACE_RATIO] = (void *) 50;
463 mface_x_small = mface ();
464 mface_x_small->property[MFACE_RATIO] = (void *) 67;
465 mface_small = mface ();
466 mface_small->property[MFACE_RATIO] = (void *) 75;
467 mface_normalsize = mface ();
468 mface_normalsize->property[MFACE_RATIO] = (void *) 100;
469 mface_large = mface ();
470 mface_large->property[MFACE_RATIO] = (void *) 120;
471 mface_x_large = mface ();
472 mface_x_large->property[MFACE_RATIO] = (void *) 150;
473 mface_xx_large = mface ();
474 mface_xx_large->property[MFACE_RATIO] = (void *) 200;
476 mface_black = mface ();
477 mface_black->property[MFACE_FOREGROUND] = (void *) msymbol ("black");
478 mface_white = mface ();
479 mface_white->property[MFACE_FOREGROUND] = (void *) msymbol ("white");
480 mface_red = mface ();
481 mface_red->property[MFACE_FOREGROUND] = (void *) msymbol ("red");
482 mface_green = mface ();
483 mface_green->property[MFACE_FOREGROUND] = (void *) msymbol ("green");
484 mface_blue = mface ();
485 mface_blue->property[MFACE_FOREGROUND] = (void *) msymbol ("blue");
486 mface_cyan = mface ();
487 mface_cyan->property[MFACE_FOREGROUND] = (void *) msymbol ("cyan");
488 mface_yellow = mface ();
489 mface_yellow->property[MFACE_FOREGROUND] = (void *) msymbol ("yellow");
490 mface_magenta = mface ();
491 mface_magenta->property[MFACE_FOREGROUND] = (void *) msymbol ("magenta");
493 work_gstring.glyphs = malloc (sizeof (MGlyph) * 2);
494 work_gstring.size = 2;
495 work_gstring.used = 0;
496 work_gstring.inc = 1;
503 M17N_OBJECT_UNREF (mface__default);
504 M17N_OBJECT_UNREF (mface_normal_video);
505 M17N_OBJECT_UNREF (mface_reverse_video);
506 M17N_OBJECT_UNREF (mface_underline);
507 M17N_OBJECT_UNREF (mface_medium);
508 M17N_OBJECT_UNREF (mface_bold);
509 M17N_OBJECT_UNREF (mface_italic);
510 M17N_OBJECT_UNREF (mface_bold_italic);
511 M17N_OBJECT_UNREF (mface_xx_small);
512 M17N_OBJECT_UNREF (mface_x_small);
513 M17N_OBJECT_UNREF (mface_small);
514 M17N_OBJECT_UNREF (mface_normalsize);
515 M17N_OBJECT_UNREF (mface_large);
516 M17N_OBJECT_UNREF (mface_x_large);
517 M17N_OBJECT_UNREF (mface_xx_large);
518 M17N_OBJECT_UNREF (mface_black);
519 M17N_OBJECT_UNREF (mface_white);
520 M17N_OBJECT_UNREF (mface_red);
521 M17N_OBJECT_UNREF (mface_green);
522 M17N_OBJECT_UNREF (mface_blue);
523 M17N_OBJECT_UNREF (mface_cyan);
524 M17N_OBJECT_UNREF (mface_yellow);
525 M17N_OBJECT_UNREF (mface_magenta);
526 free (work_gstring.glyphs);
528 mdebug__report_object ("Face", &face_table);
531 /** Return a realized face for ASCII characters from NUM number of
532 base faces pointed by FACES on the frame FRAME. */
535 mface__realize (MFrame *frame, MFace **faces, int num,
536 MSymbol language, MSymbol charset, int size)
538 MRealizedFace *rface;
539 MRealizedFont *rfont;
540 MFace merged_face = *(frame->face);
546 if (num == 0 && language == Mnil && charset == Mnil && frame->rface)
549 for (i = 0; i < MFACE_PROPERTY_MAX; i++)
550 for (j = num - 1; j >= 0; j--)
551 if (faces[j]->property[i])
553 merged_face.property[i] = faces[j]->property[i];
557 if (merged_face.property[MFACE_RATIO])
559 int font_size = (int) merged_face.property[MFACE_SIZE];
561 font_size *= (int) merged_face.property[MFACE_RATIO];
563 merged_face.property[MFACE_SIZE] = (void *) font_size;
566 plist = find_realized_face (frame, &merged_face, NULL);
569 rface = MPLIST_VAL (plist);
570 if (! rface->need_update)
571 return rface->ascii_rface;
573 while (! MPLIST_TAIL_P (plist))
575 if (((MRealizedFace *) MPLIST_VAL (plist))->ascii_rface == rface)
577 mface__free_realized ((MRealizedFace *) MPLIST_VAL (plist));
581 plist = MPLIST_NEXT (plist);
583 for (i = 0; i < num; i++)
585 plist = mplist_find_by_value (faces[j]->realized_face_list, rface);
589 mface__free_realized (rface);
592 MSTRUCT_CALLOC (rface, MERROR_FACE);
594 for (i = 0; i < num; i++)
596 MPlist *plist = faces[i]->realized_face_list;
599 faces[i]->realized_face_list = plist = mplist ();
600 mplist_push (plist, Mt, rface);
604 rface->frame = frame;
605 rface->face = merged_face;
606 rface->need_update = 0;
607 props = rface->face.property;
609 rface->rfontset = mfont__realize_fontset (frame,
610 (MFontset *) props[MFACE_FONTSET],
614 rfont = mfont__lookup_fontset (rface->rfontset, &g, &num,
615 msymbol ("latin"), language, Mnil,
620 rface->rfont = rfont;
622 work_gstring.glyphs[0] = g;
623 work_gstring.glyphs[0].rface = rface;
624 work_gstring.glyphs[1].code = MCHAR_INVALID_CODE;
625 work_gstring.glyphs[1].rface = rface;
626 mfont__get_metric (&work_gstring, 0, 2);
627 rface->space_width = work_gstring.glyphs[0].width;
628 rface->ascent = work_gstring.glyphs[1].ascent;
629 rface->descent = work_gstring.glyphs[1].descent;
634 rface->space_width = frame->space_width;
637 rface->hline = (MFaceHLineProp *) props[MFACE_HLINE];
638 rface->box = (MFaceBoxProp *) props[MFACE_BOX];
639 rface->ascii_rface = rface;
640 mwin__realize_face (rface);
642 mplist_push (frame->realized_face_list, Mt, rface);
646 MSTRUCT_CALLOC (rface->nofont_rface, MERROR_FACE);
647 *rface->nofont_rface = *rface;
648 rface->nofont_rface->rfont = NULL;
651 rface->nofont_rface = rface;
658 mface__for_chars (MSymbol script, MSymbol language, MSymbol charset,
659 MGlyph *from_g, MGlyph *to_g, int size)
661 MRealizedFace *rface;
662 MRealizedFont *rfont;
663 int num = to_g - from_g, i;
666 rfont = mfont__lookup_fontset (from_g->rface->rfontset, from_g, &num,
667 script, language, charset, size);
670 from_g->rface = from_g->rface->nofont_rface;
673 if (from_g->rface->ascii_rface->rfont == rfont)
674 rface = from_g->rface->ascii_rface;
677 plist = find_realized_face (from_g->rface->frame, &(from_g->rface->face),
680 rface = MPLIST_VAL (plist);
687 MSTRUCT_MALLOC (rface, MERROR_FACE);
688 *rface = *from_g->rface->ascii_rface;
689 rface->rfont = rfont;
690 work_gstring.glyphs[0].code = MCHAR_INVALID_CODE;
691 work_gstring.glyphs[0].rface = rface;
692 mfont__get_metric (&work_gstring, 0, 1);
693 rface->ascent = work_gstring.glyphs[0].ascent;
694 rface->descent = work_gstring.glyphs[0].descent;
695 mwin__realize_face (rface);
696 mplist_add (from_g->rface->frame->realized_face_list, Mt, rface);
699 for (i = 0; i < num; i++, from_g++)
700 from_g->rface = rface;
706 mface__free_realized (MRealizedFace *rface)
708 mwin__free_realized_face (rface);
709 if (rface == rface->ascii_rface)
711 if (! rface->nofont_rface)
714 free (rface->nofont_rface);
715 rface->nofont_rface = NULL;
721 #endif /* !FOR_DOXYGEN || DOXYGEN_INTERNAL_MODULE */
725 /*** @addtogroup m17nFace */
729 /***en @name Variables: Keys of face property */
730 /***ja @name ÊÑ¿ô: ¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼ */
735 @brief Key of a face property specifying foreground color.
737 The variable #Mforeground is used as a key of face property. The
738 property value must be a symbol whose name is a color name, or
741 #Mnil means that the face does not specify a foreground color.
742 Otherwise, the foreground of an M-text is drawn by the specified
746 @brief Á°·Ê¿§¤ò»ØÄꤹ¤ë¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
748 ÊÑ¿ô #Mforeground ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£
749 ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢¿§Ì¾¤ò̾Á°¤È¤·¤Æ»ý¤Ä¥·¥ó¥Ü¥ë¤« #Mnil ¤Ç¤¢¤ë¡£
751 #Mnil ¤Î¾ì¹ç¡¢Á°·Ê¿§¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð M-text ¤ÎÁ°·Ê¤Ï
752 »ØÄꤵ¤ì¤¿¿§¤Çɽ¼¨¤µ¤ì¤ë¡£ */
757 @brief Key of a face property specifying background color.
759 The variable #Mbackground is used as a key of face property. The
760 property value must be a symbol whose name is a color name, or
763 #Mnil means that the face does not specify a background color.
764 Otherwise, the background of an M-text is drawn by the specified
768 @brief ÇØ·Ê¿§¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
770 ÊÑ¿ô #Mbackground ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£
771 ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢¿§Ì¾¤ò̾Á°¤È¤·¤Æ»ý¤Ä¥·¥ó¥Ü¥ë¤« #Mnil ¤Ç¤¢¤ë¡£
773 #Mnil ¤Î¾ì¹ç¡¢ÇØ·Ê¿§¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð M-text ¤ÎÇطʤÏ
774 »ØÄꤵ¤ì¤¿¿§¤Çɽ¼¨¤µ¤ì¤ë¡£ */
779 @brief Key of a face property specifying video mode.
781 The variable #Mvideomode is used as a key of face property. The
782 property value must be #Mnormal, #Mreverse, or #Mnil.
784 #Mnormal means that an M-text is drawn in normal video mode
785 (i.e. the foreground is drawn by foreground color, the background
786 is drawn by background color).
788 #Mreverse means that an M-text is drawn in reverse video mode
789 (i.e. the foreground is drawn by background color, the background
790 is drawn by foreground color).
792 #Mnil means that the face does not specify a video mode. */
795 @brief ¥Ó¥Ç¥ª¥â¡¼¥É¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
797 ÊÑ¿ô #Mvideomode ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£
798 ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢#Mnormal, #Mreverse, #Mnil ¤Î¤¤¤º¤ì¤«¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
800 #Mnormal ¤Î¾ì¹ç¤Ï¡¢M-text ¤Ïɸ½à¤Î¥Ó¥Ç¥ª¥â¡¼¥É¡ÊÁ°·Ê¤òÁ°·Ê¿§¤Ç¡¢ÇØ
801 ·Ê¤òÇØ·Ê¿§¤Ç¡Ë¤Çɽ¼¨¤¹¤ë¡£
803 #Mreverse ¤Î¾ì¹ç¤Ï¥ê¥Ð¡¼¥¹¥Ó¥Ç¥ª¥â¡¼¥É¤Ç¡ÊÁ°·Ê¤òÇØ·Ê¿§¤Ç¡¢ÇطʤòÁ°
806 #Mnil ¤Î¾ì¹ç¤Ï¥Ó¥Ç¥ª¥â¡¼¥É¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
812 @brief Key of a face property specifying font size ratio.
814 The variable #Mratio is used as a key of face property. The value
815 RATIO must be an integer.
817 The value 0 means that the face does not specify a font size
818 ratio. Otherwise, an M-text is drawn by a font of size (FONTSIZE
819 * RATIO / 100) where FONTSIZE is a font size specified by the face
822 @brief ¥Õ¥©¥ó¥È¤Î¥µ¥¤¥º¤ÎÈæΨ¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
824 ÊÑ¿ô #Mratio ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃÍ RATIO
825 ¤ÏÀ°¿ôÃͤǤʤ¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
827 Ãͤ¬0¤Ê¤é¤Ð¡¢¥Õ¥©¥ó¥È¥µ¥¤¥º¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¡¢M-text
828 ¤Ï(FONTSIZE * RATIO / 100) ¤È¤¤¤¦¥µ¥¤¥º¤Î¥Õ¥©¥ó¥È¤Çɽ¼¨¤µ¤ì¤ë¡£¤³
829 ¤³¤Ç FONTSIZE ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼ #Msize ¤Ç»ØÄꤵ¤ì¤¿¥µ¥¤¥º¤Ç¤¢
835 @brief Key of a face property specifying horizontal line.
837 The variable #Mhline is used as a key of face property. The value
838 must be a pointer to an object of type #MFaceHLineProp, or @c
841 The value @c NULL means that the face does not specify this
842 property. Otherwise, an M-text is drawn with a horizontal line by
843 a way specified by the object that the value points to. */
846 @brief ¿åÊ¿Àþ¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
848 ÊÑ¿ô #Mhline ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃͤÏ
849 #MFaceHLineProp ·¿¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤« @c NULL ¤Ç¤Ê¤¯¤Æ¤Ï¤Ê
852 Ãͤ¬ @c NULL ¤Ê¤é¤Ð¡¢¤³¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤Ê¤±¤ì¤ÐÃÍ
853 ¤¬»Ø¤¹¥ª¥Ö¥¸¥§¥¯¥È¤Ë»ØÄꤵ¤ì¤¿¤è¤¦¤Ë¿åÊ¿Àþ¤òÉղä·¤Æ M-text ¤òɽ¼¨
859 @brief Key of a face property specifying box.
861 The variable #Mbox is used as a key of face property. The value
862 must be a pointer to an object of type #MFaceBoxProp, or @c NULL.
864 The value @c NULL means that the face does not specify a box.
865 Otherwise, an M-text is drawn with a surrounding box by a way
866 specified by the object that the value points to. */
869 @brief °Ï¤ßÏȤò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
871 ÊÑ¿ô #Mbox ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃͤÏ
872 #MFaceBoxProp ·¿¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤« @c NULL ¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é
875 Ãͤ¬ @c NULL ¤Ê¤é¤Ð¡¢¤³¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤Ê¤±¤ì¤ÐÃÍ
876 ¤¬»Ø¤¹¥ª¥Ö¥¸¥§¥¯¥È¤Ë»ØÄꤵ¤ì¤¿¤è¤¦¤Ë°Ï¤ßÏȤòÉղä·¤Æ M-text ¤òɽ¼¨
882 @brief Key of a face property specifying fontset.
884 The variable #Mfontset is used as a key of face property. The
885 value must be a pointer to an object of type #Mfontset, or @c
888 The value @c NULL means that the face does not specify a fontset.
889 Otherwise, an M-text is drawn with a font selected from what
890 specified in the fontset. */
893 @brief ¥Õ¥©¥ó¥È¥»¥Ã¥È¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
895 ÊÑ¿ô #Mfontset ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃͤÏ
896 #Mfontset ·¿¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤« @c NULL ¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
898 Ãͤ¬ @c NULL ¤Ê¤é¤Ð¡¢¥Õ¥©¥ó¥È¥»¥Ã¥È¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤Ê¤±¤ì¤ÐÃÍ
899 ¤¬»Ø¤¹¥ª¥Ö¥¸¥§¥¯¥È¤Ë»ØÄꤵ¤ì¤¿¥Õ¥©¥ó¥È¥»¥Ã¥È¤«¤éÁª¤ó¤À¥Õ¥©¥ó¥È¤Ç
900 M-text ¤òɽ¼¨¤¹¤ë¡£*/
905 @brief Key of a face property specifying hook.
907 The variable #Mhook_func is used as a key of face property. The
908 value must be a function of type #MFaceHookFunc, or @c NULL.
910 The value @c NULL means that the face does not specify a hook.
911 Otherwise, the specified function is called before the face is
914 @brief ¥Õ¥Ã¥¯¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
916 ÊÑ¿ô #Mhook_func ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃͤÏ
917 #MFaceHookFunc ·¿¤Î´Ø¿ô¤« @c NULL ¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
919 Ãͤ¬ @c NULL ¤Ê¤é¤Ð¡¢¥Õ¥Ã¥¯¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¥Õ¥§¡¼¥¹¤ò
920 ¼Â¸½¤¹¤ëÁ°¤Ë»ØÄꤷ¤¿´Ø¿ô¤¬¸Æ¤Ð¤ì¤ë¡£ */
924 @brief Key of a face property specifying argument of hook.
926 The variable #Mhook_arg is used as a key of face property. The
927 value can be anything that is passed a hook function specified by
928 the face property #Mhook_func. */
930 @brief ¥Õ¥Ã¥¯¤Î°ú¿ô¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¡¼¤Î¥¡¼.
932 ÊÑ¿ô #Mhook_arg ¤Ï¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£ÃͤÏ
933 ²¿¤Ç¤â¤è¤¯¡¢¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£ #Mhook_func ¤Ç»ØÄꤵ¤ì¤ë´Ø¿ô¤ËÅϤµ
940 /*** @ingroup m17nFace */
941 /***en @name Variables: Possible values of #Mvideomode property of face */
942 /***ja @name ÊÑ¿ô¡§ ¥Õ¥§¡¼¥¹¤Î #Mvideomode ¥×¥í¥Ñ¥Æ¥£¤Î²Äǽ¤ÊÃÍ */
947 See the documentation of the variable #Mvideomode. */
949 ÊÑ¿ô #Mvideomode ¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£ */
955 /*** @ingroup m17nFace */
956 /***en @name Variables: Predefined faces */
957 /***ja @name ÊÑ¿ô: ÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹ */
962 @brief Normal video face.
964 The variable #mface_normal_video points to a face that has the
965 #Mvideomode property with value #Mnormal. The other properties
966 are not specified. An M-text drawn with this face appear normal
967 colors (i.e. the foreground is drawn by foreground color, and
968 background is drawn by background color). */
970 @brief ɸ½à¥Ó¥Ç¥ª¥Õ¥§¡¼¥¹.
972 ÊÑ¿ô #mface_normal_video ¤Ï #Mvideomode ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ #Mnormal
973 ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
974 ¤³¤Î¥Õ¥§¡¼¥¹¤Çɽ¼¨¤µ¤ì¤ëM-text ¤Ïɸ½à¤Î¿§ (¤¹¤Ê¤ï¤ÁÁ°·Ê¤ÏÁ°·Ê¿§¡¢
975 ÇطʤÏÇØ·Ê¿§¡Ë¤ÇÉÁ¤«¤ì¤ë¡£ */
977 MFace *mface_normal_video;
980 @brief Reverse video face.
982 The variable #mface_reverse_video points to a face that has the
983 #Mvideomode property with value #Mreverse. The other properties
984 are not specified. An M-text drawn with this face appear in
985 reversed colors (i.e. the foreground is drawn by background
986 color, and background is drawn by foreground color). */
988 @brief ¥ê¥Ð¡¼¥¹¥Ó¥Ç¥ª¥Õ¥§¡¼¥¹.
990 ÊÑ¿ô #mface_reverse_video ¤Ï #Mvideomode ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬
991 #Mreverse ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄê
992 ¤µ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤Çɽ¼¨¤µ¤ì¤ëM-text ¤ÏÁ°·Ê¿§¤ÈÇØ·Ê¿§¤¬Æþ¤ìÂØ
993 ¤ï¤Ã¤Æ (¤¹¤Ê¤ï¤ÁÁ°·Ê¤ÏÇØ·Ê¿§¡¢ÇطʤÏÁ°·Ê¿§¡ËÉÁ¤«¤ì¤ë¡£ */
995 MFace *mface_reverse_video;
998 @brief Underline face.
1000 The variable #mface_underline points to a face that has the
1001 #Mhline property with value a pointer to an object of type
1002 #MFaceHLineProp. The members of the object are as follows:
1007 type MFACE_HLINE_UNDER
1012 The other properties are not specified. An M-text that has this
1013 face is drawn with an underline. */
1015 @brief ²¼Àþ¥Õ¥§¡¼¥¹.
1017 ÊÑ¿ô #mface_underline ¤Ï #Mhline ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ #MFaceHLineProp
1018 ·¿¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£¥ª¥Ö
1019 ¥¸¥§¥¯¥È¤Î¥á¥ó¥Ð¤Ï°Ê²¼¤ÎÄ̤ꡣ
1024 type MFACE_HLINE_UNDER
1029 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ï²¼ÀþÉÕ¤
1032 MFace *mface_underline;
1037 The variable #mface_medium points to a face that has the #Mweight
1038 property with value a symbol of name "medium". The other
1039 properties are not specified. An M-text that has this face is
1040 drawn with a font of medium weight. */
1042 @brief ¥ß¥Ç¥£¥¢¥à¥Õ¥§¡¼¥¹.
1044 ÊÑ¿ô #mface_medium ¤Ï #Mweight ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "medium" ¤È¤¤¤¦Ì¾
1045 Á°¤ò¤â¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í
1046 ¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ï¡¢¥ß¥Ç¥£¥¢¥à¥¦¥§
1047 ¥¤¥È¤Î¥Õ¥©¥ó¥È¤Çɽ¼¨¤µ¤ì¤ë¡£ */
1048 MFace *mface_medium;
1053 The variable #mface_bold points to a face that has the #Mweight
1054 property with value a symbol of name "bold". The other properties
1055 are not specified. An M-text that has this face is drawn with a
1056 font of bold weight. */
1059 @brief ¥Ü¡¼¥ë¥É¥Õ¥§¡¼¥¹.
1061 ÊÑ¿ô #mface_bold ¤Ï #Mweight ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "bold" ¤È¤¤¤¦Ì¾Á°¤ò
1062 ¤â¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£
1063 ¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ï¡¢¥Ü¡¼¥ë¥É¤Î¥Õ¥©¥ó¥È¤Ç
1072 The variable #mface_italic points to a face that has the #Mstyle
1073 property with value a symbol of name "italic". The other
1074 properties are not specified. An M-text that has this face is
1075 drawn with a font of italic style. */
1078 @brief ¥¤¥¿¥ê¥Ã¥¯¥Õ¥§¡¼¥¹.
1080 ÊÑ¿ô #mface_italic ¤Ï #Mstyle ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "italic" ¤È¤¤¤¦Ì¾Á°
1081 ¤ò¤â¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ
1082 ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ï¡¢¥¤¥¿¥ê¥Ã¥¯ÂΤÇɽ
1086 MFace *mface_italic;
1089 @brief Bold italic face.
1091 The variable #mface_bold_italic points to a face that has the
1092 #Mweight property with value a symbol of name "bold", and #Mstyle
1093 property with value a symbol of name "italic". The other
1094 properties are not specified. An M-text that has this face is
1095 drawn with a font of bold weight and italic style. */
1098 @brief ¥Ü¡¼¥ë¥É¥¤¥¿¥ê¥Ã¥¯¥Õ¥§¡¼¥¹.
1100 ÊÑ¿ô #mface_bold_italic ¤Ï¡¢#Mweight ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "bold" ¤È¤¤
1101 ¤¦Ì¾Á°¤ò¤â¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ê¡¢¤«¤Ä #Mstyle ¥×¥í¥Ñ¥Æ¥¤¤ÎÃͤ¬ "italic"
1102 ¤È¤¤¤¦Ì¾Á°¤ò¤â¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
1103 ¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤Ï¡¢¥Ü¡¼¥ë
1104 ¥É¥¤¥¿¥ê¥Ã¥¯ÂΤÇɽ¼¨¤µ¤ì¤ë¡£
1107 MFace *mface_bold_italic;
1110 @brief Smallest face.
1112 The variable #mface_xx_small points to a face that has the #Mratio
1113 property with value 50. The other properties are not specified.
1114 An M-text that has this face is drawn with a font whose size is
1115 50% of a normal font. */
1118 @brief ºÇ¾®¤Î¥Õ¥§¡¼¥¹.
1120 ÊÑ¿ô #mface_xx_small ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 50 ¤Ç¤¢¤ë¥Õ¥§¡¼
1121 ¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹
1122 ¤ò»ý¤Ä M-text ¤Ïɸ½à¤Î 50% ¤ÎÂ礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1125 MFace *mface_xx_small;
1128 @brief Smaller face.
1130 The variable #mface_x_small points to a face that has the #Mratio
1131 property with value 66. The other properties are not specified.
1132 An M-text that has this face is drawn with a font whose size is
1133 66% of a normal font. */
1136 @brief ¤â¤Ã¤È¾®¤µ¤¤¥Õ¥§¡¼¥¹.
1138 ÊÑ¿ô #mface_x_small ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 66 ¤Ç¤¢¤ë¥Õ¥§¡¼
1139 ¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹
1140 ¤ò»ý¤Ä M-text ¤Ïɸ½à¤Î 66% ¤ÎÂ礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1143 MFace *mface_x_small;
1148 The variable #mface_x_small points to a face that has the #Mratio
1149 property with value 75. The other properties are not specified.
1150 An M-text that has this face is drawn with a font whose size is
1151 75% of a normal font. */
1154 @brief ¾®¤µ¤¤¥Õ¥§¡¼¥¹.
1156 ÊÑ¿ô #mface_small ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 75 ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¤ò
1157 »Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý
1158 ¤Ä M-text ¤Ïɸ½à¤Î 75% ¤ÎÂ礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1164 @brief Normalsize face.
1166 The variable #mface_normalsize points to a face that has the
1167 #Mratio property with value 100. The other properties are not
1168 specified. An M-text that has this face is drawn with a font
1169 whose size is the same as a normal font. */
1172 @brief ɸ½à¤ÎÂ礤µ¤Î¥Õ¥§¡¼¥¹.
1174 ÊÑ¿ô #mface_normalsize ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 100 ¤Ç¤¢¤ë¥Õ¥§¡¼
1175 ¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹
1176 ¤ò»ý¤Ä M-text ¤Ïɸ½à¤ÈƱ¤¸Â礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1179 MFace *mface_normalsize;
1184 The variable #mface_large points to a face that has the #Mratio
1185 property with value 120. The other properties are not specified.
1186 An M-text that has this face is drawn with a font whose size is
1187 120% of a normal font. */
1190 @brief Â礤¤¥Õ¥§¡¼¥¹.
1192 ÊÑ¿ô #mface_large ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 120 ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹
1193 ¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò
1194 »ý¤Ä M-text ¤Ïɸ½à¤Î 120% ¤ÎÂ礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1202 The variable #mface_x_large points to a face that has the #Mratio
1203 property with value 150. The other properties are not specified.
1204 An M-text that has this face is drawn with a font whose size is
1205 150% of a normal font. */
1208 @brief ¤â¤Ã¤ÈÂ礤¤¥Õ¥§¡¼¥¹.
1210 ÊÑ¿ô #mface_x_large ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 150 ¤Ç¤¢¤ë¥Õ¥§¡¼
1211 ¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹
1212 ¤ò»ý¤Ä M-text ¤Ïɸ½à¤Î 150% ¤ÎÂ礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1215 MFace *mface_x_large;
1218 @brief Largest face.
1220 The variable #mface_xx_large points to a face that has the #Mratio
1221 property with value 200. The other properties are not specified.
1222 An M-text that has this face is drawn with a font whose size is
1223 200% of a normal font. */
1226 @brief ºÇÂç¤Î¥Õ¥§¡¼¥¹.
1228 ÊÑ¿ô #mface_xx_large ¤Ï¡¢#Mratio ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤ¬ 200 ¤Ç¤¢¤ë¥Õ¥§¡¼
1229 ¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹
1230 ¤ò»ý¤Ä M-text ¤Ïɸ½à¤Î 200% ¤ÎÂ礤µ¤Î¥Õ¥©¥ó¥È¤òÍѤ¤¤Æɽ¼¨¤µ¤ì¤ë¡£
1233 MFace *mface_xx_large;
1238 The variable #mface_black points to a face that has the
1239 #Mforeground property with value a symbol of name "black". The
1240 other properties are not specified. An M-text that has this face
1241 is drawn with black foreground. */
1246 ÊÑ¿ô #mface_black ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "black" ¤È
1247 ¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×
1248 ¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤ÏÁ°·Ê¿§¤ò¹õ¤È¤·
1256 The variable #mface_white points to a face that has the
1257 #Mforeground property with value a symbol of name "white". The
1258 other properties are not specified. An M-text that has this face
1259 is drawn with white foreground. */
1264 ÊÑ¿ô #mface_white ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "white" ¤È
1265 ¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×
1266 ¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤ÏÁ°·Ê¿§¤òÇò¤È¤·
1274 The variable #mface_red points to a face that has the
1275 #Mforeground property with value a symbol of name "red". The
1276 other properties are not specified. An M-text that has this face
1277 is drawn with red foreground. */
1282 ÊÑ¿ô #mface_red ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "red" ¤È¤¤¤¦
1283 ̾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ
1284 ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤ÏÁ°·Ê¿§¤òÀ֤Ȥ·¤Æɽ
1292 The variable #mface_green points to a face that has the
1293 #Mforeground property with value a symbol of name "green". The
1294 other properties are not specified. An M-text that has this face
1295 is drawn with green foreground. */
1300 ÊÑ¿ô #mface_green ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "green" ¤È
1301 ¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×
1302 ¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤ÏÁ°·Ê¿§¤òÎФȤ·
1310 The variable #mface_blue points to a face that has the
1311 #Mforeground property with value a symbol of name "blue". The
1312 other properties are not specified. An M-text that has this face
1313 is drawn with blue foreground. */
1318 ÊÑ¿ô #mface_blue ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "blue" ¤È¤¤
1319 ¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í
1320 ¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤ÏÁ°·Ê¿§¤òÀĤȤ·¤Æ
1328 The variable #mface_cyan points to a face that has the
1329 #Mforeground property with value a symbol of name "cyan". The
1330 other properties are not specified. An M-text that has this face
1331 is drawn with cyan foreground. */
1334 @brief ¥·¥¢¥ó¥Õ¥§¡¼¥¹.
1336 ÊÑ¿ô #mface_cyan ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "cyan" ¤È¤¤
1337 ¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î¥×¥í
1338 ¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤ÏÁ°·Ê¿§¤ò¥·¥¢¥ó¤È
1346 The variable #mface_yellow points to a face that has the
1347 #Mforeground property with value a symbol of name "yellow". The
1348 other properties are not specified. An M-text that has this face
1349 is drawn with yellow foreground. */
1354 ÊÑ¿ô #mface_yellow ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ "yellow"
1355 ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£Â¾¤Î
1356 ¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤ÏÁ°·Ê¿§¤ò²«¿§
1357 ¤È¤·¤Æɽ¼¨¤µ¤ì¤ë¡£ */
1359 MFace *mface_yellow;
1362 @brief Magenta face.
1364 The variable #mface_magenta points to a face that has the
1365 #Mforeground property with value a symbol of name "magenta". The
1366 other properties are not specified. An M-text that has this face
1367 is drawn with magenta foreground. */
1370 @brief ¥Þ¥¼¥ó¥¿¥Õ¥§¡¼¥¹.
1372 ÊÑ¿ô #mface_magenta ¤Ï¡¢#Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ
1373 "magenta" ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤ò»ý¤Ä¤è¤¦¤Ê¥Õ¥§¡¼¥¹¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Ç
1374 ¤¢¤ë¡£Â¾¤Î¥×¥í¥Ñ¥Æ¥£¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»ý¤Ä M-text ¤ÏÁ°
1375 ·Ê¿§¤ò¥Þ¥¼¥ó¥¿¤È¤·¤Æɽ¼¨¤µ¤ì¤ë¡£ */
1377 MFace *mface_magenta;
1382 /***en @name Variables: The other symbols for face handling. */
1383 /***ja @name ÊÑ¿ô: ¥Õ¥§¡¼¥¹¤ò¼è¤ê°·¤¦¤¿¤á¤Î¤½¤Î¾¤Î¥·¥ó¥Ü¥ë */
1388 @brief Key of a text property specifying a face.
1390 The variable #Mface is a symbol of name <tt>"face"</tt>. A text
1391 property whose key is
1392 this symbol must have a pointer to an object
1394 . This is a managing key. */
1397 @brief ¥Õ¥§¡¼¥¹¤ò»ØÄꤹ¤ë¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼.
1399 ÊÑ¿ô #Mface ¤Ï <tt>"face"</tt> ¤È¤¤¤¦Ì¾Á°¤ò»ý¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¡£¤³
1400 ¤Î¥·¥ó¥Ü¥ë¤ò¥¡¼¤È¤¹¤ë¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Ï¡¢#MFace ·¿¤Î¥ª¥Ö¥¸¥§¥¯
1401 ¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£¤³¤ì¤Ï´ÉÍý¥¡¼¤Ç¤¢¤ë¡£ */
1409 @brief Create a new face.
1411 The mface () function creates a new face object that specifies no
1415 This function returns a pointer to the created face. */
1418 @brief ¿·¤·¤¤¥Õ¥§¡¼¥¹¤ò¤Ä¤¯¤ë.
1420 ´Ø¿ô mface () ¤Ï¥×¥í¥Ñ¥Æ¥£¤ò°ìÀÚ»ý¤¿¤Ê¤¤¿·¤·¤¤¥Õ¥§¡¼¥¹¥ª¥Ö¥¸¥§¥¯¥È
1424 ¤³¤Î´Ø¿ô¤Ïºî¤Ã¤¿¥Õ¥§¡¼¥¹¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ */
1431 M17N_OBJECT (face, free_face, MERROR_FACE);
1432 M17N_OBJECT_REGISTER (face_table, face);
1439 @brief Make a copy of a face.
1441 The mface_copy () function makes a copy of $FACE and returns a
1442 pointer to the created copy. */
1445 @brief ¥Õ¥§¡¼¥¹¤Î¥³¥Ô¡¼¤òºî¤ë.
1447 ´Ø¿ô mface_copy () ¤Ï¥Õ¥§¡¼¥¹ $FACE ¤Î¥³¥Ô¡¼¤òºî¤ê¡¢¤½¤Î¥³¥Ô¡¼¤Ø¤Î
1451 mface_copy (MFace *face)
1455 MSTRUCT_CALLOC (copy, MERROR_FACE);
1457 copy->control.ref_count = 1;
1458 M17N_OBJECT_REGISTER (face_table, copy);
1459 if (copy->property[MFACE_FONTSET])
1460 M17N_OBJECT_REF (copy->property[MFACE_FONTSET]);
1461 if (copy->property[MFACE_HLINE])
1463 MFaceHLineProp *val;
1465 MSTRUCT_MALLOC (val, MERROR_FACE);
1466 *val = *((MFaceHLineProp *) copy->property[MFACE_HLINE]);
1467 copy->property[MFACE_HLINE] = val;
1469 if (copy->property[MFACE_BOX])
1473 MSTRUCT_MALLOC (val, MERROR_FACE);
1474 *val = *((MFaceBoxProp *) copy->property[MFACE_BOX]);
1475 copy->property[MFACE_BOX] = val;
1485 The mface_merge () functions merges the properties of face $SRC
1489 This function returns $DST. */
1492 @brief ¥Õ¥§¡¼¥¹¤òÅý¹ç¤¹¤ë.
1494 ´Ø¿ô mface_merge () ¤Ï¡¢¥Õ¥§¡¼¥¹ $SRC ¤Î¥×¥í¥Ñ¥Æ¥£¤ò¥Õ¥§¡¼¥¹ $DST
1498 ¤³¤Î´Ø¿ô¤Ï $DST ¤òÊÖ¤¹¡£ */
1501 mface_merge (MFace *dst, MFace *src)
1505 for (i = 0; i < MFACE_PROPERTY_MAX; i++)
1506 if (src->property[i])
1508 dst->property[i] = src->property[i];
1509 if (i == MFACE_FONTSET)
1510 M17N_OBJECT_REF (dst->property[i]);
1511 else if (i == MFACE_HLINE)
1513 MFaceHLineProp *val;
1515 MSTRUCT_MALLOC (val, MERROR_FACE);
1516 *val = *((MFaceHLineProp *) dst->property[MFACE_HLINE]);
1517 dst->property[MFACE_HLINE] = val;
1519 else if (i == MFACE_BOX)
1523 MSTRUCT_MALLOC (val, MERROR_FACE);
1524 *val = *((MFaceBoxProp *) dst->property[MFACE_BOX]);
1525 dst->property[MFACE_BOX] = val;
1534 @brief Make a face from a font.
1536 The mface_from_font () function return a newly created face while
1537 reflecting the properties of $FONT in its properties. */
1540 @brief ¥Õ¥©¥ó¥È¤«¤é¥Õ¥§¡¼¥¹¤òºî¤ë.
1542 ´Ø¿ô mface_from_font () ¤Ï¥Õ¥©¥ó¥È $FONT ¤Î¥×¥í¥Ñ¥Æ¥£¤ò¥×¥í¥Ñ¥Æ¥£
1543 ¤È¤·¤Æ»ý¤Ä¿·¤·¤¤¥Õ¥§¡¼¥¹¤òºî¤ê¡¢¤½¤ì¤òÊÖ¤¹¡£ */
1546 mface_from_font (MFont *font)
1548 MFace *face = mface ();
1550 face->property[MFACE_FOUNDRY] = mfont_get_prop (font, Mfoundry);
1551 face->property[MFACE_FAMILY] = mfont_get_prop (font, Mfamily);
1552 face->property[MFACE_WEIGHT] = mfont_get_prop (font, Mweight);
1553 face->property[MFACE_STYLE] = mfont_get_prop (font, Mstyle);
1554 face->property[MFACE_STRETCH] = mfont_get_prop (font, Mstretch);
1555 face->property[MFACE_ADSTYLE] = mfont_get_prop (font, Madstyle);
1556 face->property[MFACE_SIZE] = mfont_get_prop (font, Msize);
1563 @brief Get the value of a face property.
1565 The mface_get_prop () function returns the value of the face
1566 property whose key is $KEY in face $FACE. $KEY must be one of the
1569 #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
1570 #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
1571 #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg
1574 The actual type of the returned value depends of $KEY. See
1575 documentation of the above keys. If an error is detected, it
1576 returns @c NULL and assigns an error code to the external variable
1580 @brief ¥Õ¥§¡¼¥¹¤Î¥×¥í¥Ñ¥Æ¥£¤ÎÃͤòÆÀ¤ë.
1582 ´Ø¿ô mface_get_prop () ¤Ï¡¢¥Õ¥§¡¼¥¹ $FACE ¤¬»ý¤Ä¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£
1583 ¤ÎÆâ¡¢¥¡¼¤¬ $KEY ¤Ç¤¢¤ë¤â¤Î¤ÎÃͤòÊÖ¤¹¡£$KEY ¤Ï²¼µ¤Î¤¤¤º¤ì¤«¤Ç¤Ê
1586 #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
1587 #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
1588 #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg
1591 Ìá¤êÃͤη¿¤Ï $KEY ¤Ë°Í¸¤¹¤ë¡£¾åµ¤Î¥¡¼¤ÎÀâÌÀ¤ò»²¾È¤¹¤ë¤³
1592 ¤È¡£¥¨¥é¡¼¤¬¸¡½Ð¤µ¤ì¤¿¾ì¹ç¤Ï @c NULL ¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô #merror_code
1593 ¤Ë¥¨¥é¡¼¥³¡¼¥É¤òÀßÄꤹ¤ë¡£ */
1603 mface_get_prop (MFace *face, MSymbol key)
1605 int index = (int) msymbol_get (key, M_face_prop_index) - 1;
1608 MERROR (MERROR_FACE, NULL);
1609 return face->property[index];
1615 @brief Set a value of a face property.
1617 The mface_put_prop () function assigns $VAL to the property whose
1618 key is $KEY in face $FACE. $KEY must be one the followings:
1620 #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
1621 #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
1622 #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg
1624 Among them, font related properties (#Mfoundry through #Msize) are
1625 used as the default values when a font in the fontset of $FACE
1626 does not specify those values.
1628 The actual type of the returned value depends of $KEY. See
1629 documentation of the above keys.
1632 If the operation was successful, mface_put_prop () returns 0.
1633 Otherwise it returns -1 and assigns an error code to the external
1634 variable #merror_code. */
1637 @brief ¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤòÀßÄꤹ¤ë.
1639 ´Ø¿ô mface_put_prop () ¤Ï¡¢¥Õ¥§¡¼¥¹ $FACE Æâ¤Ç¥¡¼¤¬ $KEY ¤Ç¤¢¤ë¥×
1640 ¥í¥Ñ¥Æ¥£¤ÎÃͤò $VAL ¤ËÀßÄꤹ¤ë¡£$KEY ¤Ï°Ê²¼¤Î¤¤¤º¤ì¤«¤Ç¤Ê¤¯¤Æ¤Ï¤Ê
1643 #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
1644 #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
1645 #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg.
1647 ¤³¤ì¤é¤Î¤¦¤Á¤Î¡¢¥Õ¥©¥ó¥È´ØÏ¢¤Î¥×¥í¥Ñ¥Æ¥£ (#Mfamily ¤«¤é #Msize
1648 ¤Þ¤Ç) ¤Ï¡¢¥Õ¥§¡¼¥¹¤Î¥Õ¥©¥ó¥È¥»¥Ã¥ÈÃæ¤Î¥Õ¥©¥ó¥È¤Ë´Ø¤¹¤ë¥Ç¥Õ¥©¥ë¥ÈÃÍ
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)
1680 MFaceHLineProp *newval;
1682 MSTRUCT_MALLOC (newval, MERROR_FACE);
1683 *newval = *((MFaceHLineProp *) val);
1685 if (face->property[index])
1686 free (face->property[index]);
1688 else if (key == Mbox)
1690 MFaceBoxProp *newval;
1692 MSTRUCT_MALLOC (newval, MERROR_FACE);
1693 *newval = *((MFaceBoxProp *) val);
1695 if (face->property[index])
1696 free (face->property[index]);
1698 face->property[index] = val;
1699 if (face->realized_face_list)
1700 MPLIST_DO (plist, face->realized_face_list)
1701 ((MRealizedFace *) MPLIST_VAL (plist))->need_update = 1;
1709 @brief Update a face.
1711 The mface_update () function update face $FACE on frame $FRAME by
1712 calling a hook function of $FACE (if any). */
1715 @brief ¥Õ¥§¡¼¥¹¤ò¹¹¿·¤¹¤ë.
1717 ´Ø¿ô mface_update () ¤Ï¥Õ¥ì¡¼¥à $FRAME ¤Î¥Õ¥§¡¼¥¹ $FACE ¤ò $FACE
1718 ¤Î¥Õ¥Ã¥¯´Ø¿ô¤ò¡Ê¤¢¤ì¤Ð¡Ë¸Æ¤ó¤Ç¹¹¿·¤¹¤ë¡£ */
1721 mface_update (MFrame *frame, MFace *face)
1723 MFaceHookFunc func = (MFaceHookFunc) face->property[MFACE_HOOK_FUNC];
1725 MRealizedFace *rface;
1729 MPLIST_DO (rface_list, frame->realized_face_list)
1731 rface = MPLIST_VAL (rface_list);
1732 if ((MFaceHookFunc) rface->face.property[MFACE_HOOK_FUNC] == func)
1733 (func) (&(rface->face), rface->face.property[MFACE_HOOK_ARG],
1743 /*** @addtogroup m17nDebug */
1750 The mdebug_dump_face () function prints face $FACE in a human readable
1751 way to the stderr. $INDENT specifies how many columns to indent
1752 the lines but the first one.
1755 This function returns $FACE. */
1758 @brief ¥Õ¥§¡¼¥¹¤ò¥À¥ó¥×¤¹¤ë.
1760 ´Ø¿ô mdebug_dump_face () ¤Ï¥Õ¥§¡¼¥¹ $FACE ¤ò stderr ¤Ë¿Í´Ö¤Ë²ÄÆɤÊ
1761 ·Á¤Ç°õºþ¤¹¤ë¡£ $INDENT ¤Ï£²¹ÔÌܰʹߤΥ¤¥ó¥Ç¥ó¥È¤ò»ØÄꤹ¤ë¡£
1764 ¤³¤Î´Ø¿ô¤Ï $FACE ¤òÊÖ¤¹¡£ */
1767 mdebug_dump_face (MFace *face, int indent)
1769 char *prefix = (char *) alloca (indent + 1);
1772 memset (prefix, 32, indent);
1774 mfont__set_spec_from_face (&spec, face);
1775 fprintf (stderr, "(face font:\"");
1776 mdebug_dump_font (&spec);
1777 fprintf (stderr, "\"\n %s fore:%s back:%s", prefix,
1778 msymbol_name ((MSymbol) face->property[MFACE_FOREGROUND]),
1779 msymbol_name ((MSymbol) face->property[MFACE_BACKGROUND]));
1780 if (face->property[MFACE_FONTSET])
1781 fprintf (stderr, " non-default-fontset");
1782 fprintf (stderr, " hline:%s", face->property[MFACE_HLINE] ? "yes" : "no");
1783 fprintf (stderr, " box:%s)", face->property[MFACE_BOX] ? "yes" : "no");