Main Page
Modules
Data Structures
Globals
Appendix
A face is an object to control appearance of M-text.
More...
Detailed Description
A face is an object of the type MFace and controls how to draw M-texts. A face has a fixed number of face properties. Like other types of properties, a face property consists of a key and a value. A key is one of the following symbols:
Mforeground, Mbackground, Mvideomode, Mhline, Mbox, Mfoundry, Mfamily, Mweight, Mstyle, Mstretch, Madstyle, Msize, Mfontset, Mratio, Mhook_func, Mhook_arg
"The face property that belongs to face F and whose key is @c xxx" may be shortened to "the xxx property of F".
The M-text drawing functions first search an M-text for the text property whose key is the symbol Mface, then draw the M-text using the value of that text property. This value must be a pointer to a face object.
If there are multiple text properties whose key is Mface
, and they are not conflicting one another, properties of those faces are merged and used.
If no faces specify a certain property, the value of the default face is used.
Typedef Documentation
|
The type MFace is the structure of face objects. The internal structure is concealed from application code. |
|
The type MFaceHookFunc is to specify the #Mhook property of a face. The value of the property must be function of this type. |
Function Documentation
|
The mface() function creates a new face object that specifies no property.
- Return value:
- This function returns a pointer to the created face.
|
|
The mface_copy() function makes a copy of face and returns a pointer to the created copy. |
|
The mface_merge() functions merges the properties of face src into dst.
- Return value:
- This function returns dst.
|
|
The mface_from_font() function return a newly created face while reflecting the properties of font in its properties. |
|
The mface_get_prop() function returns the value of the face property whose key is key in face face. key must be one of the followings:
Mforeground, Mbackground, Mvideomode, Mhline, Mbox, Mfoundry, Mfamily, Mweight, Mstyle, Mstretch, Madstyle, Msize, Mfontset, Mratio, Mhook_func, Mhook_arg
- Return value:
- The actual type of the returned value depends of key. See documentation of the above keys. If an error is detected, it returns
NULL and assigns an error code to the external variable merror_code.
- See Also:
- mface_put_prop()
- Errors:
MERROR_FACE
|
int mface_put_prop |
( |
MFace * |
face, |
|
|
MSymbol |
key, |
|
|
void * |
val |
|
) |
|
|
|
The mface_put_prop() function assigns val to the property whose key is key in face face. key must be one the followings:
Mforeground, Mbackground, Mvideomode, Mhline, Mbox, Mfoundry, Mfamily, Mweight, Mstyle, Mstretch, Madstyle, Msize, Mfontset, Mratio, Mhook_func, Mhook_arg
Among them, font related properties (Mfoundry through Msize) are used as the default values when a font in the fontset of face does not specify those values.
The actual type of the returned value depends of key. See documentation of the above keys.
- Return value:
- If the operation was successful, mface_put_prop returns() 0. Otherwise it returns -1 and assigns an error code to the external variable merror_code.
- See Also:
- mface_get_prop()
- Errors:
MERROR_FACE
|
|
The mface_update() function update face on frame by calling a hook function of face (if any). |
Variable Documentation
|
The variable Mforeground is used as a key of face property. The property value must be a symbol whose name is a color name, or Mnil.
Mnil means that the face does not specify a foreground color.
Otherwise, the foreground of an M-text is drawn by the specified color. |
|
The variable Mbackground is used as a key of face property. The property value must be a symbol whose name is a color name, or Mnil.
Mnil means that the face does not specify a background color.
Otherwise, the background of an M-text is drawn by the specified color. |
|
The variable Mvideomode is used as a key of face property. The property value must be Mnormal, Mreverse, or Mnil.
Mnormal means that an M-text is drawn in normal video mode (i.e. the foreground is drawn by foreground color, the background is drawn by background color).
Mreverse means that an M-text is drawn in reverse video mode (i.e. the foreground is drawn by background color, the background is drawn by foreground color).
Mnil means that the face does not specify a video mode. |
|
The variable Mratio is used as a key of face property. The value RATIO must be an integer.
The value NULL means that the face does not specify a horizontal line. Otherwise, an M-text is drawn by a font of size (FONTSIZE * RATIO / 100) where FONTSIZE is a font size specified by the face property Msize. |
|
The variable Mhline is used as a key of face property. The value must be a pointer to an object of type MFaceHLineProp, or NULL .
The value NULL means that the face does not specify this property. Otherwise, an M-text is drawn with a horizontal line by a way specified by the object that the value points to. |
|
The variable Mbox is used as a key of face property. The value must be a pointer to an object of type MFaceBoxProp, or NULL .
The value NULL means that the face does not specify a box. Otherwise, an M-text is drawn with a surrounding box by a way specified by the object that the value points to. |
|
The variable Mfontset is used as a key of face property. The value must be a pointer to an object of type Mfontset, or NULL .
The value NULL means that the face does not specify a fontset. Otherwise, an M-text is drawn with a font selected from what specified in the fontset. |
|
The variable Mhook_func is used as a key of face property. The value must be a function of type MFaceHookFunc, or NULL .
The value NULL means that the face does not specify a hook. Otherwise, the specified function is called before the face is realized. |
|
The variable Mhook_arg is used as a key of face property. The value can be anything that is passed a hook function specified by the face property Mhook_func. |
|
The variable mface_normal_video points to a face that has the Mvideomode property with value Mnormal. The other properties are not specified. An M-text drawn with this face appear normal colors (i.e. the foreground is drawn by foreground color, and background is drawn by background color). |
|
The variable mface_reverse_video points to a face that has the Mvideomode property with value Mreverse. The other properties are not specified. An M-text drawn with this face appear in reversed colors (i.e. the foreground is drawn by background color, and background is drawn by foreground color). |
|
The variable mface_underline points to a face that has the Mhline property with value a pointer to an object of type MFaceHLineProp. The members of the object are as follows:
member value
----- -----
type MFACE_HLINE_UNDER
width 1
color Mnil
The other properties are not specified. An M-text that has this face is drawn with an underline. |
|
The variable mface_medium points to a face that has the Mweight property with value a symbol of name "medium". The other properties are not specified. An M-text that has this face is drawn with a font of medium weight. |
|
The variable mface_bold points to a face that has the Mweight property with value a symbol of name "bold". The other properties are not specified. An M-text that has this face is drawn with a font of bold weight. |
|
The variable mface_italic points to a face that has the Mstyle property with value a symbol of name "italic". The other properties are not specified. An M-text that has this face is drawn with a font of italic style. |
|
The variable mface_bold_italic points to a face that has the Mweight property with value a symbol of name "bold", and Mstyle property with value a symbol of name "italic". The other properties are not specified. An M-text that has this face is drawn with a font of bold weight and italic style. |
|
The variable mface_xx_small points to a face that has the Mratio property with value 50. The other properties are not specified. An M-text that has this face is drawn with a font whose size is 50% of a normal font. |
|
The variable mface_x_small points to a face that has the Mratio property with value 66. The other properties are not specified. An M-text that has this face is drawn with a font whose size is 66% of a normal font. |
|
The variable mface_x_small points to a face that has the Mratio property with value 75. The other properties are not specified. An M-text that has this face is drawn with a font whose size is 75% of a normal font. |
|
The variable mface_normalsize points to a face that has the Mratio property with value 100. The other properties are not specified. An M-text that has this face is drawn with a font whose size is the same as a normal font. |
|
The variable mface_large points to a face that has the Mratio property with value 120. The other properties are not specified. An M-text that has this face is drawn with a font whose size is 120% of a normal font. |
|
The variable mface_x_large points to a face that has the Mratio property with value 150. The other properties are not specified. An M-text that has this face is drawn with a font whose size is 150% of a normal font. |
|
The variable mface_xx_large points to a face that has the Mratio property with value 200. The other properties are not specified. An M-text that has this face is drawn with a font whose size is 200% of a normal font. |
|
The variable mface_black points to a face that has the Mforeground property with value a symbol of name "black". The other properties are not specified. An M-text that has this face is drawn with black foreground. |
|
The variable mface_white points to a face that has the Mforeground property with value a symbol of name "white". The other properties are not specified. An M-text that has this face is drawn with white foreground. |
|
The variable mface_red points to a face that has the Mforeground property with value a symbol of name "red". The other properties are not specified. An M-text that has this face is drawn with red foreground. |
|
The variable mface_green points to a face that has the Mforeground property with value a symbol of name "green". The other properties are not specified. An M-text that has this face is drawn with green foreground. |
|
The variable mface_blue points to a face that has the Mforeground property with value a symbol of name "blue". The other properties are not specified. An M-text that has this face is drawn with blue foreground. |
|
The variable mface_cyan points to a face that has the Mforeground property with value a symbol of name "cyan". The other properties are not specified. An M-text that has this face is drawn with cyan foreground. |
|
The variable mface_yellow points to a face that has the Mforeground property with value a symbol of name "yellow". The other properties are not specified. An M-text that has this face is drawn with yellow foreground. |
|
The variable mface_magenta points to a face that has the Mforeground property with value a symbol of name "magenta". The other properties are not specified. An M-text that has this face is drawn with magenta foreground. |
|
The variable Mface is a symbol of name "face" . A text property whose key is this symbol must have a pointer to an object of type MFace. This is a managing key. |
Top of this page
Main Page
Modules
Data Structures
Globals
Appendix
mule-aist@m17n.org