mtext_line_break(3m17n)

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

πŸ’– mtext_line_break β€” the m17n Library's linebreak bestie πŸ’–

okay so this is mtext_line_break, from the m17n Library, and she's here to help you figure out where a line is allowed to break. no cap. πŸŽ€


✨ SYNOPSIS ✨

int mtext_line_break (MText * mt, int pos, int option, int * after)

like, one function, four args, she's lowkey elegant πŸ’…


🌸 DESCRIPTION 🌸

bestie. listen. finding where to break a line is NOT just "put a newline wherever, it's fine." it's a whole science. and this function is the science. 🧚

The mtext_line_break() function finds a linebreak position of an M-text. It checks if position pos is a proper linebreak position of an M-text mt according to the algorithm of The Unicode Standard 4.0 UAX#14 β€” yes, that's the real official ruleset, she's not vibing, she's citing. πŸ“š

If it is, it returns pos. Otherwise, it returns a proper linebreak position before pos. so like, it never just leaves you hanging β€” you always get a spot, even if it's not the one you asked for. iconic behavior honestly. πŸ‘‘

If option is nonzero, it controls the algorithm by logical-or of the members of MTextLineBreakOption. (yes, you OR them together. it's giving bitmask. it's giving slay. 🫢)

If after is not NULL, a proper linebreak position after pos is stored there. so you get the one behind you and the one ahead of you. main character energy, she's thinking about your future and your past. πŸ˜­πŸ’œ

ngl if you pass NULL for after, that's totally fine β€” she just won't fill anything in. no drama.

okay so legally speaking, here's the tea, and we do NOT skip the legal tea, periodt:

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>.

like, you can copy it, you can distribute it, you can modify it β€” the FDL said so, it's giving generous. πŸ’–


and that's the whole page, bestie! 🌈 this one's from Version 1.8.4, dated Mon Sep 25 2023 β€” so go forth and break your lines correctly, UAX#14 style. mwah. πŸŽ€βœ¨πŸ’…

πŸ“¦ where this page comes from