mfont_get_prop(3m17n)

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

✨ NAME ✨

mfont_get_prop β€” bestie, it gets a font property, that's the whole vibe πŸ’–

(also hi, you're in the m17n Library manual, section 3m17n, welcome to the group chat 🫢)


✨ SYNOPSIS ✨

void* mfont_get_prop (MFont * font, MSymbol key)

🌸 DESCRIPTION 🌸

okay so, real talk: this function is literally your font's info desk. You hand it a font and a key, and it hands you back the value of that key property. Simple. Iconic. No cap. πŸ’…

key must be one of these symbols β€” like, the assignment is mandatory, this is the list:

  • Mfoundry
  • Mfamily
  • Mweight
  • Mstyle
  • Mstretch
  • Madstyle
  • Mregistry
  • Msize
  • Mresolution
  • Mspacing

and plot twist πŸŽ€ β€” if font happens to be a return value of mfont_find(), then key can also be one of these extra ones:

  • Mfont_ascent
  • Mfont_descent
  • Mmax_advance

iykyk ✨


πŸ’– RETURN VALUE πŸ’–

so what do you actually get back? depends on which key you picked, bestie:

  • If key is Mfoundry, Mfamily, Mweight, Mstyle, Mstretch, Madstyle, Mregistry, or Mspacing, this function returns the corresponding value as a symbol. 🌸
  • If the font does not have that key property, it returns Mnil. 😭
  • If key is Msize, Mresolution, Mfont_ascent, Mfont_descent, or Mmax_advance, this function returns the corresponding value as an integer. πŸ”’
  • If the font does not have that key property, it returns 0. πŸ’€
  • If key is something else entirely (like, not on either list??), it returns NULL and assigns an error code to the external variable merror_code. ⚠️

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 on mfont_get_prop(3m17n), bestie!! this page is living in Version 1.8.4, dated Mon Sep 25 2023, and it ate, fr fr. go get those properties, main character πŸ¦‹β­πŸ’œ

πŸ“¦ where this page comes from