Calculate line break in multiline text in control pages

Posted on
Sat Sep 04, 2021 1:10 pm
ParMan offline
Posts: 11
Joined: Feb 15, 2019

Calculate line break in multiline text in control pages

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

Posted on
Sat Sep 04, 2021 5:55 pm
DaveL17 offline
User avatar
Posts: 6739
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Calculate line break in multiline text in control pages

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 2517 times

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Sat Sep 04, 2021 10:16 pm
ParMan offline
Posts: 11
Joined: Feb 15, 2019

Re: Calculate line break in multiline text in control pages

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 :-(

Posted on
Sun Sep 05, 2021 6:17 am
DaveL17 offline
User avatar
Posts: 6739
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Calculate line break in multiline text in control pages

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.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Sun Sep 05, 2021 1:24 pm
berkinet offline
User avatar
Posts: 3289
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Calculate line break in multiline text in control pages

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.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest