Page 1 of 1

Calculate line break in multiline text in control pages

PostPosted: Sat Sep 04, 2021 1:10 pm
by ParMan
Hi,
Is there a way to calculate line breaks to a fixed with in a control page using this plugin?
I'm specifically looking at automatically adding line breaks to weather+ worded forecast strings that usually a string far too long to fit on a control page -especially on an iPhone.
Is this possible?
If not, Is there any other plugin that can do this?

Thank you

Re: Calculate line break in multiline text in control pages

PostPosted: Sat Sep 04, 2021 5:55 pm
by DaveL17
The Matplotlib plugin has a Multiline Text Device that generates image files of long strings. It doesn't automatically detect line breaks--rather it splits the text based on a number of characters listed in the device's configuration settings.

chart_multiline.png
chart_multiline.png (16.75 KiB) Viewed 2034 times

Re: Calculate line break in multiline text in control pages

PostPosted: Sat Sep 04, 2021 10:16 pm
by ParMan
Thanks, but I was hoping for a text based solution, as I need to have different length text strings in different layouts - each layout having 10 strings that needs to have line breaks :-(

Re: Calculate line break in multiline text in control pages

PostPosted: Sun Sep 05, 2021 6:17 am
by DaveL17
Is there a way to calculate line breaks to a fixed wi[d]th in a control page using this plugin?


I'm specifically looking at automatically adding line breaks...


I need to have different length text strings in different layouts - each layout having 10 strings that needs to have line breaks


Can you elaborate? It's difficult to understand exactly what you're trying to accomplish. Please be specific.

Re: Calculate line break in multiline text in control pages

PostPosted: Sun Sep 05, 2021 1:24 pm
by berkinet
The fmt command will do what you want. However, getting your text into and back from fmt may be non-trivial. It really depends on your data source and how you get the text to the control page. But, for a example, it would be fairly simple to pipe the output of some command to fmt, and then save the results in an Indigo variable by using a RESTapi call.

For more information do “man fmt” in a terminal window.