mdraw_glyph_list(3m17n)

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

✨ mdraw_glyph_list ✨

okay so bestie, you know how a string of text is not just a string of text β€” it's a whole lil lineup of glyphs waiting to be drawn? yeah. this is the function that gives you the receipts on that lineup. it lives in The m17n Library and its manual page is mdraw_glyph_list(3m17n). πŸ’…


🌸 SYNOPSIS 🌸

int mdraw_glyph_list (MFrame * frame, MText * mt, int from, int to,
MDrawControl * control, MDrawGlyph * glyphs, int array_size, int *
num_glyphs_return)

πŸ¦‹ DESCRIPTION πŸ¦‹

so like, the whole point of mdraw_glyph_list() is to compute information about a glyph sequence. it's giving detective energy, fr fr. πŸ”

here's the tea: it figures out the info about all the glyphs that correspond to the text sitting between from and to inside the M-text mt β€” but only for the specific scenario where that text is drawn onto a window of the frame frame using the mdraw_text_with_control() function, with the drawing control object control in charge. πŸŽ€

glyphs is an array of objects where all that info gets stored, and array_size is, you guessed it, the size of that array. πŸ‘‘

now, two possible endings, and honestly both are valid:

  • if array_size is big enough to cover all the glyphs β€” slay! ✨ it stores the number of actually filled elements in the place pointed to by num_glyphs_return, and returns 0. that's the happy ending.
  • otherwise (the array was too smol, tragic 😭) β€” it stores the required array size in the place pointed to by num_glyphs_return, and returns -1. so you get told exactly how much room you need, no guessing.
lowkey important: -1 is not an error vibe, it's a "hey, your array needs to be this big" vibe. read num_glyphs_return and come back with a bigger array, periodt. πŸ’œ

πŸ’– SEE ALSO πŸ’–

  • MDrawGlyph β€” the glyph object in question, go say hi to 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 the whole page, bestie 🫢 this was Version 1.8.4, dated Mon Sep 25 2023, and it's filed under mdraw_glyph_list(3m17n). no cap, go draw some glyphs. πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from