mtext_line_break(3m17n)
π 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 passNULLforafter, that's totally fine β she just won't fill anything in. no drama.
π COPYRIGHT π
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
- debian trixie: m17n-docs 1.8.4-1
- ubuntu noble: m17n-docs 1.8.4-1
- ubuntu questing: m17n-docs 1.8.4-1
- ubuntu resolute: m17n-docs 1.8.4-1build1
- ubuntu stonking: m17n-docs 1.8.4-1build1
- Copyright (C) 2001 Information-technology Promotion Agency (IPA)
- Copyright (C) 2001-2011 National Institute of Advanced Industrial Science and Technology (AIST)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms