Re: Gem [text2D] including line breaks
IOhannes m zmoelnig via Pd-list <[email protected]> Wed, 28 Jan 2026 12:22:17 +0100
| Newsgroups | gmane.comp.multimedia.puredata.general |
|---|---|
| Message-ID | <[email protected]> |
On 1/28/26 11:56, cyrille henry via Pd-list wrote: > fudi is "just" ascii with a ; as the end. > If you remove the ";", then you only have ascii... actually it is UTF-8. which also explains the problem with peter's umlauts, because the [string( message expects unicode points and not UTF-8 bytes. (see wikipedia for the gory details) e.g. the german umlaut "ä" is assigned the unicode point '228'. so [text2d] expects a message like [string 228( to render the letter. however in UTF-8, "ä" is encoded as two bytes '195 164'. since [fudiformat] just outputs bytes, you will get a message [string 195 164(, which will render as "ä" (unicode points 195 and 164). at the PdCon09 in [string 83 227 111 32 80 97 117 108 111(, me an maira wrote a small vanilla library to convert between UTF-8 and unicodepoints. it's available on deken as "unicode". > > cheers > c > > Le 28/01/2026 à 11:50, Peter P. a écrit : >> Hi Cyrille, >> >> wow-that's impressive! Merci a lot for your patch and the insight! >> >> Does this mean that text2d understands fudi? I can't see any conversion >> back from fudi. >> >> best, Peter >> >> * cyrille henry via Pd-list <[email protected]> [2026-01-28 11:40]: >>> hello, >>> >>> This patch use fudiformat to convert the text to ascii and various >>> list object to concatenate all line and clean the ; and the end of >>> the lines. >>> >>> It is then rendered with the string message that allows the linefeeds. >>> >>> cheers >>> C >>> >>> >>> Le 28/01/2026 à 11:21, Peter P. a écrit : >>>> Hi, >>>> >>>> this topic seems to come up frequently [1] >>>> and I am looking for a vanilla solution of rendering multiline text >>>> from >>>> a textfile in Gem's [text2d] object. >>>> >>>> I can output multiple lines but text2d expects all text to be prefixed >>>> with either "text" or as list. Both seem unable to pass on linefeeds >>>> correctly, at least in my minimal working example (attached). >>>> >>>> Anything I can try next? >>>> Thanks for all your ideas! >>>> best, Peter >>>> >>>> >>>> [1] https://lists.iem.at/hyperkitty/list/[email protected]/ >>>> thread/XUS657GKDCQE3GUDIGZYA5U46K5365UL/ >>>> >>>> >>>> --- >>>> [email protected] - the Pure Data mailinglist >>>> https://lists.iem.at/hyperkitty/list/[email protected]/ >>>> message/2YHOGTFYK2TRDMJPR6PPRKEVQFWS7K5Y/ >>>> >>>> To unsubscribe send an email to [email protected] mailing list >>>> UNSUBSCRIBE and account-management -> https://lists.iem.at/ >> >>> #N canvas 907 166 572 694 12; >>> #X declare -lib Gem; >>> #X obj 37 69 gemhead; >>> #X obj 161 236 textfile; >>> #X obj 37 622 text2d; >>> #X obj 229 13 declare -lib Gem; >>> #X msg 195 53 create \, 1; >>> #X obj 195 80 gemwin; >>> #X obj 161 203 until; >>> #X msg 193 175 read multiline.txt cr \, rewind; >>> #X obj 161 122 bng 20 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc >>> #000000 #000000; >>> #X obj 161 265 fudiformat; >>> #X obj 161 515 list prepend string; >>> #X obj 161 544 list trim; >>> #X obj 161 449 list prepend; >>> #X msg 382 289 list; >>> #X obj 161 149 t b b b; >>> #X obj 237 483 list; >>> #X obj 161 386 list split 1; >>> #X obj 242 327 list length; >>> #X obj 242 354 - 2; >>> #X obj 161 292 t l l; >>> #X obj 161 416 list append 10; >>> #X connect 0 0 2 0; >>> #X connect 1 0 9 0; >>> #X connect 1 1 6 1; >>> #X connect 4 0 5 0; >>> #X connect 6 0 1 0; >>> #X connect 7 0 1 0; >>> #X connect 8 0 14 0; >>> #X connect 9 0 19 0; >>> #X connect 10 0 11 0; >>> #X connect 11 0 2 0; >>> #X connect 12 0 15 0; >>> #X connect 12 0 10 0; >>> #X connect 13 0 12 1; >>> #X connect 14 0 6 0; >>> #X connect 14 1 7 0; >>> #X connect 14 2 13 0; >>> #X connect 15 0 12 1; >>> #X connect 16 0 20 0; >>> #X connect 17 0 18 0; >>> #X connect 18 0 16 1; >>> #X connect 19 0 16 0; >>> #X connect 19 1 17 0; >>> #X connect 20 0 12 0; >> >>> --- >>> [email protected] - the Pure Data mailinglist >>> https://lists.iem.at/hyperkitty/list/[email protected]/ >>> message/3LON4GBP4E7K5NMCPTT2CZA2TMACSPIO/ >>> >>> To unsubscribe send an email to [email protected] mailing list >>> UNSUBSCRIBE and account-management -> https://lists.iem.at/ >> >> >> --- >> [email protected] - the Pure Data mailinglist >> https://lists.iem.at/hyperkitty/list/[email protected]/message/ >> Y5TQ4ZSLIETXZSGRGX3SOBSYLSE2P76Z/ >> >> To unsubscribe send an email to [email protected] mailing list >> UNSUBSCRIBE and account-management -> https://lists.iem.at/ >> > > > --- > [email protected] - the Pure Data mailinglist > https://lists.iem.at/hyperkitty/list/[email protected]/message/ > TTO4ON34RSJDE6O3YKKNN2PDIALVJLDU/ > > To unsubscribe send an email to [email protected] mailing list > UNSUBSCRIBE and account-management -> https://lists.iem.at/ -- please do not CC me for list-emails --- [email protected] - the Pure Data mailinglist https://lists.iem.at/hyperkitty/list/[email protected]/message/HD5N6UIIVWJWRX7SNF75LXQGNK4VHNAJ/ To unsubscribe send an email to [email protected] mailing list UNSUBSCRIBE and account-management -> https://lists.iem.at/
OpenPGP_signature.asc
(application/pgp-signature, 840 B)
-----BEGIN PGP SIGNATURE----- wsF5BAABCAAjFiEEdAXnRVdICXNIABVttlAZxH96NvgFAml58WoFAwAAAAAACgkQtlAZxH96NviG Vw//VjOPliaRHeqvOxb7d1tFiHhGxcnlqUcnEFAqnW2CoJ1QKBrdRkfMoEf0uX4AI/wl3n/TAk2a vtJVWDP+yxdqt7TPLG3UU+m7uhTljEhLHM/nW5UfMmD32xy0wz6gjGv0Uq002Baz2TwQUOg+dfBQ /OAww2RV6w7mfstD9iUsBomtqRjBuVNOq3Inlfo35kGP9MafEz5cI6hfgxv8NoltLJ7A3iZ6My68 QWREUDW4FYpn+Mtph5uc/NVSbXJNDK82mGmwa6NQB6KbaNogebeozNEmDSeXoOWW2K74YIPaCpQr khZmDG6+RbPIrtjobwafcYDKHkvdCmk/bnP1RkPDIaW8tOe/+aj2+zSQzCOyzqj6ETktl82Oq/bP YVDXcV/gxkhJwWOoH3X4jzYwFtJHeqPPhTvXg6L5OjzIS1k532A24akjrQVAYNrVtsIyXjsdJW+d D+brP2QaZ2ni52Xn7miwi8/aMAgs/Uc9dQsZ/jfA1Ie36cez3BUernrRbPzzaMziQPORKN8NGSUm 65qairr6GTGMINrzZ4JNkCMJuwqN5qx6Gps6buL67x5rbn0C6o1POqzbVmeLcfF09cTgfIzZxL8p jz+xXFPLZUP6A7W0yOpUAdZ12EUMzCnDzSuUHSL3d4mhgMrA/uUY7AF3iJRyY660KZb2WwfZSydo 50w= =J3Os -----END PGP SIGNATURE-----