From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

multiple fonts in a string array indicator

I have an array (of strings) indicator that has a dynamic number of elements (3, in the example below).

Each string represents a sensor, so the total array might look like this for 3 elements:

 

Sensor 1 is at r = 4.25 cm, θ = 75.2°.

Sensor 2 is at r = 12.75 cm, θ = 15.4°.

Sensor 3 is at r = 7.75 cm, θ = 115.8°.

 

The problem is the "theta". I can write out the whole word "theta" instead, but that looks dumb. I'd like it to look as seen here, with a real theta character (assuming that this message board supports unicode, even if LabVIEW doesn't).

 

If this was just an individual string, instead of an array, I could use a "q" character along with the txt.selstart (and related) properties to change the font to "Symbol" for the appropriate portion of the indicator. But in an array, I can't think of a way to create a display that looks like I want. You'll notice that in the example, the "theta" character doesn't appear at the same character position in every line.

 

I can't believe it's true that there exist character combinations that are impossible in LabVIEW, so I know there must be a way to do this. I just can't figure out how!

 

Thanks for any suggestions!

0 Kudos
Message 1 of 7
(3,403 Views)

https://decibel.ni.com/content/docs/DOC-10153

 

See if this helps.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 2 of 7
(3,382 Views)
It is possible to format subsets of strings in indicators. Basically the indicator has a selection property that you use to select the character(s) that you want to format, then other property nodes can set things like fonts or bold facing.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 7
(3,350 Views)

But since they are properties, I doubt you'll be able to use them on different elements of your string array.  Arrays have different values, but all elements must share the same properties.

Message 4 of 7
(3,337 Views)

For the time being, I decided to concatenate the elements into one large string (with carriage returns after each element).

Then, I used the single string properties to format it the way I wanted.

It turned out to be surprisingly slow, but I was also able to italicize r and θ.

 

I had already read the document cited above by aputman, but I think that whole process is way over the top.

Also, since it requires you to manually edit some .ini files, and I won't have access to the computers where my code is eventually used, it wasn't a real option.

 

I wonder if there's a way for NI to formally extend the ascii set used in LabVIEW in a way that is consistent with past usage.

 

Ed Pogo

 

0 Kudos
Message 5 of 7
(3,278 Views)

There has been some discussion about how the display could be modified. As I recall the basic issue is that the data is just the string characters.  To change it to allow formatting to go along with the data requires a completely different data structure.  So I think it is unlikely that NI will ever change the string data type to allow that kind of formatting.  Check the Idea Exchange Board to see if there is a proposal for an alternate datatype and indicator. If someone propses something like that and it gets enough kudos, NI might consider adding the new data type along with the indicators to display it.

 

Lynn

0 Kudos
Message 6 of 7
(3,253 Views)
To save time, be sure to defer screen updates before you start modifying the string indicator properties and then reenable them when you are done.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 7 of 7
(3,235 Views)