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 ¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë¡£¥¡¼¤¬ #Mfontset ¤Ê¤é¤ÐÃͤϥե©¥ó¥È¥»¥Ã¥È¤Ø¤Î
64 ¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£¥¡¼¤¬ #Msize ¤Ê¤é¤ÐÃͤÏÀ°¿ô¤Ç¤¢¤ë¡£¥¡¼¤¬¤½¤ì°Ê
65 ³°¤Ê¤é¤ÐÃͤϥ·¥ó¥Ü¥ë¤Ç¤¢¤ë¡£¡Ö¥Õ¥§¡¼¥¹ F ¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Î¤¦
66 ¤Á¥¡¼¤¬ @c Mxxx ¤Ç¤¢¤ë¤â¤Î¡×¤Î¤³¤È¤ò´Êñ¤Ë¡ÖF ¤Î xxx ¥×¥í¥Ñ¥Æ¥£¡×
69 Foreground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢Á°·Ê¿§¤òɽ¤ï¤¹¡£
71 Background ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢ÇØ·Ê¿§¤òɽ¤ï¤¹¡£
73 Reverse ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢Á°·Ê¿§¤ÈÇØ·Ê¿§¤òÆþ¤ìÂؤ¨¤ë¤³¤È¤òɽ¤ï¤¹¡£
75 Underline ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢²¼Àþ¤ò°ú¤¯¤«Èݤ«¤òɽ¤ï¤¹¡£
77 Box ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢°Ï¤ßÏȤòɽ¼¨¤¹¤ë¤«Èݤ«¤òɽ¤ï¤¹¡£
79 Fontset ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢»ÈÍѤ¹¤ë¥Õ¥©¥ó¥È¥»¥Ã¥È¤òɽ¤ï¤¹¡£
81 Family ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢»ÈÍѤ¹¤ë¥Õ¥©¥ó¥È¤Î family ¥×¥í¥Ñ¥Æ¥£¤Î¥Ç
84 Weight ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢»ÈÍѤ¹¤ë¥Õ¥©¥ó¥È¤Î weight ¥×¥í¥Ñ¥Æ¥£¤Î¥Ç
87 Style ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢»ÈÍѤ¹¤ë¥Õ¥©¥ó¥È¤Î style ¥×¥í¥Ñ¥Æ¥£¤Î¥Ç¥Õ¥©
90 Stretch ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢»ÈÍѤ¹¤ë¥Õ¥©¥ó¥È¤Î stretch ¥×¥í¥Ñ¥Æ¥£¤Î
91 ¥Ç¥Õ¥©¥ë¥ÈÃͤòɽ¤ï¤¹¡£
93 Adstyle ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢»ÈÍѤ¹¤ë¥Õ¥©¥ó¥È¤Î adstyle ¥×¥í¥Ñ¥Æ¥£¤Î
94 ¥Ç¥Õ¥©¥ë¥ÈÃͤòɽ¤ï¤¹¡£
96 Size ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢»ÈÍѤ¹¤ë¥Õ¥©¥ó¥È¤Î size ¥×¥í¥Ñ¥Æ¥£¤Î¥Ç¥Õ¥©
99 M-text ¤Îɽ¼¨¤Ë´Ø¤¹¤ë m17n-win API ¤Î´Ø¿ô¤Ï¡¢¤Þ¤ººÇ½é¤Ë¤½¤Î M-text
100 ¤«¤é¥¡¼¤¬¥·¥ó¥Ü¥ë #Mface ¤Ç¤¢¤ë¤è¤¦¤Ê¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤òµá¤á¡¢
101 ¼¡¤Ë¤½¤ÎÃͤ˽¾¤Ã¤Æ M-text ¤òɽ¼¨¤¹¤ë¡£¤³¤ÎÃͤϥե§¡¼¥¹¥ª¥Ö¥¸¥§¥¯¥È
102 ¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
104 ¤â¤· M-text ¤¬¡¢#Mface ¤ò¥¡¼¤È¤¹¤ë¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤òÊ£¿ô»ý¤Ã
105 ¤Æ¤ª¤ê¡¢¤«¤Ä¤½¤ì¤é¤ÎÃͤδ֤˾×Æͤ¬¤Ê¤¤¤Ê¤é¤Ð¡¢¥Õ¥§¡¼¥¹¾ðÊó¤ÏÁȤ߹ç
106 ¤ï¤µ¤ì¤ÆÍѤ¤¤é¤ì¤ë¡£¾×Æͤ¬¤¢¤ë¾ì¹ç¤Ï¡¢ºÇ¾åÁؤΥե§¡¼¥¹¤¬ÍѤ¤¤é¤ì¤ë¡£
108 ¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎºÇ¸å¤Î6¸Ä¡¢¤¹¤Ê¤ï¤Á family, weight, sytle,
109 stretch, adstyle ¤ª¤è¤Ó size ¤ÎÃÍ¤Ï fontset Ãæ¤Î¥Õ¥©¥ó¥È¤¬¤½¤ì¤é¤ò
110 »ØÄꤷ¤Æ¤¤¤Ê¤¤¾ì¹ç¤Î¥Ç¥Õ¥©¥ë¥È¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£
112 ¤¢¤ë¥Æ¥¥¹¥È°À¤¬¤É¤Î¥Õ¥§¡¼¥¹¤Ë¤è¤Ã¤Æ¤â»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢¥Ç
113 ¥Õ¥©¥ë¥È¥Õ¥§¡¼¥¹¤ÎÃͤ¬ÍѤ¤¤é¤ì¤ë¡£ */
117 #if !defined (FOR_DOXYGEN) || defined (DOXYGEN_INTERNAL_MODULE)
118 /*** @addtogroup m17nInternal
126 #include "m17n-gui.h"
127 #include "m17n-misc.h"
128 #include "internal.h"
133 #include "textprop.h"
134 #include "internal-gui.h"
139 static M17NObjectArray face_table;
141 static MSymbol Mlatin;
143 static MSymbol M_face_prop_index;
145 /** Find a realized face registered on FRAME that is realized from
146 FACE and using font RFONT. If RFONT is NULL, find any that
149 static MRealizedFace *
150 find_realized_face (MFrame *frame, MFace *face, MRealizedFont *rfont)
153 MRealizedFace *rface;
156 MPLIST_DO (rface_list, frame->realized_face_list)
158 rface = MPLIST_VAL (rface_list);
160 || rface->rfont == rfont)
162 for (i = 0; i < MFACE_RATIO; i++)
163 if (rface->face.property[i] != face->property[i])
165 if (i == MFACE_RATIO)
173 free_face (void *object)
175 MFace *face = (MFace *) object;
177 if (face->property[MFACE_FONTSET])
178 M17N_OBJECT_UNREF (face->property[MFACE_FONTSET]);
179 if (face->property[MFACE_HLINE])
180 free (face->property[MFACE_HLINE]);
181 if (face->property[MFACE_BOX])
182 free (face->property[MFACE_BOX]);
183 M17N_OBJECT_UNREGISTER (face_table, face);
189 serialize_hline (MPlist *plist, MFaceHLineProp *hline)
191 MPlist *pl = mplist ();
193 mplist_add (pl, Minteger, (void *) hline->type);
194 mplist_add (pl, Minteger, (void *) hline->width);
195 mplist_add (pl, Msymbol, hline->color);
196 plist = mplist_add (plist, Mplist, pl);
197 M17N_OBJECT_UNREF (pl);
202 serialize_box (MPlist *plist, MFaceBoxProp *box)
204 MPlist *pl = mplist ();
206 mplist_add (pl, Minteger, (void *) box->width);
207 mplist_add (pl, Minteger, (void *) box->inner_hmargin);
208 mplist_add (pl, Minteger, (void *) box->inner_vmargin);
209 mplist_add (pl, Minteger, (void *) box->outer_hmargin);
210 mplist_add (pl, Minteger, (void *) box->outer_vmargin);
211 mplist_add (pl, Msymbol, box->color_top);
212 mplist_add (pl, Msymbol, box->color_bottom);
213 mplist_add (pl, Msymbol, box->color_left);
214 mplist_add (pl, Msymbol, box->color_right);
215 plist = mplist_add (plist, Mplist, pl);
216 M17N_OBJECT_UNREF (pl);
221 serialize_face (void *val)
224 MPlist *plist = mplist (), *pl = plist;
229 MPlist *(*func) (MPlist *plist, void *val);
230 } serializer[MFACE_PROPERTY_MAX]
231 = { { &Mfoundry, &Msymbol },
232 { &Mfamily, &Msymbol },
233 { &Mweight, &Msymbol },
234 { &Mstyle, &Msymbol },
235 { &Mstretch, &Msymbol },
236 { &Madstyle, &Msymbol },
237 { &Msize, &Minteger },
239 { &Mforeground, &Msymbol },
240 { &Mbackground, &Msymbol },
243 { &Mvideomode, &Msymbol },
244 { NULL, NULL}, /* MFACE_HOOK_FUNC */
245 { NULL, NULL}, /* MFACE_HOOK_ARG */
246 { &Mratio, &Minteger } };
248 for (i = 0; i < MFACE_PROPERTY_MAX; i++)
249 if (face->property[i] && serializer[i].key)
251 pl = mplist_add (pl, Msymbol, *serializer[i].key);
252 if (serializer[i].type)
253 pl = mplist_add (pl, *serializer[i].type, face->property[i]);
254 else if (i == MFACE_FONTSET)
255 pl = mplist_add (pl, Msymbol, mfontset_name ((MFontset *)
257 else if (i == MFACE_HLINE)
258 pl = serialize_hline (pl, (MFaceHLineProp *) face->property[i]);
259 else if (i == MFACE_BOX)
260 pl = serialize_box (pl, (MFaceBoxProp *) face->property[i]);
267 deserialize_hline (MPlist *plist)
269 MFaceHLineProp hline, *hline_ret;
271 if (! MPLIST_INTEGER_P (plist))
272 MERROR (MERROR_FACE, NULL);
273 hline.type = MPLIST_INTEGER_P (plist);
274 plist = MPLIST_NEXT (plist);
275 if (! MPLIST_INTEGER_P (plist))
276 MERROR (MERROR_FACE, NULL);
277 hline.width = MPLIST_INTEGER_P (plist);
278 plist = MPLIST_NEXT (plist);
279 if (! MPLIST_SYMBOL_P (plist))
280 MERROR (MERROR_FACE, NULL);
281 hline.color = MPLIST_SYMBOL (plist);
282 MSTRUCT_MALLOC (hline_ret, MERROR_FACE);
288 deserialize_box (MPlist *plist)
290 MFaceBoxProp box, *box_ret;
292 if (! MPLIST_INTEGER_P (plist))
293 MERROR (MERROR_FACE, NULL);
294 box.width = MPLIST_INTEGER (plist);
295 plist = MPLIST_NEXT (plist);
296 if (! MPLIST_INTEGER_P (plist))
297 MERROR (MERROR_FACE, NULL);
298 box.inner_hmargin = MPLIST_INTEGER (plist);
299 plist = MPLIST_NEXT (plist);
300 if (! MPLIST_INTEGER_P (plist))
301 MERROR (MERROR_FACE, NULL);
302 box.inner_vmargin = MPLIST_INTEGER (plist);
303 plist = MPLIST_NEXT (plist);
304 if (! MPLIST_INTEGER_P (plist))
305 MERROR (MERROR_FACE, NULL);
306 box.outer_hmargin = MPLIST_INTEGER (plist);
307 plist = MPLIST_NEXT (plist);
308 if (! MPLIST_INTEGER_P (plist))
309 MERROR (MERROR_FACE, NULL);
310 box.outer_vmargin = MPLIST_INTEGER (plist);
311 plist = MPLIST_NEXT (plist);
312 if (! MPLIST_SYMBOL_P (plist))
313 MERROR (MERROR_FACE, NULL);
314 box.color_top = MPLIST_SYMBOL (plist);
315 plist = MPLIST_NEXT (plist);
316 if (! MPLIST_SYMBOL_P (plist))
317 MERROR (MERROR_FACE, NULL);
318 box.color_bottom = MPLIST_SYMBOL (plist);
319 plist = MPLIST_NEXT (plist);
320 if (! MPLIST_SYMBOL_P (plist))
321 MERROR (MERROR_FACE, NULL);
322 box.color_left = MPLIST_SYMBOL (plist);
323 plist = MPLIST_NEXT (plist);
324 if (! MPLIST_SYMBOL_P (plist))
325 MERROR (MERROR_FACE, NULL);
326 box.color_right = MPLIST_SYMBOL (plist);
327 MSTRUCT_MALLOC (box_ret, MERROR_FACE);
333 deserialize_face (MPlist *plist)
335 MFace *face = mface ();
337 MPLIST_DO (plist, plist)
343 if (! MPLIST_SYMBOL_P (plist))
345 key = MPLIST_SYMBOL (plist);
346 index = (int) msymbol_get (key, M_face_prop_index) - 1;
347 plist = MPLIST_NEXT (plist);
348 if (MPLIST_TAIL_P (plist))
350 if (index < 0 || index >= MFACE_PROPERTY_MAX)
352 if (key == Mfoundry || key == Mfamily || key == Mweight || key == Mstyle
353 || key == Mstretch || key == Madstyle
354 || key == Mforeground || key == Mbackground || key == Mvideomode)
356 if (! MPLIST_SYMBOL_P (plist))
358 val = MPLIST_VAL (plist);
360 else if (key == Msize || key == Mratio)
362 if (! MPLIST_INTEGER_P (plist))
364 val = MPLIST_VAL (plist);
366 else if (key == Mfontset)
368 if (! MPLIST_SYMBOL_P (plist))
370 val = mfontset (MSYMBOL_NAME (MPLIST_SYMBOL (plist)));
372 else if (key == Mhline)
374 if (! MPLIST_PLIST_P (plist))
376 val = deserialize_hline (MPLIST_PLIST (plist));
378 else if (key == Mbox)
380 if (! MPLIST_PLIST_P (plist))
382 val = deserialize_box (MPLIST_PLIST (plist));
384 face->property[index] = val;
389 static MGlyphString work_gstring;
395 MFace *mface__default;
402 face_table.count = 0;
403 Mface = msymbol_as_managing_key ("face");
404 msymbol_put (Mface, Mtext_prop_serializer, (void *) serialize_face);
405 msymbol_put (Mface, Mtext_prop_deserializer, (void *) deserialize_face);
407 Mforeground = msymbol ("foreground");
408 Mbackground = msymbol ("background");
409 Mvideomode = msymbol ("videomode");
410 Mnormal = msymbol ("normal");
411 Mreverse = msymbol ("reverse");
412 Mratio = msymbol ("ratio");
413 Mhline = msymbol ("hline");
414 Mbox = msymbol ("box");
415 Mhook_func = msymbol ("hook-func");
416 Mhook_arg = msymbol ("hook-arg");
418 Mlatin = msymbol ("latin");
419 M_face_prop_index = msymbol (" face-prop-index");
423 /* Pointer to the key symbol of the face property. */
425 /* Index (enum face_property) of the face property. */
427 } mface_prop_data[MFACE_PROPERTY_MAX] =
428 { { &Mfoundry, MFACE_FOUNDRY },
429 { &Mfamily, MFACE_FAMILY },
430 { &Mweight, MFACE_WEIGHT },
431 { &Mstyle, MFACE_STYLE },
432 { &Mstretch, MFACE_STRETCH },
433 { &Madstyle, MFACE_ADSTYLE },
434 { &Msize, MFACE_SIZE },
435 { &Mfontset, MFACE_FONTSET },
436 { &Mforeground, MFACE_FOREGROUND },
437 { &Mbackground, MFACE_BACKGROUND },
438 { &Mhline, MFACE_HLINE },
439 { &Mbox, MFACE_BOX },
440 { &Mvideomode, MFACE_VIDEOMODE },
441 { &Mhook_func, MFACE_HOOK_FUNC },
442 { &Mhook_arg, MFACE_HOOK_ARG },
443 { &Mratio, MFACE_RATIO },
446 for (i = 0; i < MFACE_PROPERTY_MAX; i++)
447 /* We add one to distinguish it from no-property. */
448 msymbol_put (*mface_prop_data[i].key, M_face_prop_index,
449 (void *) (mface_prop_data[i].index + 1));
452 mface__default = mface ();
453 mface__default->property[MFACE_WEIGHT] = msymbol ("medium");
454 mface__default->property[MFACE_STYLE] = msymbol ("r");
455 mface__default->property[MFACE_STRETCH] = msymbol ("normal");
456 mface__default->property[MFACE_SIZE] = (void *) 120;
457 mface__default->property[MFACE_FONTSET] = mfontset (NULL);
458 M17N_OBJECT_REF (mface__default->property[MFACE_FONTSET]);
459 /* mface__default->property[MFACE_FOREGROUND] =msymbol ("black"); */
460 /* mface__default->property[MFACE_BACKGROUND] =msymbol ("white"); */
462 mface_normal_video = mface ();
463 mface_normal_video->property[MFACE_VIDEOMODE] = (void *) Mnormal;
465 mface_reverse_video = mface ();
466 mface_reverse_video->property[MFACE_VIDEOMODE] = (void *) Mreverse;
469 MFaceHLineProp *hline_prop;
471 MSTRUCT_MALLOC (hline_prop, MERROR_FACE);
472 hline_prop->type = MFACE_HLINE_UNDER;
473 hline_prop->width = 1;
474 hline_prop->color = Mnil;
475 mface_underline = mface ();
476 mface_underline->property[MFACE_HLINE] = (void *) hline_prop;
479 mface_medium = mface ();
480 mface_medium->property[MFACE_WEIGHT] = (void *) msymbol ("medium");
481 mface_bold = mface ();
482 mface_bold->property[MFACE_WEIGHT] = (void *) msymbol ("bold");
483 mface_italic = mface ();
484 mface_italic->property[MFACE_STYLE] = (void *) msymbol ("i");
485 mface_bold_italic = mface_copy (mface_bold);
486 mface_bold_italic->property[MFACE_STYLE]
487 = mface_italic->property[MFACE_STYLE];
489 mface_xx_small = mface ();
490 mface_xx_small->property[MFACE_RATIO] = (void *) 50;
491 mface_x_small = mface ();
492 mface_x_small->property[MFACE_RATIO] = (void *) 67;
493 mface_small = mface ();
494 mface_small->property[MFACE_RATIO] = (void *) 75;
495 mface_normalsize = mface ();
496 mface_normalsize->property[MFACE_RATIO] = (void *) 100;
497 mface_large = mface ();
498 mface_large->property[MFACE_RATIO] = (void *) 120;
499 mface_x_large = mface ();
500 mface_x_large->property[MFACE_RATIO] = (void *) 150;
501 mface_xx_large = mface ();
502 mface_xx_large->property[MFACE_RATIO] = (void *) 200;
504 mface_black = mface ();
505 mface_black->property[MFACE_FOREGROUND] = (void *) msymbol ("black");
506 mface_white = mface ();
507 mface_white->property[MFACE_FOREGROUND] = (void *) msymbol ("white");
508 mface_red = mface ();
509 mface_red->property[MFACE_FOREGROUND] = (void *) msymbol ("red");
510 mface_green = mface ();
511 mface_green->property[MFACE_FOREGROUND] = (void *) msymbol ("green");
512 mface_blue = mface ();
513 mface_blue->property[MFACE_FOREGROUND] = (void *) msymbol ("blue");
514 mface_cyan = mface ();
515 mface_cyan->property[MFACE_FOREGROUND] = (void *) msymbol ("cyan");
516 mface_yellow = mface ();
517 mface_yellow->property[MFACE_FOREGROUND] = (void *) msymbol ("yellow");
518 mface_magenta = mface ();
519 mface_magenta->property[MFACE_FOREGROUND] = (void *) msymbol ("magenta");
521 work_gstring.glyphs = malloc (sizeof (MGlyph) * 2);
522 work_gstring.size = 2;
523 work_gstring.used = 0;
524 work_gstring.inc = 1;
531 M17N_OBJECT_UNREF (mface__default);
532 M17N_OBJECT_UNREF (mface_normal_video);
533 M17N_OBJECT_UNREF (mface_reverse_video);
534 M17N_OBJECT_UNREF (mface_underline);
535 M17N_OBJECT_UNREF (mface_medium);
536 M17N_OBJECT_UNREF (mface_bold);
537 M17N_OBJECT_UNREF (mface_italic);
538 M17N_OBJECT_UNREF (mface_bold_italic);
539 M17N_OBJECT_UNREF (mface_xx_small);
540 M17N_OBJECT_UNREF (mface_x_small);
541 M17N_OBJECT_UNREF (mface_small);
542 M17N_OBJECT_UNREF (mface_normalsize);
543 M17N_OBJECT_UNREF (mface_large);
544 M17N_OBJECT_UNREF (mface_x_large);
545 M17N_OBJECT_UNREF (mface_xx_large);
546 M17N_OBJECT_UNREF (mface_black);
547 M17N_OBJECT_UNREF (mface_white);
548 M17N_OBJECT_UNREF (mface_red);
549 M17N_OBJECT_UNREF (mface_green);
550 M17N_OBJECT_UNREF (mface_blue);
551 M17N_OBJECT_UNREF (mface_cyan);
552 M17N_OBJECT_UNREF (mface_yellow);
553 M17N_OBJECT_UNREF (mface_magenta);
554 free (work_gstring.glyphs);
556 mdebug__report_object ("Face", &face_table);
559 /** Return a realized face for ASCII characters from NUM number of
560 base faces pointed by FACES on the frame FRAME. */
563 mface__realize (MFrame *frame, MFace **faces, int num,
564 MSymbol language, MSymbol charset, int size)
566 MRealizedFace *rface;
567 MRealizedFont *rfont;
568 MFace merged_face = *(frame->face);
574 if (num == 0 && language == Mnil && charset == Mnil && frame->rface)
577 for (i = 0; i < MFACE_PROPERTY_MAX; i++)
578 for (j = num - 1; j >= 0; j--)
579 if (faces[j]->property[i])
581 merged_face.property[i] = faces[j]->property[i];
585 for (i = 0, tick = 0; i < num; i++)
586 tick += faces[i]->tick;
588 if (merged_face.property[MFACE_RATIO])
590 int font_size = (int) merged_face.property[MFACE_SIZE];
592 font_size *= (int) merged_face.property[MFACE_RATIO];
594 merged_face.property[MFACE_SIZE] = (void *) font_size;
597 rface = find_realized_face (frame, &merged_face, NULL);
598 if (rface && rface->tick == tick)
599 return rface->ascii_rface;
601 MSTRUCT_CALLOC (rface, MERROR_FACE);
602 rface->frame = frame;
603 rface->face = merged_face;
605 props = rface->face.property;
607 rface->rfontset = mfont__realize_fontset (frame,
608 (MFontset *) props[MFACE_FONTSET],
612 rfont = mfont__lookup_fontset (rface->rfontset, &g, &num,
613 msymbol ("latin"), language, Mnil,
618 rface->rfont = rfont;
620 work_gstring.glyphs[0] = g;
621 work_gstring.glyphs[0].rface = rface;
622 work_gstring.glyphs[1].code = MCHAR_INVALID_CODE;
623 work_gstring.glyphs[1].rface = rface;
624 mfont__get_metric (&work_gstring, 0, 2);
625 rface->space_width = work_gstring.glyphs[0].width;
626 rface->ascent = work_gstring.glyphs[1].ascent;
627 rface->descent = work_gstring.glyphs[1].descent;
632 rface->space_width = frame->space_width;
635 rface->hline = (MFaceHLineProp *) props[MFACE_HLINE];
636 rface->box = (MFaceBoxProp *) props[MFACE_BOX];
637 rface->ascii_rface = rface;
638 mwin__realize_face (rface);
640 mplist_add (frame->realized_face_list, Mt, rface);
644 MSTRUCT_CALLOC (rface->nofont_rface, MERROR_FACE);
645 *rface->nofont_rface = *rface;
646 rface->nofont_rface->rfont = NULL;
649 rface->nofont_rface = rface;
656 mface__for_chars (MSymbol script, MSymbol language, MSymbol charset,
657 MGlyph *from_g, MGlyph *to_g, int size)
659 MRealizedFace *rface;
660 MRealizedFont *rfont;
661 int num = to_g - from_g, i;
663 rfont = mfont__lookup_fontset (from_g->rface->rfontset, from_g, &num,
664 script, language, charset, size);
667 from_g->rface = from_g->rface->nofont_rface;
670 rface = find_realized_face (from_g->rface->frame, &(from_g->rface->face),
674 MSTRUCT_MALLOC (rface, MERROR_FACE);
675 *rface = *from_g->rface->ascii_rface;
676 rface->rfont = rfont;
678 work_gstring.glyphs[0].code = MCHAR_INVALID_CODE;
679 work_gstring.glyphs[0].rface = rface;
680 mfont__get_metric (&work_gstring, 0, 1);
681 rface->ascent = work_gstring.glyphs[0].ascent;
682 rface->descent = work_gstring.glyphs[0].descent;
684 mwin__realize_face (rface);
685 mplist_add (from_g->rface->frame->realized_face_list, Mt, rface);
688 for (i = 0; i < num; i++, from_g++)
689 from_g->rface = rface;
695 mface__free_realized (MRealizedFace *rface)
697 mwin__free_realized_face (rface);
698 if (rface == rface->ascii_rface)
700 if (! rface->nofont_rface)
703 free (rface->nofont_rface);
704 rface->nofont_rface = NULL;
710 #endif /* !FOR_DOXYGEN || DOXYGEN_INTERNAL_MODULE */
714 /*** @addtogroup m17nFace */
718 /***en @name Variables: Keys of face property */
719 /***ja @name ÊÑ¿ô: ¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ò»ØÄꤹ¤ëÄêµÁºÑ¤ß¥·¥ó¥Ü¥ë */
724 @brief Key of a face property specifying foreground color.
726 The variable #Mforeground is used as a key of face property. The
727 property value must be a symbol whose name is a color name, or
730 #Mnil means that the face does not specify a foreground color.
732 Otherwise, the foreground of an M-text is drawn by the specified
736 @brief Á°·Ê¿§¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥·¥ó¥Ü¥ë
738 ¥¡¼¤¬ #Mforeground ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢¥·¥ó¥Ü¥ë @c
739 Mnil ¤Ç¤¢¤ë¤«¡¢¤¢¤ë¤¤¤Ï¿§Ì¾¤ò̾Á°¤È¤·¤Æ»ý¤Ä¥·¥ó¥Ü¥ë¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é
740 ¤Ê¤¤¡£Á°¼Ô¤Î¾ì¹ç¡¢Á°·Ê¿§¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¸å¼Ô¤Î¾ì¹ç¤Ï¤½¤Î¥·¥ó¥Ü¥ë¤Î
741 ̾Á°¤Î¿§¤¬Á°·Ê¿§¤È¤Ê¤ë¡£ */
746 @brief Key of a face property specifying background color.
748 The variable #Mbackground is used as a key of face property. The
749 property value must be a symbol whose name is a color name, or
752 #Mnil means that the face does not specify a background color.
754 Otherwise, the background of an M-text is drawn by the specified
758 @brief ÇØ·Ê¿§¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥·¥ó¥Ü¥ë
760 ¥¡¼¤¬ #Mbackground ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢¥·¥ó¥Ü¥ë @c
761 Mnil ¤Ç¤¢¤ë¤«¡¢¤¢¤ë¤¤¤Ï¿§Ì¾¤ò̾Á°¤È¤·¤Æ»ý¤Ä¥·¥ó¥Ü¥ë¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é
762 ¤Ê¤¤¡£Á°¼Ô¤Î¾ì¹ç¡¢ÇØ·Ê¿§¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¸å¼Ô¤Î¾ì¹ç¤Ï¤½¤Î¥·¥ó¥Ü¥ë¤Î
763 ̾Á°¤Î¿§¤¬ÇØ·Ê¿§¤È¤Ê¤ë¡£ */
768 @brief Key of a face property specifying video mode.
770 The variable #Mvideomode is used as a key of face property. The
771 property value must be #Mnormal, #Mreverse, or #Mnil.
773 #Mnormal means that an M-text is drawn in normal video mode
774 (i.e. the foreground is drawn by foreground color, the background
775 is drawn by background color).
777 #Mreverse means that an M-text is drawn in reverse video mode
778 (i.e. the foreground is drawn by background color, the background
779 is drawn by foreground color).
781 #Mnil means that the face does not specify a video mode. */
784 @brief ¥Ó¥Ç¥ª¥â¡¼¥É¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥·¥ó¥Ü¥ë
786 ¥¡¼¤¬ #Mvideomode ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϥ·¥ó¥Ü¥ë¤Ç¤Ê¤±
787 ¤ì¤Ð¤Ê¤é¤Ê¤¤¡£¤â¤· #Mreverse ¤Î¾ì¹ç¤ÏÁ°·Ê¿§¤ÈÇطʼ￧¤òÆþ¤ìÂؤ¨
788 ¤ÆÍѤ¤¤ë¡£#Mnil ¤Î¾ì¹ç¤Ï¥Ó¥Ç¥ª¥â¡¼¥É¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤ì°Ê³°¤Î¥·
789 ¥ó¥Ü¥ë¤Î¾ì¹çÁ°·Ê¿§¤ÈÇطʼ￧¤òÆþ¤ìÂؤ¨¤ò¹Ô¤Ê¤ï¤Ê¤¤¡£ */
794 @brief Key of a face property specifying font size ratio.
796 The variable #Mratio is used as a key of face property. The value
797 RATIO must be an integer.
799 The value @c NULL means that the face does not specify a
800 horizontal line. Otherwise, an M-text is drawn by a font of size
801 (FONTSIZE * RATIO / 100) where FONTSIZE is a font size specified
802 by the face property #Msize. */
807 @brief Key of a face property specifying horizontal line.
809 The variable #Mhline is used as a key of face property. The value
810 must be a pointer to an object of type #MFaceHLineProp, or @c
813 The value @c NULL means that the face does not specify this
814 property. Otherwise, an M-text is drawn with a horizontal line by
815 a way specified by the object that the value points to. */
818 @brief ²¼Àþ¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥·¥ó¥Ü¥ë
820 ¥¡¼¤¬ #Munderline ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢¥·¥ó¥Ü¥ë
821 #Mt, #Mnil, #Munspecified ¤Î¤¤¤º¤ì¤«¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£#Mt
822 ¤Î¾ì¹ç¤Ï²¼ÀþÉÕ¤¤Çɽ¼¨¤¹¤ë¡£#Mnil ¤Î¾ì¹ç¤Ï²¼Àþ¤òÉÕ¤±¤Ê¤¤¡£
823 #Munspecified ¤Î¾ì¹ç¤Ï¤É¤Á¤é¤È¤â»ØÄꤵ¤ì¤Ê¤¤¡£ */
828 @brief Key of a face property specifying box.
830 The variable #Mbox is used as a key of face property. The value
831 must be a pointer to an object of type #MFaceBoxProp, or @c NULL.
833 The value @c NULL means that the face does not specify a box.
834 Otherwise, an M-text is drawn with a surrounding box by a way
835 specified by the object that the value points to. */
838 @brief °Ï¤ßÏȤò»ØÄꤹ¤ë¤¿¤á¤Î¥·¥ó¥Ü¥ë
840 ¥¡¼¤¬ #Mbox ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢¥·¥ó¥Ü¥ë #Mt, @c
841 Mnil, #Munspecified ¤Î¤¤¤º¤ì¤«¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£#Mt ¤Î¾ì¹ç
842 ¤Ï°Ï¤ßÏÈÉÕ¤¤Çɽ¼¨¤¹¤ë¡£#Mnil ¤Î¾ì¹ç¤Ï°Ï¤ßÏȤòÉÕ¤±¤Ê¤¤¡£@c
843 Munspecified ¤Î¾ì¹ç¤Ï¤É¤Á¤é¤È¤â»ØÄꤵ¤ì¤Ê¤¤¡£ */
848 @brief Key of a face property specifying fontset.
850 The variable #Mfontset is used as a key of face property. The
851 value must be a pointer to an object of type #Mfontset, or @c
854 The value @c NULL means that the face does not specify a fontset.
855 Otherwise, an M-text is drawn with a font selected from what
856 specified in the fontset. */
859 @brief ¥Õ¥©¥ó¥È¥»¥Ã¥È¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥·¥ó¥Ü¥ë
861 ¥¡¼¤¬ #Mfontset ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢¥·¥ó¥Ü¥ë @c
862 Munspecified ¤Ç¤¢¤ë¤«¡¢¤µ¤â¤Ê¤¯¤Ð¥Õ¥©¥ó¥È¥»¥Ã¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±
863 ¤ì¤Ð¤Ê¤é¤Ê¤¤¡£Á°¼Ô¤Î¾ì¹ç¤Ï¥Õ¥©¥ó¥È¥»¥Ã¥È¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤ò¼¨
864 ¤·¡¢¸å¼Ô¤Î¾ì¹ç¤Ï¤½¤Î¥Ý¥¤¥ó¥¿¤Î»Ø¤¹¥Õ¥©¥ó¥È¥»¥Ã¥È¤¬¥Æ¥¥¹¥Èɽ¼¨¤ËÍÑ
870 @brief Key of a face property specifying hook.
872 The variable #Mhook_func is used as a key of face property. The
873 value must be a function of type #MFaceHookFunc, or @c NULL.
875 The value @c NULL means that the face does not specify a hook.
876 Otherwise, the specified function is called before the face is
882 @brief Key of a face property specifying argument of hook.
884 The variable #Mhook_arg is used as a key of face property. The
885 value can be anything that is passed a hook function specified by
886 the face property #Mhook_func. */
893 /*** @ingroup m17nFace */
894 /***en @name Variables: Possible values of #Mvideomode property of face */
899 See the documentation of the variable #Mvideomode. */
905 /*** @ingroup m17nFace */
906 /***en @name Variables: Predefined faces */
907 /***ja @name ÊÑ¿ô: ÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹ */
912 @brief Normal video face
914 The variable #mface_normal_video points to a face that has the
915 #Mvideomode property with value #Mnormal. The other properties
916 are not specified. An M-text drawn with this face appear normal
917 colors (i.e. the foreground is drawn by foreground color, and
918 background is drawn by background color). */
920 MFace *mface_normal_video;
923 @brief Reverse video face
925 The variable #mface_reverse_video points to a face that has the
926 #Mvideomode property with value #Mreverse. The other properties
927 are not specified. An M-text drawn with this face appear in
928 reversed colors (i.e. the foreground is drawn by background
929 color, and background is drawn by foreground color). */
932 @brief ¥ê¥Ð¡¼¥¹¥Õ¥§¡¼¥¹
934 ¥Ý¥¤¥ó¥¿ #maface_reverse ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Ï¡¢²¼
935 ¤Ë¼¨¤¹¤è¤¦¤Ê¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ò»ý¤Ä¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì
936 ¤¿ M-text ¤ÏÁ°·Ê¿§¤ÈÇØ·Ê¿§¤¬Æþ¤ìÂؤï¤ë¡£ */
938 MFace *mface_reverse_video;
941 @brief Underline face.
943 The variable #mface_underline points to a face that has the
944 #Mhline property with value a pointer to an object of type
945 #MFaceHLineProp. The members of the object are as follows:
950 type MFACE_HLINE_UNDER
955 The other properties are not specified. An M-text that has this
956 face is drawn with an underline. */
958 MFace *mface_underline;
963 The variable #mface_medium points to a face that has the #Mweight
964 property with value a symbol of name "medium". The other
965 properties are not specified. An M-text that has this face is
966 drawn with a font of medium weight. */
972 The variable #mface_bold points to a face that has the #Mweight
973 property with value a symbol of name "bold". The other properties
974 are not specified. An M-text that has this face is drawn with a
975 font of bold weight. */
978 @brief ¥Ü¡¼¥ë¥É¥Õ¥§¡¼¥¹
980 ¥Ý¥¤¥ó¥¿ #mface_bold ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Ï¡¢weight
981 ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ¥Ü¡¼¥ë¥ÉÂΤò°ÕÌ£¤¹¤ë¥·¥¹¥Æ¥à°Í¸¤Î¥·¥ó¥Ü¥ë¤ò»ý
982 ¤Ä¡£Â¾¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϲ¼¤Ë¼¨¤¹¤È¤ª¤ê¤Ç¤¢¤ë¡£¤³¤Î¥Õ¥§¡¼¥¹
983 ¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤Ï¥Ü¡¼¥ë¥ÉÂΤȤʤ롣 */
990 The variable #mface_italic points to a face that has the #Mstyle
991 property with value a symbol of name "italic". The other
992 properties are not specified. An M-text that has this face is
993 drawn with a font of italic style. */
996 @brief ¥¤¥¿¥ê¥Ã¥¯¥Õ¥§¡¼¥¹
998 ¥Ý¥¤¥ó¥¿ #mface_italic ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Ï¡¢style
999 ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ¥¤¥¿¥ê¥Ã¥¯ÂΤò°ÕÌ£¤¹¤ë¥·¥¹¥Æ¥à°Í¸¤Î¥·¥ó¥Ü¥ë¤ò
1000 »ý¤Ä¡£Â¾¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϲ¼¤Ë¼¨¤¹Ä̤ê¤Ç¤¢¤ë¡£¤³¤Î¥Õ¥§¡¼¥¹
1001 ¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤Ï¥¤¥¿¥ê¥Ã¥¯ÂΤȤʤ롣 */
1003 MFace *mface_italic;
1006 @brief Bold italic face
1008 The variable #mface_bold_italic points to a face that has the
1009 #Mweight property with value a symbol of name "bold", and #Mstyle
1010 property with value a symbol of name "italic". The other
1011 properties are not specified. An M-text that has this face is
1012 drawn with a font of bold weight and italic style. */
1015 @brief ¥Ü¡¼¥ë¥É¥¤¥¿¥ê¥Ã¥¯¥Õ¥§¡¼¥¹
1017 ¥Ý¥¤¥ó¥¿ #mface_bold_italic ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Î
1018 ¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Ï¡¢weight ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ¥Ü¡¼¥ë¥ÉÂΤò°ÕÌ£
1019 ¤¹¤ë¥·¥¹¥Æ¥à°Í¸¤Î¥·¥ó¥Ü¥ë¤ò¡¢style ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ¥¤¥¿¥ê¥Ã¥¯
1020 ÂΤò°ÕÌ£¤¹¤ë¥·¥¹¥Æ¥à°Í¸¤Î¥·¥ó¥Ü¥ë¤ò¡¢¤½¤ì°Ê³°¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£
1021 ¤ÎÃͤȤ·¤Æ²¼¤Ë¼¨¤¹¤â¤Î¤ò¤½¤ì¤¾¤ì»ý¤Ä¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì
1022 ¤¿ M-text ¤Ï¥Ü¡¼¥ë¥É¥¤¥¿¥ê¥Ã¥¯ÂΤȤʤ롣 */
1024 MFace *mface_bold_italic;
1027 @brief Smallest face
1029 The variable #mface_xx_small points to a face that has the #Mratio
1030 property with value 50. The other properties are not specified.
1031 An M-text that has this face is drawn with a font whose size is
1032 50% of a normal font. */
1035 @brief ºÇ¾®¤Î¥Õ¥§¡¼¥¹
1037 ¥Ý¥¤¥ó¥¿ #mface_xx_small ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Ï¡¢²¼
1038 ¤Ë¼¨¤¹¤è¤¦¤Ê¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ò»ý¤Ä¡£¤³¤³¤Ç @c N ¤Ï @c
1039 mface_normalsize ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Î size ¥×¥í¥Ñ¥Æ¥£
1040 ¤ÎÃͤǤ¢¤ë¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÂ礤µ¤Ï¡¢ @c
1041 mface_normalsize ¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÂ礤µ¤Î 50% ¤Ë¤Ê¤ë¡£
1044 MFace *mface_xx_small;
1049 The variable #mface_x_small points to a face that has the #Mratio
1050 property with value 66. The other properties are not specified.
1051 An M-text that has this face is drawn with a font whose size is
1052 66% of a normal font. */
1055 @brief ¤è¤ê¾®¤µ¤¤¥Õ¥§¡¼¥¹
1057 ¥Ý¥¤¥ó¥¿ #mface_x_small ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Ï¡¢²¼
1058 ¤Ë¼¨¤¹¤è¤¦¤Ê¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ò»ý¤Ä¡£¤³¤³¤Ç @c N ¤Ï
1059 #mface_normalsize ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Î size ¥×¥í¥Ñ¥Æ¥£
1060 ¤ÎÃͤǤ¢¤ë¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÂ礤µ¤Ï¡¢
1061 #mface_normalsize ¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÂ礤µ¤Î 66% ¤Ë¤Ê¤ë¡£
1064 MFace *mface_x_small;
1069 The variable #mface_x_small points to a face that has the #Mratio
1070 property with value 75. The other properties are not specified.
1071 An M-text that has this face is drawn with a font whose size is
1072 75% of a normal font. */
1075 @brief ¾®¤µ¤¤¥Õ¥§¡¼¥¹
1077 ¥Ý¥¤¥ó¥¿ #mface_small ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Ï¡¢²¼
1078 ¤Ë¼¨¤¹¤è¤¦¤Ê¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ò»ý¤Ä¡£¤³¤³¤Ç @c N ¤Ï
1079 #mface_normalsize ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Î size ¥×¥í¥Ñ¥Æ¥£
1080 ¤ÎÃͤǤ¢¤ë¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÂ礤µ¤Ï¡¢
1081 #mface_normalsize ¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÂ礤µ¤Î 75% ¤Ë¤Ê¤ë¡£
1087 @brief Normalsize face
1089 The variable #mface_normalsize points to a face that has the
1090 #Mratio property with value 100. The other properties are not
1091 specified. An M-text that has this face is drawn with a font
1092 whose size is the same as a normal font. */
1095 @brief ɸ½à¤ÎÂ礤µ¤Î¥Õ¥§¡¼¥¹
1097 ¥Ý¥¤¥ó¥¿ #mface_normalsize ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Ï¡¢²¼¤Ë
1098 ¼¨¤¹¤è¤¦¤Ê¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ò»ý¤Ä¡£¤³¤³¤Ç @c N ¤Ï¥Ý¥¤¥ó¥È¥µ¥¤¥º¤ò
1099 ɽ¤ï¤¹À°¿ô¤Ç¤¢¤ë¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÂ礤µ¤Ï¡¢
1100 ¥Ç¥Õ¥©¥ë¥È¥Õ¥ì¡¼¥à¤Î¥Ç¥Õ¥©¥ë¥È¥Õ¥©¥ó¥È¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤Î
1103 MFace *mface_normalsize;
1108 The variable #mface_large points to a face that has the #Mratio
1109 property with value 120. The other properties are not specified.
1110 An M-text that has this face is drawn with a font whose size is
1111 120% of a normal font. */
1114 @brief Â礤¤¥Õ¥§¡¼¥¹
1116 ¥Ý¥¤¥ó¥¿ #mface_large ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Ï¡¢²¼
1117 ¤Ë¼¨¤¹¤è¤¦¤Ê¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ò»ý¤Ä¡£¤³¤³¤Ç @c N ¤Ï
1118 #mface_normalsize ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Î size ¥×¥í¥Ñ¥Æ¥£
1119 ¤ÎÃͤǤ¢¤ë¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÂ礤µ¤Ï¡¢
1120 #mface_normalsize ¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÂ礤µ¤Î 120% ¤Ë¤Ê¤ë¡£
1128 The variable #mface_x_large points to a face that has the #Mratio
1129 property with value 150. The other properties are not specified.
1130 An M-text that has this face is drawn with a font whose size is
1131 150% of a normal font. */
1134 @brief ¤è¤êÂ礤¤¥Õ¥§¡¼¥¹
1136 ¥Ý¥¤¥ó¥¿ #mface_x_large ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Ï¡¢²¼
1137 ¤Ë¼¨¤¹¤è¤¦¤Ê¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ò»ý¤Ä¡£¤³¤³¤Ç @c N ¤Ï
1138 #mface_normalsize ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Î size ¥×¥í¥Ñ¥Æ¥£
1139 ¤ÎÃͤǤ¢¤ë¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÂ礤µ¤Ï¡¢
1140 #mface_normalsize ¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÂ礤µ¤Î 150% ¤Ë¤Ê¤ë¡£
1143 MFace *mface_x_large;
1148 The variable #mface_xx_large points to a face that has the #Mratio
1149 property with value 200. The other properties are not specified.
1150 An M-text that has this face is drawn with a font whose size is
1151 200% of a normal font. */
1154 @brief ºÇÂç¤Î¥Õ¥§¡¼¥¹
1156 ¥Ý¥¤¥ó¥¿ #mface_xx_large ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Ï¡¢²¼
1157 ¤Ë¼¨¤¹¤è¤¦¤Ê¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ò»ý¤Ä¡£¤³¤³¤Ç @c N ¤Ï
1158 #mface_normalsize ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Î size ¥×¥í¥Ñ¥Æ¥£
1159 ¤ÎÃͤǤ¢¤ë¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÂ礤µ¤Ï¡¢
1160 #mface_normalsize ¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÂ礤µ¤Î 200% ¤Ë¤Ê¤ë¡£
1163 MFace *mface_xx_large;
1168 The variable #mface_black points to a face that has the
1169 #Mforeground property with value a symbol of name "black". The
1170 other properties are not specified. An M-text that has this face
1171 is drawn with black foreground. */
1176 ¥Ý¥¤¥ó¥¿ #mface_black ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Ï¡¢
1177 #Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ<tt>"black"</tt> ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü
1178 ¥ë¤ò»ý¤Ä¡£Â¾¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϲ¼¤Ë¼¨¤¹¤È¤ª¤ê¤Ç¤¢¤ë¡£¤³¤Î
1179 ¥Õ¥§¡¼¥¹¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÁ°·Ê¿§¤Ï¹õ¤Ë¤Ê¤ë¡£ */
1186 The variable #mface_white points to a face that has the
1187 #Mforeground property with value a symbol of name "white". The
1188 other properties are not specified. An M-text that has this face
1189 is drawn with white foreground. */
1194 ¥Ý¥¤¥ó¥¿ #mface_white ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Ï¡¢
1195 foreground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ<tt>"white"</tt> ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü
1196 ¥ë¤ò»ý¤Ä¡£Â¾¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϲ¼¤Ë¼¨¤¹¤È¤ª¤ê¤Ç¤¢¤ë¡£¤³¤Î
1197 ¥Õ¥§¡¼¥¹¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÁ°·Ê¿§¤ÏÇò¤Ë¤Ê¤ë¡£ */
1204 The variable #mface_red points to a face that has the
1205 #Mforeground property with value a symbol of name "red". The
1206 other properties are not specified. An M-text that has this face
1207 is drawn with red foreground. */
1212 ¥Ý¥¤¥ó¥¿ #mface_red ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Ï¡¢
1213 foreground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ<tt>"red"</tt> ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü
1214 ¥ë¤ò»ý¤Ä¡£Â¾¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϲ¼¤Ë¼¨¤¹¤È¤ª¤ê¤Ç¤¢¤ë¡£¤³¤Î
1215 ¥Õ¥§¡¼¥¹¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÁ°·Ê¿§¤ÏÀ֤ˤʤ롣 */
1222 The variable #mface_green points to a face that has the
1223 #Mforeground property with value a symbol of name "green". The
1224 other properties are not specified. An M-text that has this face
1225 is drawn with green foreground. */
1230 ¥Ý¥¤¥ó¥¿ #mface_green ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Ï¡¢
1231 foreground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ<tt>"green"</tt> ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü
1232 ¥ë¤ò»ý¤Ä¡£Â¾¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϲ¼¤Ë¼¨¤¹¤È¤ª¤ê¤Ç¤¢¤ë¡£¤³¤Î
1233 ¥Õ¥§¡¼¥¹¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÁ°·Ê¿§¤ÏÎФˤʤ롣 */
1240 The variable #mface_blue points to a face that has the
1241 #Mforeground property with value a symbol of name "blue". The
1242 other properties are not specified. An M-text that has this face
1243 is drawn with blue foreground. */
1248 ¥Ý¥¤¥ó¥¿ #mface_blue ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Ï¡¢
1249 foreground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ<tt>"blue"</tt> ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü
1250 ¥ë¤ò»ý¤Ä¡£Â¾¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϲ¼¤Ë¼¨¤¹¤È¤ª¤ê¤Ç¤¢¤ë¡£¤³¤Î
1251 ¥Õ¥§¡¼¥¹¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÁ°·Ê¿§¤ÏÀĤˤʤ롣 */
1258 The variable #mface_cyan points to a face that has the
1259 #Mforeground property with value a symbol of name "cyan". The
1260 other properties are not specified. An M-text that has this face
1261 is drawn with cyan foreground. */
1264 @brief ¥·¥¢¥ó¥Õ¥§¡¼¥¹
1266 ¥Ý¥¤¥ó¥¿ #mface_cyan ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Ï¡¢
1267 foreground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ<tt>"cyan"</tt> ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü
1268 ¥ë¤ò»ý¤Ä¡£Â¾¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϲ¼¤Ë¼¨¤¹¤È¤ª¤ê¤Ç¤¢¤ë¡£¤³¤Î
1269 ¥Õ¥§¡¼¥¹¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÁ°·Ê¿§¤Ï¥·¥¢¥ó¤Ë¤Ê¤ë¡£ */
1276 The variable #mface_yellow points to a face that has the
1277 #Mforeground property with value a symbol of name "yellow". The
1278 other properties are not specified. An M-text that has this face
1279 is drawn with yellow foreground. */
1284 ¥Ý¥¤¥ó¥¿ #mface_yellow ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Ï¡¢
1285 foreground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ<tt>"yellow"</tt> ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü
1286 ¥ë¤ò»ý¤Ä¡£Â¾¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϲ¼¤Ë¼¨¤¹¤È¤ª¤ê¤Ç¤¢¤ë¡£¤³¤Î
1287 ¥Õ¥§¡¼¥¹¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÁ°·Ê¿§¤Ï²«¿§¤Ë¤Ê¤ë¡£ */
1289 MFace *mface_yellow;
1295 The variable #mface_magenta points to a face that has the
1296 #Mforeground property with value a symbol of name "magenta". The
1297 other properties are not specified. An M-text that has this face
1298 is drawn with magenta foreground. */
1301 @brief ¥Þ¥¼¥ó¥¿¥Õ¥§¡¼¥¹
1303 ¥Ý¥¤¥ó¥¿ #mface_magenta ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Ï¡¢
1304 foreground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ<tt>"magenta"</tt> ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü
1305 ¥ë¤ò»ý¤Ä¡£Â¾¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϲ¼¤Ë¼¨¤¹¤È¤ª¤ê¤Ç¤¢¤ë¡£¤³¤Î
1306 ¥Õ¥§¡¼¥¹¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÁ°·Ê¿§¤Ï¥Þ¥¼¥ó¥¿¤Ë¤Ê¤ë¡£ */
1308 MFace *mface_magenta;
1313 /***en @name Variables: The other symbols for face handling. */
1314 /***ja @name ÊÑ¿ô: ¥Õ¥§¡¼¥¹¤ò¼è¤ê°·¤¦¤¿¤á¤Î¤½¤Î¾¤ÎÄêµÁºÑ¤ß¥·¥ó¥Ü¥ë */
1319 @brief Key of a text property specifying a face.
1321 The variable #Mface is a symbol of name <tt>"face"</tt>. A text
1322 property whose key is this symbol must have a pointer to an object
1323 of type #MFace. This is a managing key. */
1326 @brief ¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤Ê¤ë¥·¥ó¥Ü¥ë
1328 ¥·¥ó¥Ü¥ë #Mface ¤Ï <tt>"face"</tt> ¤È¤¤¤¦Ì¾Á°¤ò»ý¤Ä¡£¥¡¼¤¬ @c
1329 Mface ¤Ç¤¢¤ë¤è¤¦¤Ê¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢¥Õ¥§¡¼¥¹¥ª¥Ö¥¸¥§¥¯¥È¤Ø
1330 ¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ */
1338 @brief Create a new face.
1340 The mface () function creates a new face object that specifies no
1344 This function returns a pointer to the created face. */
1347 @brief ¿·¤·¤¤¥Õ¥§¡¼¥¹¤ò¤Ä¤¯¤ë
1349 ´Ø¿ô mface () ¤Ï¿·¤·¤¤¥Õ¥§¡¼¥¹¥ª¥Ö¥¸¥§¥¯¥È¤òºî¤ë¡£
1350 ºî¤é¤ì¤¿¥Õ¥§¡¼¥¹¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤ë¡£
1352 @li ¥¡¼ #Mfontset ¤ËÂФ¹¤ëÃÍ¤Ï @c NULL
1353 @li ¥¡¼ #Msize ¤ËÂФ¹¤ëÃÍ¤Ï 0
1354 @li ¤½¤Î¾¤Î¥¡¼¤ËÂФ¹¤ëÃÍ¤Ï #Munspecified */
1361 M17N_OBJECT (face, free_face, MERROR_FACE);
1362 M17N_OBJECT_REGISTER (face_table, face);
1369 @brief Make a copy of a face.
1371 The mface_copy () function makes a copy of $FACE and returns a
1372 pointer to the created copy. */
1375 @brief ¥Õ¥§¡¼¥¹¤Î¥³¥Ô¡¼¤òºî¤ë
1377 ´Ø¿ô mface_copy () ¤Ï¥Õ¥§¡¼¥¹ $FACE ¤Î¥³¥Ô¡¼¤òºî¤ê¡¢¤½¤ì¤Ø¤Î¥Ý¥¤¥ó
1381 mface_copy (MFace *face)
1385 MSTRUCT_CALLOC (copy, MERROR_FACE);
1387 copy->control.ref_count = 1;
1388 M17N_OBJECT_REGISTER (face_table, copy);
1389 if (copy->property[MFACE_FONTSET])
1390 M17N_OBJECT_REF (copy->property[MFACE_FONTSET]);
1391 if (copy->property[MFACE_HLINE])
1393 MFaceHLineProp *val;
1395 MSTRUCT_MALLOC (val, MERROR_FACE);
1396 *val = *((MFaceHLineProp *) copy->property[MFACE_HLINE]);
1397 copy->property[MFACE_HLINE] = val;
1399 if (copy->property[MFACE_BOX])
1403 MSTRUCT_MALLOC (val, MERROR_FACE);
1404 *val = *((MFaceBoxProp *) copy->property[MFACE_BOX]);
1405 copy->property[MFACE_BOX] = val;
1415 The mface_merge () functions merges the properties of face $SRC
1419 This function returns $DST. */
1422 mface_merge (MFace *dst, MFace *src)
1426 for (i = 0; i < MFACE_PROPERTY_MAX; i++)
1427 if (src->property[i])
1429 dst->property[i] = src->property[i];
1430 if (i == MFACE_FONTSET)
1431 M17N_OBJECT_REF (dst->property[i]);
1432 else if (i == MFACE_HLINE)
1434 MFaceHLineProp *val;
1436 MSTRUCT_MALLOC (val, MERROR_FACE);
1437 *val = *((MFaceHLineProp *) dst->property[MFACE_HLINE]);
1438 dst->property[MFACE_HLINE] = val;
1440 else if (i == MFACE_BOX)
1444 MSTRUCT_MALLOC (val, MERROR_FACE);
1445 *val = *((MFaceBoxProp *) dst->property[MFACE_BOX]);
1446 dst->property[MFACE_BOX] = val;
1455 @brief Make a face from a font.
1457 The mface_from_font () function return a newly created face while
1458 reflecting the properties of $FONT in its properties. */
1461 mface_from_font (MFont *font)
1463 MFace *face = mface ();
1465 face->property[MFACE_FOUNDRY] = mfont_get_prop (font, Mfoundry);
1466 face->property[MFACE_FAMILY] = mfont_get_prop (font, Mfamily);
1467 face->property[MFACE_WEIGHT] = mfont_get_prop (font, Mweight);
1468 face->property[MFACE_STYLE] = mfont_get_prop (font, Mstyle);
1469 face->property[MFACE_STRETCH] = mfont_get_prop (font, Mstretch);
1470 face->property[MFACE_ADSTYLE] = mfont_get_prop (font, Madstyle);
1471 face->property[MFACE_SIZE] = mfont_get_prop (font, Msize);
1478 @brief Get the value of a face property.
1480 The mface_get_prop () function returns the value of the face
1481 property whose key is $KEY in face $FACE. $KEY must be one of the
1484 #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
1485 #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
1486 #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg
1489 The actual type of the returned value depends of $KEY. See
1490 documentation of the above keys. If an error is detected, it
1491 returns @c NULL and assigns an error code to the external variable
1495 @brief ¥Õ¥§¡¼¥¹¤Î¥×¥í¥Ñ¥Æ¥£ÃͤòÆÀ¤ë
1497 ´Ø¿ô mface_get_prop () ¤Ï¡¢¥Õ¥§¡¼¥¹ $FACE ¤¬»ý¤Ä¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£
1498 ¤ÎÆâ¡¢¥¡¼¤¬ $KEY ¤Ç¤¢¤ë¤â¤Î¤ÎÃͤòÊÖ¤¹¡£$KEY ¤Ï²¼µ¤Î¤¤¤º¤ì¤«¤Ç¤Ê
1501 #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
1502 #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
1503 #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg
1506 ¤â¤· $KEY ¤¬ #Mfontset ¤Ê¤é¤Ð¡¢mface_get_prop () ¤Ï¥Õ¥©¥ó¥È¥»¥Ã
1507 ¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£¤â¤· $KEY ¤¬ #Msize ¤Ê¤é¤ÐÀ°¿ô¤òÊÖ¤¹¡£¤½¤ì
1508 °Ê³°¤Î¾ì¹ç¤Ï¥·¥ó¥Ü¥ë¤òÊÖ¤¹¡£¥¨¥é¡¼¤¬¸¡½Ð¤µ¤ì¤¿¾ì¹ç¤Ï @c NULL ¤òÊÖ
1509 ¤·¡¢³°ÉôÊÑ¿ô #merror_code ¤Ë¥¨¥é¡¼¥³¡¼¥É¤òÀßÄꤹ¤ë¡£ */
1519 mface_get_prop (MFace *face, MSymbol key)
1521 int index = (int) msymbol_get (key, M_face_prop_index) - 1;
1524 MERROR (MERROR_FACE, NULL);
1525 return face->property[index];
1531 @brief Set a value of a face face property.
1533 The mface_put_prop () function assigns $VAL to the property whose
1534 key is $KEY in face $FACE. $KEY must be one the followings:
1536 #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
1537 #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
1538 #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg
1540 Among them, font related properties (#Mfoundry through #Msize) are
1541 used as the default values when a font in the fontset of $FACE
1542 does not specify those values.
1544 The actual type of the returned value depends of $KEY. See
1545 documentation of the above keys.
1548 If the operation was successful, mface_put_prop returns () 0.
1549 Otherwise it returns -1 and assigns an error code to the external
1550 variable #merror_code. */
1553 @brief ¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤòÀßÄꤹ¤ë
1555 ´Ø¿ô mface_put_prop () ¤Ï¡¢¥Õ¥§¡¼¥¹ $FACE Æâ¤Ç¥¡¼¤¬$KEY ¤Ç¤¢¤ë¥×
1556 ¥í¥Ñ¥Æ¥£¤ÎÃͤò $VAL ¤ËÀßÄꤹ¤ë¡£$KEY ¤Ï°Ê²¼¤Î¤¤¤º¤ì¤«¤Ç¤Ê¤¯¤Æ¤Ï¤Ê
1559 #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
1560 #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
1561 #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg.
1563 ¤³¤ì¤é¤Î¤¦¤Á¤Î¡¢¥Õ¥©¥ó¥È´ØÏ¢¤Î¥×¥í¥Ñ¥Æ¥£ (#Mfamily ¤«¤é #Msize
1564 ¤Þ¤Ç) ¤Ï¡¢¥Õ¥§¡¼¥¹¤Î¥Õ¥©¥ó¥È¥»¥Ã¥ÈÃæ¤Î¥Õ¥©¥ó¥È¤Ë´Ø¤¹¤ë¥Ç¥Õ¥©¥ë¥ÈÃÍ
1567 ¤â¤· $KEY ¤¬ #Mfontset ¤Ê¤é $VAL ¤Ï #MFontset ·¿¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç
1568 ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£¤â¤· $KEY ¤¬ #Msize ¤Ê¤é¤Ð $VAL ¤ÏÀ°¿ô¤Ç¤Ê¤±¤ì
1569 ¤Ð¤Ê¤é¤Ê¤¤¡£$KEY ¤¬¤½¤ì°Ê³°¤Î¾ì¹ç¡¢$VAL ¤Ï¥·¥ó¥Ü¥ë¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê
1573 ½èÍý¤¬À®¸ù¤·¤¿¾ì¹ç¡¢mface_put_prop () ¤Ï 0 ¤òÊÖ¤¹¡£¼ºÇÔ¤·¤¿¾ì¹ç¤Ï
1574 -1 ¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô #merror_code ¤Ë¥¨¥é¡¼¥³¡¼¥É¤òÀßÄꤹ¤ë¡£ */
1584 mface_put_prop (MFace *face, MSymbol key, void *val)
1586 int index = (int) msymbol_get (key, M_face_prop_index) - 1;
1589 MERROR (MERROR_FACE, -1);
1590 if (key == Mfontset)
1591 M17N_OBJECT_REF (val);
1592 else if (key == Mhline)
1594 MFaceHLineProp *newval;
1596 MSTRUCT_MALLOC (newval, MERROR_FACE);
1597 *newval = *((MFaceHLineProp *) val);
1600 else if (key == Mbox)
1602 MFaceBoxProp *newval;
1604 MSTRUCT_MALLOC (newval, MERROR_FACE);
1605 *newval = *((MFaceBoxProp *) val);
1608 face->property[index] = val;
1617 @brief Update a face.
1619 The mface_update () function update $FACE on $FRAME by calling a
1620 hook function of $FACE (if any). */
1623 mface_update (MFrame *frame, MFace *face)
1625 MFaceHookFunc func = (MFaceHookFunc) face->property[MFACE_HOOK_FUNC];
1627 MRealizedFace *rface;
1631 MPLIST_DO (rface_list, frame->realized_face_list)
1633 rface = MPLIST_VAL (rface_list);
1634 if ((MFaceHookFunc) rface->face.property[MFACE_HOOK_FUNC] == func)
1635 (func) (&(rface->face), rface->face.property[MFACE_HOOK_ARG],
1645 /*** @addtogroup m17nDebug */
1652 The mdebug_dump_face () function prints $FACE in a human readable
1653 way to the stderr. $INDENT specifies how many columns to indent
1654 the lines but the first one.
1657 This function returns $FACE. */
1660 mdebug_dump_face (MFace *face, int indent)
1662 char *prefix = (char *) alloca (indent + 1);
1665 memset (prefix, 32, indent);
1667 mfont__set_spec_from_face (&spec, face);
1668 fprintf (stderr, "(face font:\"");
1669 mdebug_dump_font (&spec);
1670 fprintf (stderr, "\"\n %s fore:%s back:%s", prefix,
1671 msymbol_name ((MSymbol) face->property[MFACE_FOREGROUND]),
1672 msymbol_name ((MSymbol) face->property[MFACE_BACKGROUND]));
1673 if (face->property[MFACE_FONTSET])
1674 fprintf (stderr, " non-default-fontset");
1675 fprintf (stderr, " hline:%s", face->property[MFACE_HLINE] ? "yes" : "no");
1676 fprintf (stderr, " box:%s)", face->property[MFACE_BOX] ? "yes" : "no");