---
name: "m17nFace"
section: "3m17n"
platform: "linux"
package: "m17n-docs"
version: "1.8.4-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/m17nFace"
---

# m17nFace(3m17n)

\- A face is an object to control appearance of M-text.

## NAME

m17nFace\_-\_ -  - A face is an object to control appearance of M-text.

## SYNOPSIS

### Data Structures

struct **MFaceHLineProp**\
 Type of horizontal line spec of face.  struct **MFaceBoxProp**\
 Type of box spec of face.

### Typedefs

typedef void(\* **MFaceHookFunc**) (**MFace** \*face, void \*arg, void \*info)\
 Type of hook function of face.

### Functions

**MFace** \* **mface** ()\
 Create a new face.  **MFace** \* **mface\_copy** (**MFace** \*face)\
 Make a copy of a face.  int **mface\_equal** (**MFace** \*face1, **MFace** \*face2)\
 Compare faces.  **MFace** \* **mface\_merge** (**MFace** \*dst, **MFace** \*src)\
 Merge faces.  **MFace** \* **mface\_from\_font** (**MFont** \*font)\
 Make a face from a font.  void \* **mface\_get\_prop** (**MFace** \*face, MSymbol key)\
 Get the value of a face property.  **MFaceHookFunc** **mface\_get\_hook** (**MFace** \*face)\
 Get the hook function of a face.  int **mface\_put\_prop** (**MFace** \*face, MSymbol key, void \*val)\
 Set a value of a face property.  int **mface\_put\_hook** (**MFace** \*face, **MFaceHookFunc** func)\
 Set a hook function to a face.  void **mface\_update** (**MFrame** \*frame, **MFace** \*face)\
 Update a face.

### Variables: Keys of face property

MSymbol **Mforeground**\
 Key of a face property specifying foreground color.  MSymbol **Mbackground**\
 Key of a face property specifying background color.  MSymbol **Mvideomode**\
 Key of a face property specifying video mode.  MSymbol **Mratio**\
 Key of a face property specifying font size ratio.  MSymbol **Mhline**\
 Key of a face property specifying horizontal line.  MSymbol **Mbox**\
 Key of a face property specifying box.  MSymbol **Mfontset**\
 Key of a face property specifying fontset.  MSymbol **Mhook\_func**\
 Key of a face property specifying hook.  MSymbol **Mhook\_arg**\
 Key of a face property specifying argument of hook.

### Variables: Possible values of #Mvideomode property of face

 See the documentation of the variable **Mvideomode**. \

MSymbol **Mnormal**\
 MSymbol **Mreverse**\

### Variables: Predefined faces

**MFace** \* **mface\_normal\_video**\
 Normal video face.  **MFace** \* **mface\_reverse\_video**\
 Reverse video face.  **MFace** \* **mface\_underline**\
 **MFace** \* **mface\_medium**\
 Medium face.  **MFace** \* **mface\_bold**\
 Bold face.  **MFace** \* **mface\_italic**\
 Italic face.  **MFace** \* **mface\_bold\_italic**\
 Bold italic face.  **MFace** \* **mface\_xx\_small**\
 Smallest face.  **MFace** \* **mface\_x\_small**\
 Smaller face.  **MFace** \* **mface\_small**\
 Small face.  **MFace** \* **mface\_normalsize**\
 Normalsize face.  **MFace** \* **mface\_large**\
 Large face.  **MFace** \* **mface\_x\_large**\
 Larger face.  **MFace** \* **mface\_xx\_large**\
 Largest face.  **MFace** \* **mface\_black**\
 Black face.  **MFace** \* **mface\_white**\
 White face.  **MFace** \* **mface\_red**\
 Red face.  **MFace** \* **mface\_green**\
 Green face.  **MFace** \* **mface\_blue**\
 Blue face.  **MFace** \* **mface\_cyan**\
 Cyan face.  **MFace** \* **mface\_yellow**\
 yellow face.  **MFace** \* **mface\_magenta**\
 Magenta face.

### Variables: The other symbols for face handling.

MSymbol **Mface**\
 Key of a text property specifying a face.

## Detailed Description

A face is an object to control appearance of M-text.

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 notation 'xxx property of F' means the face property that belongs to face F and whose key is `Mxxx`.

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. \

## Data Structure Documentation

### MFaceHLineProp

Type of horizontal line spec of face.

**Public Types:**

