LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically Query Application Font Name

How can I figure out which font does LabVIEW actually use on my system for the Application Font?

 

I know LabVIEW uses some system default and I know how to query the size (Control->Property Node->Text->Font.Size), but I'd like to see the name of the actual font being used on the system I'm checking it on. 

 

Any ideas how to do that?

 

0 Kudos
Message 1 of 10
(1,274 Views)
0 Kudos
Message 2 of 10
(1,210 Views)

Thanks Paul!

 

it's not what I'm looking for, though: your VI reads the LabVIEW.ini file to retrieve user settings for the different LV fonts: these settings are optional and in their absence, LabVIEW will use some OS default and I'm looking for a direct method to determine which font is being used, regardless of .ini content.

 

I'd like to figure out, using a direct method, which Applicaiton font is being used on different machines, so I can debug a VI Analyzer problem.

 

Any thoughts?

Rok

0 Kudos
Message 3 of 10
(1,195 Views)

Apparently Windows uses Segoe UI unless Segoe UI is replaced in the registry.

 

Change Default System Font in Windows 10 | Tutorials (tenforums.com)

How to change font in Windows 10 - Microsoft Community

 

So to get the application font LabVIEW uses, we'd need to check if LabVIEW uses a custom font (read the ini) and if not, read the Segoe UI replacement font from the registry:

Get Application Font.png

 

Not tested and mostly based on online info.

0 Kudos
Message 4 of 10
(1,182 Views)

wiebe@CARYA wrote:

Apparently Windows uses Segoe UI unless Segoe UI is replaced in the registry.

 

Change Default System Font in Windows 10 | Tutorials (tenforums.com)

How to change font in Windows 10 - Microsoft Community

 

So to get the application font LabVIEW uses, we'd need to check if LabVIEW uses a custom font (read the ini) and if not, read the Segoe UI replacement font from the registry:

Get Application Font.png

 

Not tested and mostly based on online info.


The key name should be "appFont", not "Application" (also note that it's case sensitive).

0 Kudos
Message 5 of 10
(1,156 Views)

@paul_a_cardinale wrote:

wiebe@CARYA wrote:

Apparently Windows uses Segoe UI unless Segoe UI is replaced in the registry.

 

Change Default System Font in Windows 10 | Tutorials (tenforums.com)

How to change font in Windows 10 - Microsoft Community

 

So to get the application font LabVIEW uses, we'd need to check if LabVIEW uses a custom font (read the ini) and if not, read the Segoe UI replacement font from the registry:

Get Application Font.png

 

Not tested and mostly based on online info.


The key name should be "appFont", not "Application" (also note that it's case sensitive).


I copied that from your example, but didn't look far enough to see it was a ring with string values...

 

 

wiebeCARYA_0-1700158645820.png

 

I ignored the itch in my head, indicating it was wrong.

 

I suppose you can wire your ring to my method:

Get Font.png

 

However, the method only seems works if the keys are quoted...

 

I know there are CLFN functions for reading them too.

0 Kudos
Message 6 of 10
(1,146 Views)

wiebe@CARYA wrote:

@paul_a_cardinale wrote:

wiebe@CARYA wrote:

Apparently Windows uses Segoe UI unless Segoe UI is replaced in the registry.

 

Change Default System Font in Windows 10 | Tutorials (tenforums.com)

How to change font in Windows 10 - Microsoft Community

 

So to get the application font LabVIEW uses, we'd need to check if LabVIEW uses a custom font (read the ini) and if not, read the Segoe UI replacement font from the registry:

Get Application Font.png

 

Not tested and mostly based on online info.


The key name should be "appFont", not "Application" (also note that it's case sensitive).


I copied that from your example, but didn't look far enough to see it was a ring with string values...

 

 

wiebeCARYA_0-1700158645820.png

 

I ignored the itch in my head, indicating it was wrong.

 

I suppose you can wire your ring to my method:

Get Font.png

 

However, the method only seems works if the keys are quoted...

 

I know there are CLFN functions for reading them too.


Here it is all fixed up.

Message 7 of 10
(1,135 Views)

@paul_a_cardinale wrote:

Here it is all fixed up.


Tested? Still in LV20...

0 Kudos
Message 8 of 10
(1,119 Views)

Hey guys, 

looking at windows registry is still an indirect method, I was hoping I could ask LabVIEW directly, after it infers the font based on whatever environment and .ini settings.

 

Thing is, I'm having issues with VI Analyzer's Backward Wires test, which fails for a VI on my CI server, but not on my machine.

I've seen tips from @taggart [1], that the issue is related to LabVIEW using a different diagram font on the other machine and it makes sense to me.

Currently I'm blaming the way the CLI command is run in the automated process (running it as logged-in user I don't have this issue), i.e. the LabVIEW instance must have some limited abilities and can't get the Windows' font settings from the registry.

 

I just worked-around the issue by configuring the fonts in .ini to what I inferred from your comments and online documentation (Segoe UI 13 for everything [2]). I'd have preferred to derive these "good settings" by asking my own LabVIEW directly (after whichever settings and defaults are resolved), but apparently I don't have this luxury.

 

I'll see if I can elevate the way the shell is executed by my CI, otherwise this .ini configuration will have to do.

Thanks again for your help, still happy to get any tips about adequate execution in shell/CLI that could query the system for font settings, as it happens when run as logged-in user.

 

Cheers,

Rok

 

[1] https://forums.ni.com/t5/Continuous-Integration/VI-Analyzer-Tests-Failing-in-CI/td-p/4081999 

[2] https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000P8q6SAC

0 Kudos
Message 9 of 10
(1,009 Views)

You can query the registry from the command line:

 

reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts"

 

I'm sure Powershell has more and better ways then LabVIEW too.

0 Kudos
Message 10 of 10
(997 Views)