LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Query default font programmatically

I know there have been many posts on font sizes and keeping them the same between VIs and EXEs, but I think I have one that hasn't been addressed elsewhere.

 

I'd like to create a VI that automatically generates the .ini file that goes along with the EXE. The point of the VI is to make sure that the EXE font sizes end up the same as those from the development environment.

 

My problem is that I don't know how to query the default LabVIEW font size programmatically. That is, the size of font LabVIEW uses for app, dialog, system if nothing is specified in the LabVIEW ini file. I know that the default LabVIEW font size is somehow derived from the Windows Message Box font, and I can query that with a .NET property node, but I can't figure out how exactly LabVIEW decides what size to use from the Windows setting.

 

For example, I have two machines. One is Windows 7, one is Windows Server 2008. The Windows 7 machine uses size 9 Segoe UI for its message box font. The Windows Server 2008 machine uses size 8 Tahoma. Neither machine has any font settings in its LabVIEW ini file. If I drop a control on the front panel in Windows 7, I end up with application font size 15. If I drop a control in Server 2008, I end up with app font size 13. If I then go and change the windows message box font to size 9 Tahoma in Server 2008, my controls show up as app font size 14. It seems like LabVIEW decides what font size to use by default in a slightly different way in 7 vs Server 2008.

 

Does anybody know how to ask LabVIEW programmatically what its default font size is?

0 Kudos
Message 1 of 3
(3,541 Views)

I just tried changing the Server 2008 machine's message box font to Segoe UI 9 instead of Tahoma 9, and now a new control shows up with application font size 15 instead of 14. It seems like LabVIEW takes the Windows font setting's font type as well as size into account when deciding what the default font size is.

0 Kudos
Message 2 of 3
(3,539 Views)

maxwellb,

 

The easiest way to programatically ask what the default font size is to have a control on the front panel and use a property node to ask the font size.  This property node is under text>>font>>size. If you do not want the control to be visible on your front panel because you are not using it, you can click the control from the block diagram and choose hide control.  
Because there has been a lot of talk about keeping fonts consistent across platforms, there is an idea exchange on this issue where ideas can be presented to R&D: http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Persistent-font-Settings/idi-p/943336
I encourage you to give this Kudos if it is something you would like because this is how R&D makes decisions on what to include in future versions.

0 Kudos
Message 3 of 3
(3,515 Views)