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;
393 MFace *mface__default;
400 face_table.count = 0;
401 Mface = msymbol_as_managing_key ("face");
402 msymbol_put (Mface, Mtext_prop_serializer, (void *) serialize_face);
403 msymbol_put (Mface, Mtext_prop_deserializer, (void *) deserialize_face);
405 Mforeground = msymbol ("foreground");
406 Mbackground = msymbol ("background");
407 Mvideomode = msymbol ("videomode");
408 Mnormal = msymbol ("normal");
409 Mreverse = msymbol ("reverse");
410 Mratio = msymbol ("ratio");
411 Mhline = msymbol ("hline");
412 Mbox = msymbol ("box");
413 Mhook_func = msymbol ("hook-func");
414 Mhook_arg = msymbol ("hook-arg");
416 Mlatin = msymbol ("latin");
417 M_face_prop_index = msymbol (" face-prop-index");
421 /* Pointer to the key symbol of the face property. */
423 /* Index (enum face_property) of the face property. */
425 } mface_prop_data[MFACE_PROPERTY_MAX] =
426 { { &Mfoundry, MFACE_FOUNDRY },
427 { &Mfamily, MFACE_FAMILY },
428 { &Mweight, MFACE_WEIGHT },
429 { &Mstyle, MFACE_STYLE },
430 { &Mstretch, MFACE_STRETCH },
431 { &Madstyle, MFACE_ADSTYLE },
432 { &Msize, MFACE_SIZE },
433 { &Mfontset, MFACE_FONTSET },
434 { &Mforeground, MFACE_FOREGROUND },
435 { &Mbackground, MFACE_BACKGROUND },
436 { &Mhline, MFACE_HLINE },
437 { &Mbox, MFACE_BOX },
438 { &Mvideomode, MFACE_VIDEOMODE },
439 { &Mhook_func, MFACE_HOOK_FUNC },
440 { &Mhook_arg, MFACE_HOOK_ARG },
441 { &Mratio, MFACE_RATIO },
444 for (i = 0; i < MFACE_PROPERTY_MAX; i++)
445 /* We add one to distinguish it from no-property. */
446 msymbol_put (*mface_prop_data[i].key, M_face_prop_index,
447 (void *) (mface_prop_data[i].index + 1));
450 mface__default = mface ();
451 mface__default->property[MFACE_WEIGHT] = msymbol ("medium");
452 mface__default->property[MFACE_STYLE] = msymbol ("r");
453 mface__default->property[MFACE_STRETCH] = msymbol ("normal");
454 mface__default->property[MFACE_SIZE] = (void *) 120;
455 mface__default->property[MFACE_FONTSET] = mfontset (NULL);
456 M17N_OBJECT_REF (mface__default->property[MFACE_FONTSET]);
457 /* mface__default->property[MFACE_FOREGROUND] =msymbol ("black"); */
458 /* mface__default->property[MFACE_BACKGROUND] =msymbol ("white"); */
460 mface_normal_video = mface ();
461 mface_normal_video->property[MFACE_VIDEOMODE] = (void *) Mnormal;
463 mface_reverse_video = mface ();
464 mface_reverse_video->property[MFACE_VIDEOMODE] = (void *) Mreverse;
467 MFaceHLineProp *hline_prop;
469 MSTRUCT_MALLOC (hline_prop, MERROR_FACE);
470 hline_prop->type = MFACE_HLINE_UNDER;
471 hline_prop->width = 1;
472 hline_prop->color = Mnil;
473 mface_underline = mface ();
474 mface_underline->property[MFACE_HLINE] = (void *) hline_prop;
477 mface_medium = mface ();
478 mface_medium->property[MFACE_WEIGHT] = (void *) msymbol ("medium");
479 mface_bold = mface ();
480 mface_bold->property[MFACE_WEIGHT] = (void *) msymbol ("bold");
481 mface_italic = mface ();
482 mface_italic->property[MFACE_STYLE] = (void *) msymbol ("i");
483 mface_bold_italic = mface_copy (mface_bold);
484 mface_bold_italic->property[MFACE_STYLE]
485 = mface_italic->property[MFACE_STYLE];
487 mface_xx_small = mface ();
488 mface_xx_small->property[MFACE_RATIO] = (void *) 50;
489 mface_x_small = mface ();
490 mface_x_small->property[MFACE_RATIO] = (void *) 67;
491 mface_small = mface ();
492 mface_small->property[MFACE_RATIO] = (void *) 75;
493 mface_normalsize = mface ();
494 mface_normalsize->property[MFACE_RATIO] = (void *) 100;
495 mface_large = mface ();
496 mface_large->property[MFACE_RATIO] = (void *) 120;
497 mface_x_large = mface ();
498 mface_x_large->property[MFACE_RATIO] = (void *) 150;
499 mface_xx_large = mface ();
500 mface_xx_large->property[MFACE_RATIO] = (void *) 200;
502 mface_black = mface ();
503 mface_black->property[MFACE_FOREGROUND] = (void *) msymbol ("black");
504 mface_white = mface ();
505 mface_white->property[MFACE_FOREGROUND] = (void *) msymbol ("white");
506 mface_red = mface ();
507 mface_red->property[MFACE_FOREGROUND] = (void *) msymbol ("red");
508 mface_green = mface ();
509 mface_green->property[MFACE_FOREGROUND] = (void *) msymbol ("green");
510 mface_blue = mface ();
511 mface_blue->property[MFACE_FOREGROUND] = (void *) msymbol ("blue");
512 mface_cyan = mface ();
513 mface_cyan->property[MFACE_FOREGROUND] = (void *) msymbol ("cyan");
514 mface_yellow = mface ();
515 mface_yellow->property[MFACE_FOREGROUND] = (void *) msymbol ("yellow");
516 mface_magenta = mface ();
517 mface_magenta->property[MFACE_FOREGROUND] = (void *) msymbol ("magenta");
524 M17N_OBJECT_UNREF (mface__default);
525 M17N_OBJECT_UNREF (mface_normal_video);
526 M17N_OBJECT_UNREF (mface_reverse_video);
527 M17N_OBJECT_UNREF (mface_underline);
528 M17N_OBJECT_UNREF (mface_medium);
529 M17N_OBJECT_UNREF (mface_bold);
530 M17N_OBJECT_UNREF (mface_italic);
531 M17N_OBJECT_UNREF (mface_bold_italic);
532 M17N_OBJECT_UNREF (mface_xx_small);
533 M17N_OBJECT_UNREF (mface_x_small);
534 M17N_OBJECT_UNREF (mface_small);
535 M17N_OBJECT_UNREF (mface_normalsize);
536 M17N_OBJECT_UNREF (mface_large);
537 M17N_OBJECT_UNREF (mface_x_large);
538 M17N_OBJECT_UNREF (mface_xx_large);
539 M17N_OBJECT_UNREF (mface_black);
540 M17N_OBJECT_UNREF (mface_white);
541 M17N_OBJECT_UNREF (mface_red);
542 M17N_OBJECT_UNREF (mface_green);
543 M17N_OBJECT_UNREF (mface_blue);
544 M17N_OBJECT_UNREF (mface_cyan);
545 M17N_OBJECT_UNREF (mface_yellow);
546 M17N_OBJECT_UNREF (mface_magenta);
547 mdebug__report_object ("Face", &face_table);
550 /** Return a realized face for ASCII characters from NUM number of
551 base faces pointed by FACES on the frame FRAME. */
554 mface__realize (MFrame *frame, MFace **faces, int num,
555 MSymbol language, MSymbol charset, int size)
557 MRealizedFace *rface;
558 MRealizedFont *rfont;
559 MFace merged_face = *(frame->face);
565 if (num == 0 && language == Mnil && charset == Mnil && frame->rface)
568 for (i = 0; i < MFACE_PROPERTY_MAX; i++)
569 for (j = num - 1; j >= 0; j--)
570 if (faces[j]->property[i])
572 merged_face.property[i] = faces[j]->property[i];
576 for (i = 0, tick = 0; i < num; i++)
577 tick += faces[i]->tick;
579 if (merged_face.property[MFACE_RATIO])
581 int font_size = (int) merged_face.property[MFACE_SIZE];
583 font_size *= (int) merged_face.property[MFACE_RATIO];
585 merged_face.property[MFACE_SIZE] = (void *) font_size;
588 if ((MSymbol) merged_face.property[MFACE_VIDEOMODE] == Mreverse)
590 MSymbol foreground = (MSymbol) merged_face.property[MFACE_FOREGROUND];
591 MSymbol background = (MSymbol) merged_face.property[MFACE_BACKGROUND];
593 merged_face.property[MFACE_FOREGROUND] = background;
594 merged_face.property[MFACE_BACKGROUND] = foreground;
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 mfont__get_metric (rfont, &g);
621 rface->space_width = g.width;
622 g.code = MCHAR_INVALID_CODE;
623 mfont__get_metric (rface->rfont, &g);
624 rface->ascent = g.ascent;
625 rface->descent = g.descent;
630 rface->space_width = frame->space_width;
633 rface->hline = (MFaceHLineProp *) props[MFACE_HLINE];
634 rface->box = (MFaceBoxProp *) props[MFACE_BOX];
635 rface->ascii_rface = rface;
636 mwin__realize_face (rface);
638 mplist_add (frame->realized_face_list, Mt, rface);
642 MSTRUCT_CALLOC (rface->nofont_rface, MERROR_FACE);
643 *rface->nofont_rface = *rface;
644 rface->nofont_rface->rfont = NULL;
647 rface->nofont_rface = rface;
654 mface__for_chars (MSymbol script, MSymbol language, MSymbol charset,
655 MGlyph *from_g, MGlyph *to_g, int size)
657 MRealizedFace *rface;
658 MRealizedFont *rfont;
659 int num = to_g - from_g, i;
661 rfont = mfont__lookup_fontset (from_g->rface->rfontset, from_g, &num,
662 script, language, charset, size);
665 from_g->rface = from_g->rface->nofont_rface;
668 rface = find_realized_face (from_g->rface->frame, &(from_g->rface->face),
672 MSTRUCT_MALLOC (rface, MERROR_FACE);
673 *rface = *from_g->rface->ascii_rface;
674 rface->rfont = rfont;
678 tmp.code = MCHAR_INVALID_CODE;
679 mfont__get_metric (rfont, &tmp);
680 rface->ascent = tmp.ascent;
681 rface->descent = tmp.descent;
683 mwin__realize_face (rface);
684 mplist_add (from_g->rface->frame->realized_face_list, Mt, rface);
687 for (i = 0; i < num; i++, from_g++)
688 from_g->rface = rface;
694 mface__free_realized (MRealizedFace *rface)
696 mwin__free_realized_face (rface);
697 if (rface == rface->ascii_rface)
699 if (! rface->nofont_rface)
702 free (rface->nofont_rface);
703 rface->nofont_rface = NULL;
709 #endif /* !FOR_DOXYGEN || DOXYGEN_INTERNAL_MODULE */
713 /*** @addtogroup m17nFace */
717 /***en @name Variables: Keys of face property */
718 /***ja @name ÊÑ¿ô: ¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ò»ØÄꤹ¤ëÄêµÁºÑ¤ß¥·¥ó¥Ü¥ë */
723 @brief Key of a face property specifying foreground color.
725 The variable #Mforeground is used as a key of face property. The
726 property value must be a symbol whose name is a color name, or
729 #Mnil means that the face does not specify a foreground color.
731 Otherwise, the foreground of an M-text is drawn by the specified
735 @brief Á°·Ê¿§¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥·¥ó¥Ü¥ë
737 ¥¡¼¤¬ #Mforeground ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢¥·¥ó¥Ü¥ë @c
738 Mnil ¤Ç¤¢¤ë¤«¡¢¤¢¤ë¤¤¤Ï¿§Ì¾¤ò̾Á°¤È¤·¤Æ»ý¤Ä¥·¥ó¥Ü¥ë¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é
739 ¤Ê¤¤¡£Á°¼Ô¤Î¾ì¹ç¡¢Á°·Ê¿§¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¸å¼Ô¤Î¾ì¹ç¤Ï¤½¤Î¥·¥ó¥Ü¥ë¤Î
740 ̾Á°¤Î¿§¤¬Á°·Ê¿§¤È¤Ê¤ë¡£ */
745 @brief Key of a face property specifying background color.
747 The variable #Mbackground is used as a key of face property. The
748 property value must be a symbol whose name is a color name, or
751 #Mnil means that the face does not specify a background color.
753 Otherwise, the background of an M-text is drawn by the specified
757 @brief ÇØ·Ê¿§¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥·¥ó¥Ü¥ë
759 ¥¡¼¤¬ #Mbackground ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢¥·¥ó¥Ü¥ë @c
760 Mnil ¤Ç¤¢¤ë¤«¡¢¤¢¤ë¤¤¤Ï¿§Ì¾¤ò̾Á°¤È¤·¤Æ»ý¤Ä¥·¥ó¥Ü¥ë¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é
761 ¤Ê¤¤¡£Á°¼Ô¤Î¾ì¹ç¡¢ÇØ·Ê¿§¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¸å¼Ô¤Î¾ì¹ç¤Ï¤½¤Î¥·¥ó¥Ü¥ë¤Î
762 ̾Á°¤Î¿§¤¬ÇØ·Ê¿§¤È¤Ê¤ë¡£ */
767 @brief Key of a face property specifying video mode.
769 The variable #Mvideomode is used as a key of face property. The
770 property value must be #Mnormal, #Mreverse, or #Mnil.
772 #Mnormal means that an M-text is drawn in normal video mode
773 (i.e. the foreground is drawn by foreground color, the background
774 is drawn by background color).
776 #Mreverse means that an M-text is drawn in reverse video mode
777 (i.e. the foreground is drawn by background color, the background
778 is drawn by foreground color).
780 #Mnil means that the face does not specify a video mode. */
783 @brief ¥Ó¥Ç¥ª¥â¡¼¥É¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥·¥ó¥Ü¥ë
785 ¥¡¼¤¬ #Mvideomode ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϥ·¥ó¥Ü¥ë¤Ç¤Ê¤±
786 ¤ì¤Ð¤Ê¤é¤Ê¤¤¡£¤â¤· #Mreverse ¤Î¾ì¹ç¤ÏÁ°·Ê¿§¤ÈÇطʼ￧¤òÆþ¤ìÂؤ¨
787 ¤ÆÍѤ¤¤ë¡£#Mnil ¤Î¾ì¹ç¤Ï¥Ó¥Ç¥ª¥â¡¼¥É¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£¤½¤ì°Ê³°¤Î¥·
788 ¥ó¥Ü¥ë¤Î¾ì¹çÁ°·Ê¿§¤ÈÇطʼ￧¤òÆþ¤ìÂؤ¨¤ò¹Ô¤Ê¤ï¤Ê¤¤¡£ */
793 @brief Key of a face property specifying font size ratio.
795 The variable #Mratio is used as a key of face property. The value
796 RATIO must be an integer.
798 The value @c NULL means that the face does not specify a
799 horizontal line. Otherwise, an M-text is drawn by a font of size
800 (FONTSIZE * RATIO / 100) where FONTSIZE is a font size specified
801 by the face property #Msize. */
806 @brief Key of a face property specifying horizontal line.
808 The variable #Mhline is used as a key of face property. The value
809 must be a pointer to an object of type #MFaceHLineProp, or @c
812 The value @c NULL means that the face does not specify this
813 property. Otherwise, an M-text is drawn with a horizontal line by
814 a way specified by the object that the value points to. */
817 @brief ²¼Àþ¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥·¥ó¥Ü¥ë
819 ¥¡¼¤¬ #Munderline ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢¥·¥ó¥Ü¥ë
820 #Mt, #Mnil, #Munspecified ¤Î¤¤¤º¤ì¤«¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£#Mt
821 ¤Î¾ì¹ç¤Ï²¼ÀþÉÕ¤¤Çɽ¼¨¤¹¤ë¡£#Mnil ¤Î¾ì¹ç¤Ï²¼Àþ¤òÉÕ¤±¤Ê¤¤¡£
822 #Munspecified ¤Î¾ì¹ç¤Ï¤É¤Á¤é¤È¤â»ØÄꤵ¤ì¤Ê¤¤¡£ */
827 @brief Key of a face property specifying box.
829 The variable #Mbox is used as a key of face property. The value
830 must be a pointer to an object of type #MFaceBoxProp, or @c NULL.
832 The value @c NULL means that the face does not specify a box.
833 Otherwise, an M-text is drawn with a surrounding box by a way
834 specified by the object that the value points to. */
837 @brief °Ï¤ßÏȤò»ØÄꤹ¤ë¤¿¤á¤Î¥·¥ó¥Ü¥ë
839 ¥¡¼¤¬ #Mbox ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢¥·¥ó¥Ü¥ë #Mt, @c
840 Mnil, #Munspecified ¤Î¤¤¤º¤ì¤«¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£#Mt ¤Î¾ì¹ç
841 ¤Ï°Ï¤ßÏÈÉÕ¤¤Çɽ¼¨¤¹¤ë¡£#Mnil ¤Î¾ì¹ç¤Ï°Ï¤ßÏȤòÉÕ¤±¤Ê¤¤¡£@c
842 Munspecified ¤Î¾ì¹ç¤Ï¤É¤Á¤é¤È¤â»ØÄꤵ¤ì¤Ê¤¤¡£ */
847 @brief Key of a face property specifying fontset.
849 The variable #Mfontset is used as a key of face property. The
850 value must be a pointer to an object of type #Mfontset, or @c
853 The value @c NULL means that the face does not specify a fontset.
854 Otherwise, an M-text is drawn with a font selected from what
855 specified in the fontset. */
858 @brief ¥Õ¥©¥ó¥È¥»¥Ã¥È¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥·¥ó¥Ü¥ë
860 ¥¡¼¤¬ #Mfontset ¤Ç¤¢¤ë¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢¥·¥ó¥Ü¥ë @c
861 Munspecified ¤Ç¤¢¤ë¤«¡¢¤µ¤â¤Ê¤¯¤Ð¥Õ¥©¥ó¥È¥»¥Ã¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±
862 ¤ì¤Ð¤Ê¤é¤Ê¤¤¡£Á°¼Ô¤Î¾ì¹ç¤Ï¥Õ¥©¥ó¥È¥»¥Ã¥È¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤ò¼¨
863 ¤·¡¢¸å¼Ô¤Î¾ì¹ç¤Ï¤½¤Î¥Ý¥¤¥ó¥¿¤Î»Ø¤¹¥Õ¥©¥ó¥È¥»¥Ã¥È¤¬¥Æ¥¥¹¥Èɽ¼¨¤ËÍÑ
869 @brief Key of a face property specifying hook.
871 The variable #Mhook_func is used as a key of face property. The
872 value must be a function of type #MFaceHookFunc, or @c NULL.
874 The value @c NULL means that the face does not specify a hook.
875 Otherwise, the specified function is called before the face is
881 @brief Key of a face property specifying argument of hook.
883 The variable #Mhook_arg is used as a key of face property. The
884 value can be anything that is passed a hook function specified by
885 the face property #Mhook_func. */
892 /*** @ingroup m17nFace */
893 /***en @name Variables: Possible values of #Mvideomode property of face */
898 See the documentation of the variable #Mvideomode. */
904 /*** @ingroup m17nFace */
905 /***en @name Variables: Predefined faces */
906 /***ja @name ÊÑ¿ô: ÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹ */
911 @brief Normal video face
913 The variable #mface_normal_video points to a face that has the
914 #Mvideomode property with value #Mnormal. The other properties
915 are not specified. An M-text drawn with this face appear normal
916 colors (i.e. the foreground is drawn by foreground color, and
917 background is drawn by background color). */
919 MFace *mface_normal_video;
922 @brief Reverse video face
924 The variable #mface_reverse_video points to a face that has the
925 #Mvideomode property with value #Mreverse. The other properties
926 are not specified. An M-text drawn with this face appear in
927 reversed colors (i.e. the foreground is drawn by background
928 color, and background is drawn by foreground color). */
931 @brief ¥ê¥Ð¡¼¥¹¥Õ¥§¡¼¥¹
933 ¥Ý¥¤¥ó¥¿ #maface_reverse ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Ï¡¢²¼
934 ¤Ë¼¨¤¹¤è¤¦¤Ê¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ò»ý¤Ä¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì
935 ¤¿ M-text ¤ÏÁ°·Ê¿§¤ÈÇØ·Ê¿§¤¬Æþ¤ìÂؤï¤ë¡£ */
937 MFace *mface_reverse_video;
940 @brief Underline face.
942 The variable #mface_underline points to a face that has the
943 #Mhline property with value a pointer to an object of type
944 #MFaceHLineProp. The members of the object are as follows:
949 type MFACE_HLINE_UNDER
954 The other properties are not specified. An M-text that has this
955 face is drawn with an underline. */
957 MFace *mface_underline;
962 The variable #mface_medium points to a face that has the #Mweight
963 property with value a symbol of name "medium". The other
964 properties are not specified. An M-text that has this face is
965 drawn with a font of medium weight. */
971 The variable #mface_bold points to a face that has the #Mweight
972 property with value a symbol of name "bold". The other properties
973 are not specified. An M-text that has this face is drawn with a
974 font of bold weight. */
977 @brief ¥Ü¡¼¥ë¥É¥Õ¥§¡¼¥¹
979 ¥Ý¥¤¥ó¥¿ #mface_bold ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Ï¡¢weight
980 ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ¥Ü¡¼¥ë¥ÉÂΤò°ÕÌ£¤¹¤ë¥·¥¹¥Æ¥à°Í¸¤Î¥·¥ó¥Ü¥ë¤ò»ý
981 ¤Ä¡£Â¾¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϲ¼¤Ë¼¨¤¹¤È¤ª¤ê¤Ç¤¢¤ë¡£¤³¤Î¥Õ¥§¡¼¥¹
982 ¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤Ï¥Ü¡¼¥ë¥ÉÂΤȤʤ롣 */
989 The variable #mface_italic points to a face that has the #Mstyle
990 property with value a symbol of name "italic". The other
991 properties are not specified. An M-text that has this face is
992 drawn with a font of italic style. */
995 @brief ¥¤¥¿¥ê¥Ã¥¯¥Õ¥§¡¼¥¹
997 ¥Ý¥¤¥ó¥¿ #mface_italic ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Ï¡¢style
998 ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ¥¤¥¿¥ê¥Ã¥¯ÂΤò°ÕÌ£¤¹¤ë¥·¥¹¥Æ¥à°Í¸¤Î¥·¥ó¥Ü¥ë¤ò
999 »ý¤Ä¡£Â¾¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϲ¼¤Ë¼¨¤¹Ä̤ê¤Ç¤¢¤ë¡£¤³¤Î¥Õ¥§¡¼¥¹
1000 ¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤Ï¥¤¥¿¥ê¥Ã¥¯ÂΤȤʤ롣 */
1002 MFace *mface_italic;
1005 @brief Bold italic face
1007 The variable #mface_bold_italic points to a face that has the
1008 #Mweight property with value a symbol of name "bold", and #Mstyle
1009 property with value a symbol of name "italic". The other
1010 properties are not specified. An M-text that has this face is
1011 drawn with a font of bold weight and italic style. */
1014 @brief ¥Ü¡¼¥ë¥É¥¤¥¿¥ê¥Ã¥¯¥Õ¥§¡¼¥¹
1016 ¥Ý¥¤¥ó¥¿ #mface_bold_italic ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Î
1017 ¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Ï¡¢weight ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ¥Ü¡¼¥ë¥ÉÂΤò°ÕÌ£
1018 ¤¹¤ë¥·¥¹¥Æ¥à°Í¸¤Î¥·¥ó¥Ü¥ë¤ò¡¢style ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ¥¤¥¿¥ê¥Ã¥¯
1019 ÂΤò°ÕÌ£¤¹¤ë¥·¥¹¥Æ¥à°Í¸¤Î¥·¥ó¥Ü¥ë¤ò¡¢¤½¤ì°Ê³°¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£
1020 ¤ÎÃͤȤ·¤Æ²¼¤Ë¼¨¤¹¤â¤Î¤ò¤½¤ì¤¾¤ì»ý¤Ä¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì
1021 ¤¿ M-text ¤Ï¥Ü¡¼¥ë¥É¥¤¥¿¥ê¥Ã¥¯ÂΤȤʤ롣 */
1023 MFace *mface_bold_italic;
1026 @brief Smallest face
1028 The variable #mface_xx_small points to a face that has the #Mratio
1029 property with value 50. The other properties are not specified.
1030 An M-text that has this face is drawn with a font whose size is
1031 50% of a normal font. */
1034 @brief ºÇ¾®¤Î¥Õ¥§¡¼¥¹
1036 ¥Ý¥¤¥ó¥¿ #mface_xx_small ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Ï¡¢²¼
1037 ¤Ë¼¨¤¹¤è¤¦¤Ê¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ò»ý¤Ä¡£¤³¤³¤Ç @c N ¤Ï @c
1038 mface_normalsize ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Î size ¥×¥í¥Ñ¥Æ¥£
1039 ¤ÎÃͤǤ¢¤ë¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÂ礤µ¤Ï¡¢ @c
1040 mface_normalsize ¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÂ礤µ¤Î 50% ¤Ë¤Ê¤ë¡£
1043 MFace *mface_xx_small;
1048 The variable #mface_x_small points to a face that has the #Mratio
1049 property with value 66. The other properties are not specified.
1050 An M-text that has this face is drawn with a font whose size is
1051 66% of a normal font. */
1054 @brief ¤è¤ê¾®¤µ¤¤¥Õ¥§¡¼¥¹
1056 ¥Ý¥¤¥ó¥¿ #mface_x_small ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Ï¡¢²¼
1057 ¤Ë¼¨¤¹¤è¤¦¤Ê¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ò»ý¤Ä¡£¤³¤³¤Ç @c N ¤Ï
1058 #mface_normalsize ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Î size ¥×¥í¥Ñ¥Æ¥£
1059 ¤ÎÃͤǤ¢¤ë¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÂ礤µ¤Ï¡¢
1060 #mface_normalsize ¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÂ礤µ¤Î 66% ¤Ë¤Ê¤ë¡£
1063 MFace *mface_x_small;
1068 The variable #mface_x_small points to a face that has the #Mratio
1069 property with value 75. The other properties are not specified.
1070 An M-text that has this face is drawn with a font whose size is
1071 75% of a normal font. */
1074 @brief ¾®¤µ¤¤¥Õ¥§¡¼¥¹
1076 ¥Ý¥¤¥ó¥¿ #mface_small ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Ï¡¢²¼
1077 ¤Ë¼¨¤¹¤è¤¦¤Ê¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ò»ý¤Ä¡£¤³¤³¤Ç @c N ¤Ï
1078 #mface_normalsize ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Î size ¥×¥í¥Ñ¥Æ¥£
1079 ¤ÎÃͤǤ¢¤ë¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÂ礤µ¤Ï¡¢
1080 #mface_normalsize ¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÂ礤µ¤Î 75% ¤Ë¤Ê¤ë¡£
1086 @brief Normalsize face
1088 The variable #mface_normalsize points to a face that has the
1089 #Mratio property with value 100. The other properties are not
1090 specified. An M-text that has this face is drawn with a font
1091 whose size is the same as a normal font. */
1094 @brief ɸ½à¤ÎÂ礤µ¤Î¥Õ¥§¡¼¥¹
1096 ¥Ý¥¤¥ó¥¿ #mface_normalsize ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Ï¡¢²¼¤Ë
1097 ¼¨¤¹¤è¤¦¤Ê¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ò»ý¤Ä¡£¤³¤³¤Ç @c N ¤Ï¥Ý¥¤¥ó¥È¥µ¥¤¥º¤ò
1098 ɽ¤ï¤¹À°¿ô¤Ç¤¢¤ë¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÂ礤µ¤Ï¡¢
1099 ¥Ç¥Õ¥©¥ë¥È¥Õ¥ì¡¼¥à¤Î¥Ç¥Õ¥©¥ë¥È¥Õ¥©¥ó¥È¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤Î
1102 MFace *mface_normalsize;
1107 The variable #mface_large points to a face that has the #Mratio
1108 property with value 120. The other properties are not specified.
1109 An M-text that has this face is drawn with a font whose size is
1110 120% of a normal font. */
1113 @brief Â礤¤¥Õ¥§¡¼¥¹
1115 ¥Ý¥¤¥ó¥¿ #mface_large ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Ï¡¢²¼
1116 ¤Ë¼¨¤¹¤è¤¦¤Ê¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ò»ý¤Ä¡£¤³¤³¤Ç @c N ¤Ï
1117 #mface_normalsize ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Î size ¥×¥í¥Ñ¥Æ¥£
1118 ¤ÎÃͤǤ¢¤ë¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÂ礤µ¤Ï¡¢
1119 #mface_normalsize ¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÂ礤µ¤Î 120% ¤Ë¤Ê¤ë¡£
1127 The variable #mface_x_large points to a face that has the #Mratio
1128 property with value 150. The other properties are not specified.
1129 An M-text that has this face is drawn with a font whose size is
1130 150% of a normal font. */
1133 @brief ¤è¤êÂ礤¤¥Õ¥§¡¼¥¹
1135 ¥Ý¥¤¥ó¥¿ #mface_x_large ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Ï¡¢²¼
1136 ¤Ë¼¨¤¹¤è¤¦¤Ê¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ò»ý¤Ä¡£¤³¤³¤Ç @c N ¤Ï
1137 #mface_normalsize ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Î size ¥×¥í¥Ñ¥Æ¥£
1138 ¤ÎÃͤǤ¢¤ë¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÂ礤µ¤Ï¡¢
1139 #mface_normalsize ¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÂ礤µ¤Î 150% ¤Ë¤Ê¤ë¡£
1142 MFace *mface_x_large;
1147 The variable #mface_xx_large points to a face that has the #Mratio
1148 property with value 200. The other properties are not specified.
1149 An M-text that has this face is drawn with a font whose size is
1150 200% of a normal font. */
1153 @brief ºÇÂç¤Î¥Õ¥§¡¼¥¹
1155 ¥Ý¥¤¥ó¥¿ #mface_xx_large ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Ï¡¢²¼
1156 ¤Ë¼¨¤¹¤è¤¦¤Ê¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ò»ý¤Ä¡£¤³¤³¤Ç @c N ¤Ï
1157 #mface_normalsize ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Î size ¥×¥í¥Ñ¥Æ¥£
1158 ¤ÎÃͤǤ¢¤ë¡£¤³¤Î¥Õ¥§¡¼¥¹¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÂ礤µ¤Ï¡¢
1159 #mface_normalsize ¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÂ礤µ¤Î 200% ¤Ë¤Ê¤ë¡£
1162 MFace *mface_xx_large;
1167 The variable #mface_black points to a face that has the
1168 #Mforeground property with value a symbol of name "black". The
1169 other properties are not specified. An M-text that has this face
1170 is drawn with black foreground. */
1175 ¥Ý¥¤¥ó¥¿ #mface_black ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Ï¡¢
1176 #Mforeground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ<tt>"black"</tt> ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü
1177 ¥ë¤ò»ý¤Ä¡£Â¾¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϲ¼¤Ë¼¨¤¹¤È¤ª¤ê¤Ç¤¢¤ë¡£¤³¤Î
1178 ¥Õ¥§¡¼¥¹¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÁ°·Ê¿§¤Ï¹õ¤Ë¤Ê¤ë¡£ */
1185 The variable #mface_white points to a face that has the
1186 #Mforeground property with value a symbol of name "white". The
1187 other properties are not specified. An M-text that has this face
1188 is drawn with white foreground. */
1193 ¥Ý¥¤¥ó¥¿ #mface_white ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Ï¡¢
1194 foreground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ<tt>"white"</tt> ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü
1195 ¥ë¤ò»ý¤Ä¡£Â¾¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϲ¼¤Ë¼¨¤¹¤È¤ª¤ê¤Ç¤¢¤ë¡£¤³¤Î
1196 ¥Õ¥§¡¼¥¹¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÁ°·Ê¿§¤ÏÇò¤Ë¤Ê¤ë¡£ */
1203 The variable #mface_red points to a face that has the
1204 #Mforeground property with value a symbol of name "red". The
1205 other properties are not specified. An M-text that has this face
1206 is drawn with red foreground. */
1211 ¥Ý¥¤¥ó¥¿ #mface_red ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Ï¡¢
1212 foreground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ<tt>"red"</tt> ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü
1213 ¥ë¤ò»ý¤Ä¡£Â¾¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϲ¼¤Ë¼¨¤¹¤È¤ª¤ê¤Ç¤¢¤ë¡£¤³¤Î
1214 ¥Õ¥§¡¼¥¹¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÁ°·Ê¿§¤ÏÀ֤ˤʤ롣 */
1221 The variable #mface_green points to a face that has the
1222 #Mforeground property with value a symbol of name "green". The
1223 other properties are not specified. An M-text that has this face
1224 is drawn with green foreground. */
1229 ¥Ý¥¤¥ó¥¿ #mface_green ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Ï¡¢
1230 foreground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ<tt>"green"</tt> ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü
1231 ¥ë¤ò»ý¤Ä¡£Â¾¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϲ¼¤Ë¼¨¤¹¤È¤ª¤ê¤Ç¤¢¤ë¡£¤³¤Î
1232 ¥Õ¥§¡¼¥¹¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÁ°·Ê¿§¤ÏÎФˤʤ롣 */
1239 The variable #mface_blue points to a face that has the
1240 #Mforeground property with value a symbol of name "blue". The
1241 other properties are not specified. An M-text that has this face
1242 is drawn with blue foreground. */
1247 ¥Ý¥¤¥ó¥¿ #mface_blue ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Ï¡¢
1248 foreground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ<tt>"blue"</tt> ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü
1249 ¥ë¤ò»ý¤Ä¡£Â¾¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϲ¼¤Ë¼¨¤¹¤È¤ª¤ê¤Ç¤¢¤ë¡£¤³¤Î
1250 ¥Õ¥§¡¼¥¹¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÁ°·Ê¿§¤ÏÀĤˤʤ롣 */
1257 The variable #mface_cyan points to a face that has the
1258 #Mforeground property with value a symbol of name "cyan". The
1259 other properties are not specified. An M-text that has this face
1260 is drawn with cyan foreground. */
1263 @brief ¥·¥¢¥ó¥Õ¥§¡¼¥¹
1265 ¥Ý¥¤¥ó¥¿ #mface_cyan ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Ï¡¢
1266 foreground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ<tt>"cyan"</tt> ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü
1267 ¥ë¤ò»ý¤Ä¡£Â¾¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϲ¼¤Ë¼¨¤¹¤È¤ª¤ê¤Ç¤¢¤ë¡£¤³¤Î
1268 ¥Õ¥§¡¼¥¹¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÁ°·Ê¿§¤Ï¥·¥¢¥ó¤Ë¤Ê¤ë¡£ */
1275 The variable #mface_yellow points to a face that has the
1276 #Mforeground property with value a symbol of name "yellow". The
1277 other properties are not specified. An M-text that has this face
1278 is drawn with yellow foreground. */
1283 ¥Ý¥¤¥ó¥¿ #mface_yellow ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Ï¡¢
1284 foreground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ<tt>"yellow"</tt> ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü
1285 ¥ë¤ò»ý¤Ä¡£Â¾¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϲ¼¤Ë¼¨¤¹¤È¤ª¤ê¤Ç¤¢¤ë¡£¤³¤Î
1286 ¥Õ¥§¡¼¥¹¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÁ°·Ê¿§¤Ï²«¿§¤Ë¤Ê¤ë¡£ */
1288 MFace *mface_yellow;
1294 The variable #mface_magenta points to a face that has the
1295 #Mforeground property with value a symbol of name "magenta". The
1296 other properties are not specified. An M-text that has this face
1297 is drawn with magenta foreground. */
1300 @brief ¥Þ¥¼¥ó¥¿¥Õ¥§¡¼¥¹
1302 ¥Ý¥¤¥ó¥¿ #mface_magenta ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ëÄêµÁºÑ¤ß¥Õ¥§¡¼¥¹¤Ï¡¢
1303 foreground ¥×¥í¥Ñ¥Æ¥£¤ÎÃͤȤ·¤Æ<tt>"magenta"</tt> ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü
1304 ¥ë¤ò»ý¤Ä¡£Â¾¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϲ¼¤Ë¼¨¤¹¤È¤ª¤ê¤Ç¤¢¤ë¡£¤³¤Î
1305 ¥Õ¥§¡¼¥¹¤ò»È¤Ã¤Æɽ¼¨¤µ¤ì¤¿ M-text ¤ÎÁ°·Ê¿§¤Ï¥Þ¥¼¥ó¥¿¤Ë¤Ê¤ë¡£ */
1307 MFace *mface_magenta;
1312 /***en @name Variables: The other symbols for face handling. */
1313 /***ja @name ÊÑ¿ô: ¥Õ¥§¡¼¥¹¤ò¼è¤ê°·¤¦¤¿¤á¤Î¤½¤Î¾¤ÎÄêµÁºÑ¤ß¥·¥ó¥Ü¥ë */
1318 @brief Key of a text property specifying a face.
1320 The variable #Mface is a symbol of name <tt>"face"</tt>. A text
1321 property whose key is this symbol must have a pointer to an object
1322 of type #MFace. This is a managing key. */
1325 @brief ¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤È¤Ê¤ë¥·¥ó¥Ü¥ë
1327 ¥·¥ó¥Ü¥ë #Mface ¤Ï <tt>"face"</tt> ¤È¤¤¤¦Ì¾Á°¤ò»ý¤Ä¡£¥¡¼¤¬ @c
1328 Mface ¤Ç¤¢¤ë¤è¤¦¤Ê¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤ÎÃͤϡ¢¥Õ¥§¡¼¥¹¥ª¥Ö¥¸¥§¥¯¥È¤Ø
1329 ¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ */
1337 @brief Create a new face.
1339 The mface () function creates a new face object that specifies no
1343 This function returns a pointer to the created face. */
1346 @brief ¿·¤·¤¤¥Õ¥§¡¼¥¹¤ò¤Ä¤¯¤ë
1348 ´Ø¿ô mface () ¤Ï¿·¤·¤¤¥Õ¥§¡¼¥¹¥ª¥Ö¥¸¥§¥¯¥È¤òºî¤ë¡£
1349 ºî¤é¤ì¤¿¥Õ¥§¡¼¥¹¤Î¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤ë¡£
1351 @li ¥¡¼ #Mfontset ¤ËÂФ¹¤ëÃÍ¤Ï @c NULL
1352 @li ¥¡¼ #Msize ¤ËÂФ¹¤ëÃÍ¤Ï 0
1353 @li ¤½¤Î¾¤Î¥¡¼¤ËÂФ¹¤ëÃÍ¤Ï #Munspecified */
1360 M17N_OBJECT (face, free_face, MERROR_FACE);
1361 M17N_OBJECT_REGISTER (face_table, face);
1368 @brief Make a copy of a face.
1370 The mface_copy () function makes a copy of $FACE and returns a
1371 pointer to the created copy. */
1374 @brief ¥Õ¥§¡¼¥¹¤Î¥³¥Ô¡¼¤òºî¤ë
1376 ´Ø¿ô mface_copy () ¤Ï¥Õ¥§¡¼¥¹ $FACE ¤Î¥³¥Ô¡¼¤òºî¤ê¡¢¤½¤ì¤Ø¤Î¥Ý¥¤¥ó
1380 mface_copy (MFace *face)
1384 MSTRUCT_CALLOC (copy, MERROR_FACE);
1386 copy->control.ref_count = 1;
1387 M17N_OBJECT_REGISTER (face_table, copy);
1388 if (copy->property[MFACE_FONTSET])
1389 M17N_OBJECT_REF (copy->property[MFACE_FONTSET]);
1390 if (copy->property[MFACE_HLINE])
1392 MFaceHLineProp *val;
1394 MSTRUCT_MALLOC (val, MERROR_FACE);
1395 *val = *((MFaceHLineProp *) copy->property[MFACE_HLINE]);
1396 copy->property[MFACE_HLINE] = val;
1398 if (copy->property[MFACE_BOX])
1402 MSTRUCT_MALLOC (val, MERROR_FACE);
1403 *val = *((MFaceBoxProp *) copy->property[MFACE_BOX]);
1404 copy->property[MFACE_BOX] = val;
1414 The mface_merge () functions merges the properties of face $SRC
1418 This function returns $DST. */
1421 mface_merge (MFace *dst, MFace *src)
1425 for (i = 0; i < MFACE_PROPERTY_MAX; i++)
1426 if (src->property[i])
1428 dst->property[i] = src->property[i];
1429 if (i == MFACE_FONTSET)
1430 M17N_OBJECT_REF (dst->property[i]);
1431 else if (i == MFACE_HLINE)
1433 MFaceHLineProp *val;
1435 MSTRUCT_MALLOC (val, MERROR_FACE);
1436 *val = *((MFaceHLineProp *) dst->property[MFACE_HLINE]);
1437 dst->property[MFACE_HLINE] = val;
1439 else if (i == MFACE_BOX)
1443 MSTRUCT_MALLOC (val, MERROR_FACE);
1444 *val = *((MFaceBoxProp *) dst->property[MFACE_BOX]);
1445 dst->property[MFACE_BOX] = val;
1454 @brief Make a face from a font.
1456 The mface_from_font () function return a newly created face while
1457 reflecting the properties of $FONT in its properties. */
1460 mface_from_font (MFont *font)
1462 MFace *face = mface ();
1464 face->property[MFACE_FOUNDRY] = mfont_get_prop (font, Mfoundry);
1465 face->property[MFACE_FAMILY] = mfont_get_prop (font, Mfamily);
1466 face->property[MFACE_WEIGHT] = mfont_get_prop (font, Mweight);
1467 face->property[MFACE_STYLE] = mfont_get_prop (font, Mstyle);
1468 face->property[MFACE_STRETCH] = mfont_get_prop (font, Mstretch);
1469 face->property[MFACE_ADSTYLE] = mfont_get_prop (font, Madstyle);
1470 face->property[MFACE_SIZE] = mfont_get_prop (font, Msize);
1477 @brief Get the value of a face property.
1479 The mface_get_prop () function returns the value of the face
1480 property whose key is $KEY in face $FACE. $KEY must be one of the
1483 #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
1484 #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
1485 #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg
1488 The actual type of the returned value depends of $KEY. See
1489 documentation of the above keys. If an error is detected, it
1490 returns @c NULL and assigns an error code to the external variable
1494 @brief ¥Õ¥§¡¼¥¹¤Î¥×¥í¥Ñ¥Æ¥£ÃͤòÆÀ¤ë
1496 ´Ø¿ô mface_get_prop () ¤Ï¡¢¥Õ¥§¡¼¥¹ $FACE ¤¬»ý¤Ä¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£
1497 ¤ÎÆâ¡¢¥¡¼¤¬ $KEY ¤Ç¤¢¤ë¤â¤Î¤ÎÃͤòÊÖ¤¹¡£$KEY ¤Ï²¼µ¤Î¤¤¤º¤ì¤«¤Ç¤Ê
1500 #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
1501 #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
1502 #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg
1505 ¤â¤· $KEY ¤¬ #Mfontset ¤Ê¤é¤Ð¡¢mface_get_prop () ¤Ï¥Õ¥©¥ó¥È¥»¥Ã
1506 ¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£¤â¤· $KEY ¤¬ #Msize ¤Ê¤é¤ÐÀ°¿ô¤òÊÖ¤¹¡£¤½¤ì
1507 °Ê³°¤Î¾ì¹ç¤Ï¥·¥ó¥Ü¥ë¤òÊÖ¤¹¡£¥¨¥é¡¼¤¬¸¡½Ð¤µ¤ì¤¿¾ì¹ç¤Ï @c NULL ¤òÊÖ
1508 ¤·¡¢³°ÉôÊÑ¿ô #merror_code ¤Ë¥¨¥é¡¼¥³¡¼¥É¤òÀßÄꤹ¤ë¡£ */
1518 mface_get_prop (MFace *face, MSymbol key)
1520 int index = (int) msymbol_get (key, M_face_prop_index) - 1;
1523 MERROR (MERROR_FACE, NULL);
1524 return face->property[index];
1530 @brief Set a value of a face face property.
1532 The mface_put_prop () function assigns $VAL to the property whose
1533 key is $KEY in face $FACE. $KEY must be one the followings:
1535 #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
1536 #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
1537 #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg
1539 Among them, font related properties (#Mfoundry through #Msize) are
1540 used as the default values when a font in the fontset of $FACE
1541 does not specify those values.
1543 The actual type of the returned value depends of $KEY. See
1544 documentation of the above keys.
1547 If the operation was successful, mface_put_prop returns () 0.
1548 Otherwise it returns -1 and assigns an error code to the external
1549 variable #merror_code. */
1552 @brief ¥Õ¥§¡¼¥¹¥×¥í¥Ñ¥Æ¥£¤ÎÃͤòÀßÄꤹ¤ë
1554 ´Ø¿ô mface_put_prop () ¤Ï¡¢¥Õ¥§¡¼¥¹ $FACE Æâ¤Ç¥¡¼¤¬$KEY ¤Ç¤¢¤ë¥×
1555 ¥í¥Ñ¥Æ¥£¤ÎÃͤò $VAL ¤ËÀßÄꤹ¤ë¡£$KEY ¤Ï°Ê²¼¤Î¤¤¤º¤ì¤«¤Ç¤Ê¤¯¤Æ¤Ï¤Ê
1558 #Mforeground, #Mbackground, #Mvideomode, #Mhline, #Mbox,
1559 #Mfoundry, #Mfamily, #Mweight, #Mstyle, #Mstretch, #Madstyle,
1560 #Msize, #Mfontset, #Mratio, #Mhook_func, #Mhook_arg.
1562 ¤³¤ì¤é¤Î¤¦¤Á¤Î¡¢¥Õ¥©¥ó¥È´ØÏ¢¤Î¥×¥í¥Ñ¥Æ¥£ (#Mfamily ¤«¤é #Msize
1563 ¤Þ¤Ç) ¤Ï¡¢¥Õ¥§¡¼¥¹¤Î¥Õ¥©¥ó¥È¥»¥Ã¥ÈÃæ¤Î¥Õ¥©¥ó¥È¤Ë´Ø¤¹¤ë¥Ç¥Õ¥©¥ë¥ÈÃÍ
1566 ¤â¤· $KEY ¤¬ #Mfontset ¤Ê¤é $VAL ¤Ï #MFontset ·¿¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç
1567 ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£¤â¤· $KEY ¤¬ #Msize ¤Ê¤é¤Ð $VAL ¤ÏÀ°¿ô¤Ç¤Ê¤±¤ì
1568 ¤Ð¤Ê¤é¤Ê¤¤¡£$KEY ¤¬¤½¤ì°Ê³°¤Î¾ì¹ç¡¢$VAL ¤Ï¥·¥ó¥Ü¥ë¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê
1572 ½èÍý¤¬À®¸ù¤·¤¿¾ì¹ç¡¢mface_put_prop () ¤Ï 0 ¤òÊÖ¤¹¡£¼ºÇÔ¤·¤¿¾ì¹ç¤Ï
1573 -1 ¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô #merror_code ¤Ë¥¨¥é¡¼¥³¡¼¥É¤òÀßÄꤹ¤ë¡£ */
1583 mface_put_prop (MFace *face, MSymbol key, void *val)
1585 int index = (int) msymbol_get (key, M_face_prop_index) - 1;
1588 MERROR (MERROR_FACE, -1);
1589 if (key == Mfontset)
1590 M17N_OBJECT_REF (val);
1591 else if (key == Mhline)
1593 MFaceHLineProp *newval;
1595 MSTRUCT_MALLOC (newval, MERROR_FACE);
1596 *newval = *((MFaceHLineProp *) val);
1599 else if (key == Mbox)
1601 MFaceBoxProp *newval;
1603 MSTRUCT_MALLOC (newval, MERROR_FACE);
1604 *newval = *((MFaceBoxProp *) val);
1607 face->property[index] = val;
1616 @brief Update a face.
1618 The mface_update () function update $FACE on $FRAME by calling a
1619 hook function of $FACE (if any). */
1622 mface_update (MFrame *frame, MFace *face)
1624 MFaceHookFunc func = (MFaceHookFunc) face->property[MFACE_HOOK_FUNC];
1626 MRealizedFace *rface;
1630 MPLIST_DO (rface_list, frame->realized_face_list)
1632 rface = MPLIST_VAL (rface_list);
1633 if ((MFaceHookFunc) rface->face.property[MFACE_HOOK_FUNC] == func)
1634 (func) (&(rface->face), rface->face.property[MFACE_HOOK_ARG],
1644 /*** @addtogroup m17nDebug */
1651 The mdebug_dump_face () function prints $FACE in a human readable
1652 way to the stderr. $INDENT specifies how many columns to indent
1653 the lines but the first one.
1656 This function returns $FACE. */
1659 mdebug_dump_face (MFace *face, int indent)
1661 char *prefix = (char *) alloca (indent + 1);
1664 memset (prefix, 32, indent);
1666 mfont__set_spec_from_face (&spec, face);
1667 fprintf (stderr, "(face font:\"");
1668 mdebug_dump_font (&spec);
1669 fprintf (stderr, "\"\n %s fore:%s back:%s", prefix,
1670 msymbol_name ((MSymbol) face->property[MFACE_FOREGROUND]),
1671 msymbol_name ((MSymbol) face->property[MFACE_BACKGROUND]));
1672 if (face->property[MFACE_FONTSET])
1673 fprintf (stderr, " non-default-fontset");
1674 fprintf (stderr, " hline:%s", face->property[MFACE_HLINE] ? "yes" : "no");
1675 fprintf (stderr, " box:%s)", face->property[MFACE_BOX] ? "yes" : "no");