LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Community Nugget: Get Text Rectangle font tip

Have you ever wanted to get the text size for a given text, LabVIEW has an easy VI for this:

Get text Rect 

 

Wouldn't it be nice if we could connect this to the property node of a string control:

String_ClusterError.png

Unfortunatly the Fonts don't match, so we end up with the following code:

ConvertFontCluster.png

 

But recently I found out that NI has created a little VI in vi.lib that does this conversion:

Convert Fonts.png

 

The helper VI is located at the following location:

vi.lib\Utility\error.llb\Convert property node font to graphics font.vi

 

Please be aware that NI might change this VI for their own will, so you might want to make a working copy for your code.

 

For an overview of past nuggets look here.

 

Ton

Message Edited by TCPlomp on 08-06-2010 08:06 PM
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 1 of 2
(3,224 Views)

Nice find Ton.

 

This prompts me to ask out loud "Why is there so little use of type definitions in LV core?"

 

There are a lot of other nodes that would alos benefit from type defs.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 2
(3,215 Views)