mfont_parse_name(3m17n)

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

mfont_parse_name πŸ’–

okay bestie, welcome to the mfont_parse_name page from the The m17n Library manual β€” she's a tiny function with big main character energy ✨


✨ NAME ✨

mfont_parse_name β€” the one that takes a font name (a string, a little text vibe) and hands you back an actual font object πŸŽ€ no cap, that's the whole plot.


🌸 SYNOPSIS 🌸

MFont* mfont_parse_name (const char * name, MSymbol format)

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea, bestie: mfont_parse_name() creates a new font object. That's it, that's the job πŸ’… The properties get pulled out of the fontname β€” like, name is where the good stuff lives, and this function goes in and extracts all the properties from it. obsessed.

the format argument tells it how to read name, and it's giving three whole moods:

  • if format is Mx β€” name gets parsed as XLFD (that's X Logical Font Description, the classic one πŸ‘‘)
  • if format is Mfontconfig β€” name gets parsed as Fontconfig's textual representation of a font 🌈
  • if format is Mnil β€” it tries name as XLFD first, and if that fails, it falls back to parsing it as Fontconfig's representation. literally the "try again bestie" option πŸ™ˆ

πŸ’œ RETURN VALUE πŸ’œ

if the operation was successful, this function returns a pointer to the created font 🫢

otherwise? it returns NULL. yeah. πŸ’€


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 the whole page, bestie β€” Version 1.8.4, dated Mon Sep 25 2023, signed off with love from the m17n crew πŸ§šβ€β™€οΈ slay, go parse some font names, periodt πŸ’–βœ¨

πŸ“¦ where this page comes from