.\" Copyright (C) 2001 Information-technology Promotion Agency (IPA) .\" Copyright (C) 2001-2011 .\" National Institute of Advanced Industrial Science and Technology (AIST) .\" This file is part of the m17n library documentation. .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Section, no Front-Cover Texts, .\" and no Back-Cover Texts. A copy of the license is included in the .\" appendix entitled "GNU Free Documentation License". .TH "m17nFace" 3m17n "Mon Sep 25 2023" "Version 1.8.4" "The m17n Library" \" -*- nroff -*- .ad l .nh .SH NAME m17nFace_\-_ \- \- A face is an object to control appearance of M\-text\&. .SH SYNOPSIS .br .PP .SS "Data Structures" .in +1c .ti -1c .RI "struct \fBMFaceHLineProp\fP" .br .RI "Type of horizontal line spec of face\&. " .ti -1c .RI "struct \fBMFaceBoxProp\fP" .br .RI "Type of box spec of face\&. " .in -1c .SS "Typedefs" .in +1c .ti -1c .RI "typedef void(* \fBMFaceHookFunc\fP) (\fBMFace\fP *face, void *arg, void *info)" .br .RI "Type of hook function of face\&. " .in -1c .SS "Functions" .in +1c .ti -1c .RI "\fBMFace\fP * \fBmface\fP ()" .br .RI "Create a new face\&. " .ti -1c .RI "\fBMFace\fP * \fBmface_copy\fP (\fBMFace\fP *face)" .br .RI "Make a copy of a face\&. " .ti -1c .RI "int \fBmface_equal\fP (\fBMFace\fP *face1, \fBMFace\fP *face2)" .br .RI "Compare faces\&. " .ti -1c .RI "\fBMFace\fP * \fBmface_merge\fP (\fBMFace\fP *dst, \fBMFace\fP *src)" .br .RI "Merge faces\&. " .ti -1c .RI "\fBMFace\fP * \fBmface_from_font\fP (\fBMFont\fP *font)" .br .RI "Make a face from a font\&. " .ti -1c .RI "void * \fBmface_get_prop\fP (\fBMFace\fP *face, MSymbol key)" .br .RI "Get the value of a face property\&. " .ti -1c .RI "\fBMFaceHookFunc\fP \fBmface_get_hook\fP (\fBMFace\fP *face)" .br .RI "Get the hook function of a face\&. " .ti -1c .RI "int \fBmface_put_prop\fP (\fBMFace\fP *face, MSymbol key, void *val)" .br .RI "Set a value of a face property\&. " .ti -1c .RI "int \fBmface_put_hook\fP (\fBMFace\fP *face, \fBMFaceHookFunc\fP func)" .br .RI "Set a hook function to a face\&. " .ti -1c .RI "void \fBmface_update\fP (\fBMFrame\fP *frame, \fBMFace\fP *face)" .br .RI "Update a face\&. " .in -1c .SS "Variables: Keys of face property" .in +1c .ti -1c .RI "MSymbol \fBMforeground\fP" .br .RI "Key of a face property specifying foreground color\&. " .ti -1c .RI "MSymbol \fBMbackground\fP" .br .RI "Key of a face property specifying background color\&. " .ti -1c .RI "MSymbol \fBMvideomode\fP" .br .RI "Key of a face property specifying video mode\&. " .ti -1c .RI "MSymbol \fBMratio\fP" .br .RI "Key of a face property specifying font size ratio\&. " .ti -1c .RI "MSymbol \fBMhline\fP" .br .RI "Key of a face property specifying horizontal line\&. " .ti -1c .RI "MSymbol \fBMbox\fP" .br .RI "Key of a face property specifying box\&. " .ti -1c .RI "MSymbol \fBMfontset\fP" .br .RI "Key of a face property specifying fontset\&. " .ti -1c .RI "MSymbol \fBMhook_func\fP" .br .RI "Key of a face property specifying hook\&. " .ti -1c .RI "MSymbol \fBMhook_arg\fP" .br .RI "Key of a face property specifying argument of hook\&. " .in -1c .SS "Variables: Possible values of #Mvideomode property of face" See the documentation of the variable \fBMvideomode\fP\&. .br .in +1c .ti -1c .RI "MSymbol \fBMnormal\fP" .br .ti -1c .RI "MSymbol \fBMreverse\fP" .br .in -1c .SS "Variables: Predefined faces" .in +1c .ti -1c .RI "\fBMFace\fP * \fBmface_normal_video\fP" .br .RI "Normal video face\&. " .ti -1c .RI "\fBMFace\fP * \fBmface_reverse_video\fP" .br .RI "Reverse video face\&. " .ti -1c .RI "\fBMFace\fP * \fBmface_underline\fP" .br .ti -1c .RI "\fBMFace\fP * \fBmface_medium\fP" .br .RI "Medium face\&. " .ti -1c .RI "\fBMFace\fP * \fBmface_bold\fP" .br .RI "Bold face\&. " .ti -1c .RI "\fBMFace\fP * \fBmface_italic\fP" .br .RI "Italic face\&. " .ti -1c .RI "\fBMFace\fP * \fBmface_bold_italic\fP" .br .RI "Bold italic face\&. " .ti -1c .RI "\fBMFace\fP * \fBmface_xx_small\fP" .br .RI "Smallest face\&. " .ti -1c .RI "\fBMFace\fP * \fBmface_x_small\fP" .br .RI "Smaller face\&. " .ti -1c .RI "\fBMFace\fP * \fBmface_small\fP" .br .RI "Small face\&. " .ti -1c .RI "\fBMFace\fP * \fBmface_normalsize\fP" .br .RI "Normalsize face\&. " .ti -1c .RI "\fBMFace\fP * \fBmface_large\fP" .br .RI "Large face\&. " .ti -1c .RI "\fBMFace\fP * \fBmface_x_large\fP" .br .RI "Larger face\&. " .ti -1c .RI "\fBMFace\fP * \fBmface_xx_large\fP" .br .RI "Largest face\&. " .ti -1c .RI "\fBMFace\fP * \fBmface_black\fP" .br .RI "Black face\&. " .ti -1c .RI "\fBMFace\fP * \fBmface_white\fP" .br .RI "White face\&. " .ti -1c .RI "\fBMFace\fP * \fBmface_red\fP" .br .RI "Red face\&. " .ti -1c .RI "\fBMFace\fP * \fBmface_green\fP" .br .RI "Green face\&. " .ti -1c .RI "\fBMFace\fP * \fBmface_blue\fP" .br .RI "Blue face\&. " .ti -1c .RI "\fBMFace\fP * \fBmface_cyan\fP" .br .RI "Cyan face\&. " .ti -1c .RI "\fBMFace\fP * \fBmface_yellow\fP" .br .RI "yellow face\&. " .ti -1c .RI "\fBMFace\fP * \fBmface_magenta\fP" .br .RI "Magenta face\&. " .in -1c .SS "Variables: The other symbols for face handling\&." .in +1c .ti -1c .RI "MSymbol \fBMface\fP" .br .RI "Key of a text property specifying a face\&. " .in -1c .SH "Detailed Description" .PP A face is an object to control appearance of M\-text\&. A \fIface\fP is an object of the type \fBMFace\fP and controls how to draw M\-texts\&. A face has a fixed number of \fIface\fP \fIproperties\fP\&. Like other types of properties, a face property consists of a key and a value\&. A key is one of the following symbols: .PP \fBMforeground\fP, \fBMbackground\fP, \fBMvideomode\fP, \fBMhline\fP, \fBMbox\fP, \fBMfoundry\fP, \fBMfamily\fP, \fBMweight\fP, \fBMstyle\fP, \fBMstretch\fP, \fBMadstyle\fP, \fBMsize\fP, \fBMfontset\fP, \fBMratio\fP, \fBMhook_func\fP, \fBMhook_arg\fP .PP The notation 'xxx property of F' means the face property that belongs to face F and whose key is \fCMxxx\fP\&. .PP The M\-text drawing functions first search an M\-text for the text property whose key is the symbol \fBMface\fP, then draw the M\-text using the value of that text property\&. This value must be a pointer to a face object\&. .PP If there are multiple text properties whose key is \fCMface\fP, and they are not conflicting one another, properties of those faces are merged and used\&. .PP If no faces specify a certain property, the value of the default face is used\&. .br .SH "Data Structure Documentation" .SS MFaceHLineProp .PP Type of horizontal line spec of face\&. .ad l .nh \fBPublic Types:\fP .in +1c .ti -1c .RI "enum \fBMFaceHLineType\fP { \fBMFACE_HLINE_BOTTOM\fP, \fBMFACE_HLINE_UNDER\fP, \fBMFACE_HLINE_STRIKE_THROUGH\fP, \fBMFACE_HLINE_OVER\fP, \fBMFACE_HLINE_TOP\fP }" .br .in -1c .PP .PP \fBFIELD DOCUMENTATION:\fP .PP .PP \fBenum \fBMFaceHLineProp::MFaceHLineType\fP MFaceHLineProp::type\fP .PP \fBunsigned MFaceHLineProp::width\fP Width of the line in pixels\&. .PP \fBMSymbol MFaceHLineProp::color\fP Color of the line\&. If the value is Mnil, foreground color of a merged face is used\&. .br .SS MFaceBoxProp .PP Type of box spec of face\&. .ad l .nh .PP \fBFIELD DOCUMENTATION:\fP .PP .PP \fBunsigned MFaceBoxProp::width\fP Width of the box line in pixels\&. .PP \fBMSymbol MFaceBoxProp::color_top\fP Colors of borders\&. .PP \fBMSymbol MFaceBoxProp::color_bottom\fP .PP \fBMSymbol MFaceBoxProp::color_left\fP .PP \fBMSymbol MFaceBoxProp::color_right\fP .PP \fBunsigned MFaceBoxProp::inner_hmargin\fP Margins .PP \fBunsigned MFaceBoxProp::inner_vmargin\fP .PP \fBunsigned MFaceBoxProp::outer_hmargin\fP .PP \fBunsigned MFaceBoxProp::outer_vmargin\fP .SH "Typedef Documentation" .PP .SS "typedef void(* MFaceHookFunc) (\fBMFace\fP *face, void *arg, void *info)" .PP Type of hook function of face\&. \fBMFaceHookFunc\fP is a type of a hook function of a face\&. .br .SH "Variable Documentation" .PP .SS "MSymbol Mforeground" .PP Key of a face property specifying foreground color\&. The variable \fBMforeground\fP is used as a key of face property\&. The property value must be a symbol whose name is a color name, or \fBMnil\fP\&. .PP \fBMnil\fP means that the face does not specify a foreground color\&. Otherwise, the foreground of an M\-text is drawn by the specified color\&. .br .SS "MSymbol Mbackground" .PP Key of a face property specifying background color\&. The variable \fBMbackground\fP is used as a key of face property\&. The property value must be a symbol whose name is a color name, or \fBMnil\fP\&. .PP \fBMnil\fP means that the face does not specify a background color\&. Otherwise, the background of an M\-text is drawn by the specified color\&. .br .SS "MSymbol Mvideomode" .PP Key of a face property specifying video mode\&. The variable \fBMvideomode\fP is used as a key of face property\&. The property value must be \fBMnormal\fP, \fBMreverse\fP, or \fBMnil\fP\&. .PP \fBMnormal\fP 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)\&. .PP \fBMreverse\fP 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)\&. .PP \fBMnil\fP means that the face does not specify a video mode\&. .br .SS "MSymbol Mratio" .PP Key of a face property specifying font size ratio\&. The variable \fBMratio\fP is used as a key of face property\&. The value RATIO must be an integer\&. .PP The value 0 means that the face does not specify a font size ratio\&. 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 \fBMsize\fP\&. .br .SS "MSymbol Mhline" .PP Key of a face property specifying horizontal line\&. The variable \fBMhline\fP is used as a key of face property\&. The value must be a pointer to an object of type \fBMFaceHLineProp\fP, or \fCNULL\fP\&. .PP The value \fCNULL\fP 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\&. .br .SS "MSymbol Mbox" .PP Key of a face property specifying box\&. The variable \fBMbox\fP is used as a key of face property\&. The value must be a pointer to an object of type \fBMFaceBoxProp\fP, or \fCNULL\fP\&. .PP The value \fCNULL\fP 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\&. .br .SS "MSymbol Mfontset" .PP Key of a face property specifying fontset\&. The variable \fBMfontset\fP is used as a key of face property\&. The value must be a pointer to an object of type \fBMfontset\fP, or \fCNULL\fP\&. .PP The value \fCNULL\fP 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\&. .br .SS "MSymbol Mhook_func" .PP Key of a face property specifying hook\&. The variable \fBMhook_func\fP is used as a key of face property\&. The value must be a function of type \fBMFaceHookFunc\fP, or \fCNULL\fP\&. .PP The value \fCNULL\fP means that the face does not specify a hook\&. Otherwise, the specified function is called before the face is realized\&. .br .SS "MSymbol Mhook_arg" .PP Key of a face property specifying argument of hook\&. The variable \fBMhook_arg\fP is used as a key of face property\&. The value can be anything that is passed a hook function specified by the face property \fBMhook_func\fP\&. .br .SS "MSymbol Mnormal" .SS "MSymbol Mreverse" .SS "\fBMFace\fP* mface_normal_video" .PP Normal video face\&. The variable \fBmface_normal_video\fP points to a face that has the \fBMvideomode\fP property with value \fBMnormal\fP\&. 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)\&. .br .SS "\fBMFace\fP* mface_reverse_video" .PP Reverse video face\&. The variable \fBmface_reverse_video\fP points to a face that has the \fBMvideomode\fP property with value \fBMreverse\fP\&. 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)\&. .br .SS "\fBMFace\fP* mface_underline" .PP .nf @brief Underline face. 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: .fi .PP .PP .nf member value \-\-\-\-\- \-\-\-\-\- type MFACE_HLINE_UNDER width 1 color Mnil .fi .PP .PP .nf The other properties are not specified. An M\-text that has this face is drawn with an underline. .fi .PP .SS "\fBMFace\fP* mface_medium" .PP Medium face\&. The variable \fBmface_medium\fP points to a face that has the \fBMweight\fP 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\&. .br .SS "\fBMFace\fP* mface_bold" .PP Bold face\&. The variable \fBmface_bold\fP points to a face that has the \fBMweight\fP 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\&. .br .SS "\fBMFace\fP* mface_italic" .PP Italic face\&. The variable \fBmface_italic\fP points to a face that has the \fBMstyle\fP 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\&. .br .SS "\fBMFace\fP* mface_bold_italic" .PP Bold italic face\&. The variable \fBmface_bold_italic\fP points to a face that has the \fBMweight\fP property with value a symbol of name 'bold', and \fBMstyle\fP 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\&. .br .SS "\fBMFace\fP* mface_xx_small" .PP Smallest face\&. The variable \fBmface_xx_small\fP points to a face that has the \fBMratio\fP 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\&. .br .SS "\fBMFace\fP* mface_x_small" .PP Smaller face\&. The variable \fBmface_x_small\fP points to a face that has the \fBMratio\fP 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\&. .br .SS "\fBMFace\fP* mface_small" .PP Small face\&. The variable \fBmface_x_small\fP points to a face that has the \fBMratio\fP 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\&. .br .SS "\fBMFace\fP* mface_normalsize" .PP Normalsize face\&. The variable \fBmface_normalsize\fP points to a face that has the \fBMratio\fP 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\&. .br .SS "\fBMFace\fP* mface_large" .PP Large face\&. The variable \fBmface_large\fP points to a face that has the \fBMratio\fP 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\&. .br .SS "\fBMFace\fP* mface_x_large" .PP Larger face\&. The variable \fBmface_x_large\fP points to a face that has the \fBMratio\fP 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\&. .br .SS "\fBMFace\fP* mface_xx_large" .PP Largest face\&. The variable \fBmface_xx_large\fP points to a face that has the \fBMratio\fP 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\&. .br .SS "\fBMFace\fP* mface_black" .PP Black face\&. The variable \fBmface_black\fP points to a face that has the \fBMforeground\fP 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\&. .br .SS "\fBMFace\fP* mface_white" .PP White face\&. The variable \fBmface_white\fP points to a face that has the \fBMforeground\fP 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\&. .br .SS "\fBMFace\fP* mface_red" .PP Red face\&. The variable \fBmface_red\fP points to a face that has the \fBMforeground\fP 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\&. .br .SS "\fBMFace\fP* mface_green" .PP Green face\&. The variable \fBmface_green\fP points to a face that has the \fBMforeground\fP 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\&. .br .SS "\fBMFace\fP* mface_blue" .PP Blue face\&. The variable \fBmface_blue\fP points to a face that has the \fBMforeground\fP 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\&. .br .SS "\fBMFace\fP* mface_cyan" .PP Cyan face\&. The variable \fBmface_cyan\fP points to a face that has the \fBMforeground\fP 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\&. .br .SS "\fBMFace\fP* mface_yellow" .PP yellow face\&. The variable \fBmface_yellow\fP points to a face that has the \fBMforeground\fP 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\&. .br .SS "\fBMFace\fP* mface_magenta" .PP Magenta face\&. The variable \fBmface_magenta\fP points to a face that has the \fBMforeground\fP 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\&. .br .SS "MSymbol Mface" .PP Key of a text property specifying a face\&. The variable \fBMface\fP is a symbol of name \fC'face'\fP\&. A text property whose key is this symbol must have a pointer to an object of type \fBMFace\fP\&. This is a managing key\&. .br .SH "Author" .PP Generated automatically by Doxygen for The m17n Library from the source code\&. .SH COPYRIGHT Copyright (C) 2001 Information\-technology Promotion Agency (IPA) .br Copyright (C) 2001\-2011 National Institute of Advanced Industrial Science and Technology (AIST) .br Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License .