m17nFace(3m17n)
๐ m17nFace ๐
okay bestie, welcome to m17nFace โ straight outta the The m17n Library manual, section 3m17n. pull up a chair, grab a boba ๐ง, we are learning about faces today (not the one on your head โ the ones that make text look cute). it's giving main character energy, fr fr ๐
๐ธ NAME ๐ธ
m17nFace_-_ - - A face is an object to control appearance of M-text.
so literally, a face = the object that controls how your M-text looks. that's the whole thing. that's the vibe โจ
๐ฆ 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 MnormalMSymbol Mreverse
๐ Variables: Predefined faces ๐
MFace * mface_normal_videoโ Normal video face.MFace * mface_reverse_videoโ Reverse video face.MFace * mface_underlineMFace * 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. no exceptions bestie ๐ซถ
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. so the default is the fallback queen, as she should be ๐
๐งธ 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::typeunsigned MFaceHLineProp::widthโ Width of the line in pixels.MSymbol MFaceHLineProp::colorโ Color of the line. If the value isMnil, 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_bottomMSymbol MFaceBoxProp::color_leftMSymbol MFaceBoxProp::color_rightunsigned MFaceBoxProp::inner_hmarginโ Marginsunsigned MFaceBoxProp::inner_vmarginunsigned MFaceBoxProp::outer_hmarginunsigned MFaceBoxProp::outer_vmargin
๐งต Typedef Documentation ๐งต
MFaceHookFunc
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 โจ
Okay bestie, this is the good part โ all the global variables m17n hands you, pre-made, so you don't have to build faces from scratch. ๐
Each one is either a key you use in a property list, or a whole ready-to-wear MFace * you can justโฆ use. Iconic.
๐ The property keys
These are the MSymbols you use as keys when you're setting up face properties. Think of them as the group-chat labels for "what am I even setting rn".
MSymbol Mforegroundโ key of a face property for the foreground color. The value has to be a symbol whose name is a color name, orMnil.
Mnil means the face justโฆ doesn't specify a foreground color, no big deal. Otherwise the foreground of an M-text gets drawn in the color you named. ๐
MSymbol Mbackgroundโ key of a face property for the background color. Value must be a symbol whose name is a color name, orMnil.
Mnil = no background color specified. Otherwise the background of an M-text is drawn in that color. ๐
MSymbol Mvideomodeโ key of a face property for the video mode. The value has to beMnormal,Mreverse, orMnil.Mnormalโ the M-text is drawn in normal video mode, meaning the foreground is drawn with the foreground color and the background with the background color.Mreverseโ the M-text is drawn in reverse video mode, meaning the foreground is drawn with the background color and the background is drawn with the foreground color. ๐Mnilโ the face just doesn't specify a video mode at all.
MSymbol Mratioโ key of a face property for the font size ratio. The valueRATIOmust be an integer.
The value 0 means the face doesn't specify a font size ratio. Otherwise, the M-text is drawn with a font of size (FONTSIZE RATIO / 100), where FONTSIZE is the font size specified by the face property Msize. Math girlies stay winning. ๐งฎโจ
MSymbol Mhlineโ key of a face property for a horizontal line. The value must be a pointer to an object of typeMFaceHLineProp, orNULL.
NULL means the face doesn't specify this property. Otherwise the M-text is drawn with a horizontal line, done the way the object the value points to says to do it.
MSymbol Mboxโ key of a face property for a box. The value must be a pointer to an object of typeMFaceBoxProp, orNULL.
NULL means no box. Otherwise the M-text gets drawn with a surrounding box, again per whatever the pointed-to object says. ๐ฆ
MSymbol Mfontsetโ key of a face property for a fontset. The value must be a pointer to an object of typeMfontset, orNULL.
NULL means the face doesn't specify a fontset. Otherwise the M-text is drawn with a font selected from what's specified in the fontset.
MSymbol Mhook_funcโ key of a face property for a hook. The value must be a function of typeMFaceHookFunc, orNULL.
NULL means no hook. Otherwise, that function gets called before the face is realized. ๐
MSymbol Mhook_argโ key of a face property for the argument of the hook. This value can be literally anything, and it gets passed to the hook function specified by the face propertyMhook_func. Bestie, it's a free-for-all. ๐ซถMSymbol MnormalMSymbol Mreverse
(Yes, these are also just symbols hanging out here, right next to mface_normal_video.)
๐ช The video-mode faces
MFace* mface_normal_videoโ the normal video face. This variable points to a face that has theMvideomodeproperty with valueMnormal. None of the other properties are specified. An M-text drawn with this face shows up in normal colors, meaning the foreground is drawn with the foreground color and the background with the background color. ๐MFace* mface_reverse_videoโ the reverse video face. It points to a face with theMvideomodeproperty set toMreverse. Other properties: nope, not specified. An M-text drawn with this face appears in reversed colors, so the foreground is drawn with the background color and the background with the foreground color. ๐ฅ
๐๏ธ The decorative faces
MFace* mface_underlineโ the underline face.
This variable points to a face that has the Mhline property with a value that's a pointer to an object of type MFaceHLineProp. The members of that object are:
typeโMFACE_HLINE_UNDERwidthโ1colorโMnil
The other properties are not specified. An M-text that has this face is drawn with an underline. Periodt. โ๏ธ
MFace* mface_mediumโ the medium face. It points to a face with theMweightproperty set to a symbol of name'medium'. Everything else: unspecified. An M-text with this face is drawn with a font of medium weight.MFace* mface_boldโ the bold face. Points to a face withMweightset to a symbol of name'bold'. Other properties unspecified. An M-text with this face is drawn with a font of bold weight. ๐ชMFace* mface_italicโ the italic face. Points to a face with theMstyleproperty set to a symbol of name'italic'. Other properties unspecified. An M-text with this face gets a font of italic style.MFace* mface_bold_italicโ the bold italic face. Points to a face withMweightset to a symbol of name'bold'andMstyleset to a symbol of name'italic'. Other properties unspecified. An M-text with this face is drawn with a font of bold weight and italic style. The way that it's both?? We love a multitasker. ๐
๐ The size faces
MFace* mface_xx_smallโ the smallest face. Points to a face with theMratioproperty value50. Other properties unspecified. An M-text with this face is drawn with a font whose size is 50% of a normal font. smol ๐MFace* mface_x_smallโ the smaller face. Points to a face withMratiovalue66. Other properties unspecified. An M-text with this face is drawn with a font whose size is 66% of a normal font.MFace* mface_smallโ the small face. Points to a face withMratiovalue75. Other properties unspecified. An M-text with this face is drawn with a font whose size is 75% of a normal font.
ngl the original doc literally says "The variablemface_x_smallpoints to a faceโฆ" in this entry. Bestie that's a typo in the source docs โ this is themface_smallentry. Anyway. Moving on. ๐
MFace* mface_normalsizeโ the normalsize face. Points to a face withMratiovalue100. Other properties unspecified. An M-text with this face is drawn with a font whose size is the same as a normal font. โจMFace* mface_largeโ the large face. Points to a face withMratiovalue120. Other properties unspecified. An M-text with this face is drawn with a font whose size is 120% of a normal font.MFace* mface_x_largeโ the larger face. Points to a face withMratiovalue150. Other properties unspecified. An M-text with this face is drawn with a font whose size is 150% of a normal font.MFace* mface_xx_largeโ the largest face. Points to a face withMratiovalue200. Other properties unspecified. An M-text with this face is drawn with a font whose size is 200% of a normal font. main character energy fr fr ๐
๐ The color faces
Every single one of these is the same deal: a face with the Mforeground property set to a symbol of that color's name, nothing else specified, and the M-text gets drawn in that foreground color. Here we go, the whole rainbow:
MFace* mface_blackโ black face.Mforegroundvalue is a symbol of name'black'. Other properties unspecified. M-text drawn with black foreground. ๐คMFace* mface_whiteโ white face.Mforegroundvalue is a symbol of name'white'. Other properties unspecified. M-text drawn with white foreground. ๐คMFace* mface_redโ red face.Mforegroundvalue is a symbol of name'red'. Other properties unspecified. M-text drawn with red foreground. โค๏ธMFace* mface_greenโ green face.Mforegroundvalue is a symbol of name'green'. Other properties unspecified. M-text drawn with green foreground. ๐MFace* mface_blueโ blue face.Mforegroundvalue is a symbol of name'blue'. Other properties unspecified. M-text drawn with blue foreground. ๐MFace* mface_cyanโ cyan face.Mforegroundvalue is a symbol of name'cyan'. Other properties unspecified. M-text drawn with cyan foreground. ๐ฉตMFace* mface_yellowโ the yellow face (lowercase y in the original, we're keeping it, don't @ me).Mforegroundvalue is a symbol of name'yellow'. Other properties unspecified. M-text drawn with yellow foreground. ๐MFace* mface_magentaโ magenta face.Mforegroundvalue is a symbol of name'magenta'. Other properties unspecified. M-text drawn with magenta foreground. ๐
๐ท๏ธ The text property key
MSymbol Mfaceโ key of a text property specifying a face. This variable is a symbol of name'face'. A text property whose key is this symbol must have a pointer to an object of typeMFace. This is a managing key. ๐
๐ Author ๐
Generated automatically by Doxygen for The m17n Library from the source code. (Not a human author, just a robot doing its lil thing. ๐คโจ)
ยฉ๏ธ 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>.
And that's a wrap, bestie โ this page is Version 1.8.4, dated Mon Sep 25 2023, for m17nFace(3m17n). Go forth and make everything pretty. ๐ ๐โจ
๐ฆ where this page comes from
- debian trixie: m17n-docs 1.8.4-1
- ubuntu noble: m17n-docs 1.8.4-1
- ubuntu questing: m17n-docs 1.8.4-1
- ubuntu resolute: m17n-docs 1.8.4-1build1
- ubuntu stonking: m17n-docs 1.8.4-1build1
- Copyright (C) 2001 Information-technology Promotion Agency (IPA)
- Copyright (C) 2001-2011 National Institute of Advanced Industrial Science and Technology (AIST)
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms