mdbFontset(5)

πŸ“¦
version 1.8.4 Β· 2 versions
, in debian trixie, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ NAME ✨

mdbFontset β€” bestie, it's literally the Fontset page πŸ’– (from the m17n Library's manual, section 5)


🌸 DESCRIPTION 🌸

okay so here's the tea β˜• β€” the m17n library goes and loads a fontset definition straight out of the m17n database, and it finds it by the tags <fontset, FONTSET-NAME>. The data lives in plist format and it goes a lil something like this:

FONTSET ::= PER-SCRIPT * PER-CHARSET * FALLBACK *

PER-SCRIPT ::= '(' SCRIPT PER-LANGUAGE + ')'

PER-LANGUAGE ::= '(' LANGUAGE FONT-SPEC-ELEMENT + ')'

PER-CHARSET ::= '(' CHARSET FONT-SPEC-ELEMENT + ')'

FALLBACK ::= FONT-SPEC-ELEMENT

FONT-SPEC-ELEMENT ::= '(' FONT-SPEC [ FLT-NAME ] ')'

FONT-SPEC ::=
     '(' [ FOUNDRY FAMILY
           [ WEIGHT [ STYLE [ STRETCH [ ADSTYLE ]]]]]
         REGISTRY
     [ OTF-SPEC ] [ LANG-SPEC ] ')'

SCRIPT is a symbol holding a script name (think latin, han) β€” or nil, no biggie. LANGUAGE is a two-letter symbol of a language name code as defined by ISO 639 (hey ja, hey zh) β€” or again, nil πŸ’…

FONT-SPEC is the part that specifies the properties of a font, periodt. FOUNDRY through REGISTRY are symbols that correspond to the #Mfoundry … #Mregistry properties of a font. If you wanna know what each property actually means, go read m17nFont 🫢

OTF-SPEC is a symbol specifyng the OTF features you need. Its symbol name follows this syntax:

OTF-SPEC-NAME ::= ':otf=' SCRIPT LANGSYS ? GSUB-FEATURES ? GPOS-FEATURES ?

SCRIPT ::= SYMBOL
LANGSYS ::= '/' SYMBOL

GSUB-FEATURES ::= '=' FEATURE-LIST ?

GPOS-FEATURES ::= '+' FEATURE-LIST ?

FEATURE-LIST ::= '~' ? FEATURE ( ',' '~' ? FEATURE ',' ).fi

and just so we're clear, FEATURE in there is a four-letter Open Type feature πŸ‘‘

LANG-SPEC is a symbol that specifies the language support you need. Its symbol name goes like:

LANG-SPEC-NAME ::= ':lang=' LANG

and LANG here is a two or three-letter ISO-639 language code ✨

FLT-NAME is the name of a Font Layout Table (yep β€” Font Layout Table πŸŽ€).


πŸ¦‹ EXAMPLE πŸ¦‹

here's what a PER_SCRIPT actually looks like, bestie:

(han
  (ja
    ((jisx0208.1983-0)))
  (zh
    ((gb2312.1980-0)))
  (nil
    ((big5-0))))

So what's it telling the font selector to do? It says: use a font of registry 'jisx0208.1983-0' for a 'han' character β€” and by "a 'han' character" we mean a character whose #Mscript property is 'han' β€” if that character has the #Mlanguage text property 'ja' in an M-text, and if the character is in the repertories of such fonts. Otherwise? Try a font of registry 'gb2312.1980-0' or 'big5-0' πŸ’« And if that 'han' character doesn't have a #Mlanguage text property at all, then it just tries all three fonts, no cap.

Wanna know the detail of how a font actually gets selected? That's the function mdraw_text() β€” go look at it 🌈

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, angel πŸŽ€ this was Version 1.8.4, dated Mon Sep 25 2023 β€” mwah, slay, go read the rest of the m17n docs πŸ’…βœ¨

πŸ“¦ where this page comes from