enum **MFaceHLineType** { **MFACE\_HLINE\_BOTTOM**, **MFACE\_HLINE\_UNDER**, **MFACE\_HLINE\_STRIKE\_THROUGH**, **MFACE\_HLINE\_OVER**, **MFACE\_HLINE\_TOP** }\

**FIELD DOCUMENTATION:**

**enum MFaceHLineProp::MFaceHLineType MFaceHLineProp::type**

**unsigned MFaceHLineProp::width** **Width of the line in pixels.**

**MSymbol MFaceHLineProp::color** **Color of the line. If the value is Mnil, foreground color of a merged face is used.** \

### MFaceBoxProp

**Type of box spec of face.**

**FIELD DOCUMENTATION:**

**unsigned MFaceBoxProp::width** **Width of the box line in pixels.**

**MSymbol MFaceBoxProp::color\_top** **Colors of borders.**

**MSymbol MFaceBoxProp::color\_bottom**

**MSymbol MFaceBoxProp::color\_left**

**MSymbol MFaceBoxProp::color\_right**

**unsigned MFaceBoxProp::inner\_hmargin** **Margins**

**unsigned MFaceBoxProp::inner\_vmargin**

**unsigned MFaceBoxProp::outer\_hmargin**

**unsigned MFaceBoxProp::outer\_vmargin**

## Typedef Documentation

### typedef void(\* MFaceHookFunc) (MFace \*face, void \*arg, void \*info)

**Type of hook function of face. MFaceHookFunc is a type of a hook function of a face.** \

## Variable Documentation

### MSymbol Mforeground

**Key of a face property specifying foreground color. 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.** \

### MSymbol Mbackground

**Key of a face property specifying background 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.** \

### MSymbol Mvideomode

**Key of a face property specifying video mode. 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.** \

### MSymbol Mratio

**Key of a face property specifying font size ratio. The variable Mratio is used as a key of face property. The value RATIO must be an integer.**

**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 Msize.** \

### MSymbol Mhline

**Key of a face property specifying horizontal line. 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.** \

### MSymbol Mbox

**Key of a face property specifying box. 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.** \

### MSymbol Mfontset

**Key of a face property specifying fontset. 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.** \

### MSymbol Mhook\_func

**Key of a face property specifying hook. 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.** \

### MSymbol Mhook\_arg

**Key of a face property specifying argument of hook. 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.** \

### MSymbol Mnormal

### MSymbol Mreverse

### MFace\* mface\_normal\_video

**Normal video face. 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).** \

### MFace\* mface\_reverse\_video

**Reverse video face. 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).** \

### MFace\* mface\_underline

```
@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:
```

```
    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.
```

### MFace\* mface\_medium

**Medium face. 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.** \

### MFace\* mface\_bold

**Bold face. 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.** \

### MFace\* mface\_italic

**Italic face. 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.** \

### MFace\* mface\_bold\_italic

**Bold italic face. 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.** \

### MFace\* mface\_xx\_small

**Smallest face. 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.** \

### MFace\* mface\_x\_small

**Smaller face. 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.** \

### MFace\* mface\_small

**Small face. 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.** \

### MFace\* mface\_normalsize

**Normalsize face. 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.** \

### MFace\* mface\_large

**Large face. 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.** \

### MFace\* mface\_x\_large

**Larger face. 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.** \

### MFace\* mface\_xx\_large

**Largest face. 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.** \

### MFace\* mface\_black

**Black face. 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.** \

### MFace\* mface\_white

**White face. 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.** \

### MFace\* mface\_red

**Red face. 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.** \

### MFace\* mface\_green

**Green face. 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.** \

### MFace\* mface\_blue

**Blue face. 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.** \

### MFace\* mface\_cyan

**Cyan face. 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.** \

### MFace\* mface\_yellow

**yellow face. 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.** \

### MFace\* mface\_magenta

**Magenta face. 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.** \

### MSymbol Mface

**Key of a text property specifying a face. 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.** \

## Author

**Generated automatically by Doxygen for The m17n Library from the source code.**

## COPYRIGHT

**Copyright (C) 2001 Information-technology Promotion Agency (IPA)**\
 **Copyright (C) 2001-2011 National Institute of Advanced Industrial Science and Technology (AIST)**\
 **Permission is granted to copy, distribute and/or modify this document** **under the terms of the GNU Free Documentation License**  **\<http://www.gnu.org/licenses/fdl.html\>.**
