m17nFace(3m17n)

๐Ÿ“ฆ
version 1.8.4 ยท 2 versions
, in debian trixie, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

๐ŸŽ€ 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 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. 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::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 ๐Ÿงต

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, or Mnil.

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, or Mnil.

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 be Mnormal, Mreverse, or Mnil.
    • 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 value RATIO must 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 type MFaceHLineProp, or NULL.

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 type MFaceBoxProp, or NULL.

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 type Mfontset, or NULL.

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 type MFaceHookFunc, or NULL.

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 property Mhook_func. Bestie, it's a free-for-all. ๐Ÿซถ
  • MSymbol Mnormal
  • MSymbol 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 the Mvideomode property with value Mnormal. 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 the Mvideomode property set to Mreverse. 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_UNDER
  • width โ†’ 1
  • color โ†’ 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 the Mweight property 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 with Mweight set 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 the Mstyle property 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 with Mweight set to a symbol of name 'bold' and Mstyle set 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 the Mratio property value 50. 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 with Mratio value 66. 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 with Mratio value 75. 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 variable mface_x_small points to a faceโ€ฆ" in this entry. Bestie that's a typo in the source docs โ€” this is the mface_small entry. Anyway. Moving on. ๐Ÿ™ˆ
  • MFace* mface_normalsize โ€” the normalsize face. Points to a face with Mratio value 100. 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 with Mratio value 120. 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 with Mratio value 150. 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 with Mratio value 200. 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. Mforeground value is a symbol of name 'black'. Other properties unspecified. M-text drawn with black foreground. ๐Ÿ–ค
  • MFace* mface_white โ€” white face. Mforeground value is a symbol of name 'white'. Other properties unspecified. M-text drawn with white foreground. ๐Ÿค
  • MFace* mface_red โ€” red face. Mforeground value is a symbol of name 'red'. Other properties unspecified. M-text drawn with red foreground. โค๏ธ
  • MFace* mface_green โ€” green face. Mforeground value is a symbol of name 'green'. Other properties unspecified. M-text drawn with green foreground. ๐Ÿ’š
  • MFace* mface_blue โ€” blue face. Mforeground value is a symbol of name 'blue'. Other properties unspecified. M-text drawn with blue foreground. ๐Ÿ’™
  • MFace* mface_cyan โ€” cyan face. Mforeground value 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). Mforeground value is a symbol of name 'yellow'. Other properties unspecified. M-text drawn with yellow foreground. ๐Ÿ’›
  • MFace* mface_magenta โ€” magenta face. Mforeground value 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 type MFace. 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 (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