m17nFont(3m17n)
πΈ m17nFont πΈ
okay bestie, welcome to m17nFont(3m17n) from The m17n Library π this is the font page and it is long, so it comes in two parts β you're reading part 1 rn. grab a snack, we're doing this π
β¨ NAME β¨
m17nFont β Font. that's it, that's the name. it's giving "the entire font system" π
π SYNOPSIS π
π«Ά Functions
MFont * mfont ()β create a brand new font, fresh out the box β¨MFont * mfont_parse_name (const char *name, MSymbol format)β make a font by parsing a fontname π§char * mfont_unparse_name (MFont *font, MSymbol format)β go the other way and build a fontname out of a font π«MFont * mfont_copy (MFont *font)β clone a font, no cap πͺvoid * mfont_get_prop (MFont *font, MSymbol key)β grab a property value off a font πint mfont_put_prop (MFont *font, MSymbol key, void *val)β set a property value on a font π₯MSymbol * mfont_selection_priority ()β hand back the font selection priority πint mfont_set_selection_priority (MSymbol *keys)β set that font selection priority ποΈMFont * mfont_find (MFrame *frame, MFont *spec, int *score, int max_size)β go find a font πint mfont_set_encoding (MFont *font, MSymbol encoding_name, MSymbol repertory_name)β set a font's encoding π·οΈchar * mfont_name (MFont *font)β build a fontname from a font βοΈMFont * mfont_from_name (const char *name)β create a new font from a fontname π±int mfont_resize_ratio (MFont *font)β get the resize info for a font πMPlist * mfont_list (MFrame *frame, MFont *font, MSymbol language, int maxnum)β get a whole list of fonts πMPlist * mfont_list_family_names (MFrame *frame)β get a list of font famiy names π‘int mfont_check (MFrame *frame, MFontset *fontset, MSymbol script, MSymbol language, MFont *font)β check whether a font is even usable βint mfont_match_p (MFont *font, MFont *spec)β check if a font matches a font spec π§MFont * mfont_open (MFrame *frame, MFont *font)β open a font πͺMFont * mfont_encapsulate (MFrame *frame, MSymbol data_type, void *data)β encapusulate a font (yes that's how it's spelled, we keep it fr fr) π¦int mfont_close (MFont *font)β close a font, bye bestie π
π Variables
MPlist * mfont_freetype_pathβ a list of font files and directories that contain font files π
π¦ Variables: Keys of font property
MSymbol Mfoundryβ key of font property specifying foundry πMSymbol Mfamilyβ key of font property specifying family π¨βπ©βπ§MSymbol Mweightβ key of font property specifying weight ποΈMSymbol Mstyleβ key of font property specifying style πMSymbol Mstretchβ key of font property specifying stretch π§MSymbol Madstyleβ key of font property specifying additional style βMSymbol Mspacingβ key of font property specifying spacing βοΈMSymbol Mregistryβ key of font property specifying registry πMSymbol Msizeβ key of font property specifying size πMSymbol Motfβ key of font property specifying file name πMSymbol Mfontfileβ key of font property specifying file name πMSymbol Mresolutionβ key of font property specifying resolution π₯οΈMSymbol Mmax_advanceβ key of font property specifying max advance width β‘οΈMSymbol Mfontconfigβ symbol of name'fontconfig'ποΈMSymbol Mxβ symbol of name'x'βMSymbol Mfreetypeβ symbol of name'freetype'πMSymbol Mxftβ symbol of name'xft'ποΈ
π Detailed Description π
@addtogroup m17nFont
@brief Font object.
so here's the tea β the m17n GUI API represents a font with an object of type MFont. a font can have font properties. just like every other kind of property out there, a font property is a key + a value situation πβπ
the key of a font property has to be one of these symbols, periodt:
Mfoundry, Mfamily, Mweight, Mstyle, Mstretch, Madstyle, Mregistry, Msize, Mresolution, Mspacing
when the key of a font property is Msize or Mresolution, its value is an integer π’. otherwise the value is a symbol π·οΈ
when we say "xxx property of F", we mean the font property that belongs to font F and whose key is Mxxx. iykyk π
- the value of a foundry property is a symbol representing font foundry information, e.g.
adobe,misc, etc. π - the value of a family property is a symbol representing font family information, e.g.
times,helvetica, etc. π¨βπ©βπ§ - the value of a weight property is a symbol representing weight information, e.g.
normal,bold, etc. ποΈ - the value of a style property is a symbol representing slant information, e.g.
normal,italic, etc. π - the value of a stretch property is a symbol representing width information, e.g.
normal,semicondensed, etc. π§ - the value of an adstyle property is a symbol representing abstract font family information, e.g.
serif,sans-serif, etc. βοΈ - the value of a registry property is a symbol representing registry information, e.g.
iso10646-1,iso8895-1, etc. π - the value of a size property is an integer representing design size in the unit of 1/10 point π
- the value of a resolution property is an integer representing assumed device resolution in the unit of dots per inch (dpi) π₯οΈ
- the value of a type property is a symbol indicating a font driver; currently
MxorMfreetypeπ
the m17n library uses font objects for two whole purposes: to receive a font specification from an application program, and to present available fonts to an application program π«±π«² and when the m17n library presents an available font to an application program, all font properties have a concrete value. no vibes-based guessing, real values only β¨
the m17n library supports three kinds of fonts: Window system fonts, FreeType fonts, and OpenType fonts π
- Window system fonts πͺ
the m17n-X library supports all fonts handled by an X server and an X font server. the correspondence between XLFD fields and font properties goes like this:
FOUNDRYβ foundryFAMILY_NAMEβ familyWEIGHT_NAMEβ weightSLANTβ styleSETWIDTH_NAMEβ stretchADD_STYLE_NAMEβ adstylePIXEL_SIZEβ sizeRESOLUTION_Yβ resolutionCHARSET_REGISTRY-CHARSET-ENCODINGβ registry
XLFD fields that aren't in the list above? ignored. not invited to the party π
- FreeType fonts π
the m17n library β if it was configured to use the FreeType library β supports all fonts that can be handled by the FreeType library. the variable #mfont_freetype_path gets initialized properly according to the configuration of the m17n library and the environment variable M17NDIR. go read that variable's docs for the details, bestie π
if the m17n library is configured to use the fontconfig library, then on top of #mfont_freetype_path, all fonts available via fontconfig are supported too ποΈβ¨
the family name of a FreeType font corresponds to the family property. and the style names of FreeType fonts map onto the weight, style, and stretch properties like this:
- style name
Regularβ weightmedium, styler, stretchnormal - style name
Italicβ weightmedium, stylei, stretchnormal - style name
Boldβ weightbold, styler, stretchnormal - style name
Bold Italicβ weightbold, stylei, stretchnormal - style name
Narrowβ weightmedium, styler, stretchcondensed - style name
Narrow Italicβ weightmedium, stylei, stretchcondensed - style name
Narrow Boldβ weightbold, styler, stretchcondensed - style name
Narrow Bold Italicβ weightbold, stylei, stretchcondensed - style name
Blackβ weightblack, styler, stretchnormal - style name
Black Italicβ weightblack, stylei, stretchnormal - style name
Obliqueβ weightmedium, styleo, stretchnormal - style name
BoldObliqueβ weightbold, styleo, stretchnormal
any style name that isn't in that list gets treated as "Regular" π (iconic of it honestly)
a combination of a platform ID and an encoding ID corresponds to the registry property. for example, if a font has the combination (1 1), the registry property is 1-1. some frequent combinations come with a predefined registry property:
- platform ID
0, encoding ID3β registry propertyunicode-bmp - platform ID
0, encoding ID4β registry propertyunicode-full - platform ID
1, encoding ID0β registry propertyapple-roman - platform ID
3, encoding ID1β registry propertyunicode-bmp - platform ID
3, encoding ID1β registry propertyunicode-full
so a font that has two combinations, (1 0) and (3 1), corresponds to four font objects whose registries are 1-0, apple-roman, 3-1, and unicode-bmp. four for the price of one, we love a multitasker π
β¨
- OpenType fonts π ΎοΈ
the m17n library β if it's configured to use both the FreeType library and the OTF library β supports any OpenType fonts. the list of actually available fonts is created in the same way as in the case of FreeType fonts. and if a fontset instructs to use an OpenType font via an FLT (Font Layout Table), and the FLT has an OTF-related command (e.g. otf:deva), then the OTF library converts a character sequence to a glyph code sequence according to the OpenType layout tables of the font, and the FreeType library gives a bitmap image for each glyph πΌοΈπ₯
okay that's part 1 wrapped β part 2 is right there waiting for you, keep scrolling bestie π«Ά
β¨ Variable Documentation β¨
Okay bestie, this is the part where we meet the variables β the little symbols that hold the keys to font properties and face properties and all that good stuff. Every single one matters, no skips, fr fr. π
MSymbol Mfoundry
Mfoundry is the key of a font property that specifies the foundry. The variable is a symbol of name 'foundry', and it gets used as a key of both font property and face property. The property value has to be a symbol whose name is a foundry name of a font. Slay. β¨
MSymbol Mfamily
Mfamily is the key of a font property that specifies the family. It's a symbol of name 'family', used as a key of font property and face property. The value must be a symbol whose name is a family name of a font. π
MSymbol Mweight
Mweight is the key of a font property specifying weight. Symbol of name 'weight', used as key of font property and face property. Value must be a symbol whose name is a weight name of a font (e.g. 'medium', 'bold'). Periodt. πͺ
MSymbol Mstyle
Mstyle β key of font property specifying style. Symbol of name 'style', used as key of font property and face property. Value must be a symbol whose name is a style name of a font (e.g. 'r', 'i', 'o'). Iykyk. πΈ
MSymbol Mstretch
Mstretch β key of font property specifying stretch. Symbol of name 'stretch', used as key of font property and face property. Value must be a symbol whose name is a stretch name of a font (e.g. 'normal', 'condensed'). Stretch it out bestie. π¦
MSymbol Madstyle
Madstyle β key of font property specifying additional style. Symbol of name 'adstyle', used as key of font property and face property. Value must be a symbol whose name is an additional style name of a font (e.g. 'serif', '', 'sans'). Yes, the empty string is in there, iconic. β¨
MSymbol Mspacing
Mspacing β key of font property specifying spacing. The variable Madstyle is a symbol of name 'spacing', and it is used as a key of font property. The property value must be a symbol whose name specifies the spacing of a font (e.g. 'p' for proportional, 'm' for monospaced). (Yes, it says Madstyle in the original, bestie β I'm just the messenger π)
MSymbol Mregistry
Mregistry β key of font property specifying registry. Symbol of name 'registry', used as a key of font property. Value must be a symbol whose name is a registry name of a font registry (e.g. 'iso8859-1', 'jisx0208.1983-0'). Registry realness. π
MSymbol Msize
Msize β key of font property specifying size. Symbol of name 'size', used as a key of font property and face property. Value must be an integer specifying a font design size in the unit of 1/10 point (on 100 dpi display). Numbers bestie. π’
MSymbol Motf
Motf β key of font property specifying file name. The variable Mfontfile is a symbol of name 'fontfile', and it is used as a key of font property. The property value must be a symbol whose name is a font file name. (Yes, the heading is Motf but the prose says Mfontfile β we're just reporting the lore π)
MSymbol Mfontfile
Mfontfile β key of font property specifying file name. The variable Mfontfile is a symbol of name 'fontfile', and it is used as a key of font property. The property value must be a symbol whose name is a font file name. Iconic duplicate energy. β¨
MSymbol Mresolution
Mresolution β key of font property specifying resolution. Symbol of name 'resolution', used as a key of font property and face property. Value must be an integer specifying a font resolution in the unit of dots per inch (dpi). DPI girlies rise. π
MSymbol Mmax_advance
Mmax_advance β key of font property specifying max advance width. Symbol of name 'max-advance', used as a key of font property. Value must be an integer specifying a font's max advance value by pixels. Max advance, max slay. π
MSymbol Mfontconfig
Mfontconfig β symbol of name 'fontconfig'. It is to be used as an argument of the functions mfont_parse_name() and mfont_unparse_name(). Fontconfig bestie. π«Ά
MSymbol Mx
Mx β symbol of name 'x'. It is to be used for a value of <type> member of the structure MDrawGlyph to specify the type of <fontp> member is actually (XFontStruct *). X marks the spot. β¨
MSymbol Mfreetype
Mfreetype β symbol of name 'freetype'. It is to be used for a value of <type> member of the structure MDrawGlyph to specify the type of <fontp> member is actually FT_Face. FreeType era. π
MSymbol Mxft
Mxft β symbol of name 'xft'. It is to be used for a value of <type> member of the structure MDrawGlyph to specify the type of <fontp> member is actually (XftFont *). Xft and chill. π¦
MPlist* mfont_freetype_path
mfont_freetype_path is a list of font files and directories that contain font files. It's a plist of FreeType font files and directories that contain FreeType font files. The key of each element is Mstring, and the value is a string that represents a font file or a directory.
The macro M17N_INIT() sets up this variable to contain the sub-directory 'fonts' of the m17n database and the environment variable 'M17NDIR'. The first call of mframe() creates the internal list of the actually available fonts from this variable. So, an application program, if necessary, must modify the variable before calling mframe(). If it is going to add a new element, the value must be a string that can be safely freed.
If the m17n library is not configured to use the FreeType library, this variable is not used.
Bestie, that's a real order-of-operations thing: modify before mframe(), or the internal list won't know about it. No cap.
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>.
That's the whole vibe, bestie. This m17nFont(3m17n) page is from The m17n Library, version 1.8.4, dated Mon Sep 25 2023. Stay slaying those font properties. πβ¨
π¦ 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