LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Resolve Font Name

Solved!
Go to solution

I have a string control set to System Font.  What I would like to know, is how can I programatically know what the name of this font is in the system?  Similarly if my font is set to Dialog, or Application.  What is the actual name being used on the system?  I am making a web interface mirroring a VI front panel, and the fonts aren't quite right and I think that could be a reason why because the font being resolves isn't the right one.  As a temporary solution I'm going to be setting these string controls to a defined known font, but I'd like to support these system level fonts too.  Thanks.

0 Kudos
Message 1 of 5
(3,871 Views)

So,

 

Well there is some kind of an underground way to do this. I will not post a snippet but I know you'll get away with that.

If you never touched the default Application/System/Dialog Box settings in LV options (in Environment category), then LV will use the Windows font (by default Segoe UI unless you have enabled ClearType feature). There might be a WinAPI function to get that information but that's not really LV-relevant.

If you have changed the fonts in the options at some point, you can use the Configuration.GetSettings method on the Application class. Pass appFont, systemFont or dialogFont as the setting name to get the real name of the font, its size and its attributes (bold, italic...). If you get Error 20, it means LV uses the default values.

 

Hope this can work for your use case!

--Eric

Eric M. - Senior Software Engineer
Certified LabVIEW Architect - Certified LabVIEW Embedded Systems Developer - Certified LabWindows™/CVI Developer
Neosoft Technologies inc.

Message 2 of 5
(3,848 Views)

HI Hoovah,

 

I think you can read it in the LabVIEW.ini file if it st in labVIEW option.

In mine i got

 

NoAdvice080=",ClassBrowser"
ProbeDefaultCache_15_0=""
systemFont="1" 14

 

Hope this help.

 

 

Sabri JATLAOUI - Certified LabVIEW Architect - Certified LabVIEW Developer
0 Kudos
Message 3 of 5
(3,839 Views)

Sorry, misread the problem.

 

It should be possible with register key.

HKEY_CURRENT_USER\Control Panel\Colors
HKEY_CURRENT_USER\Control Panel\Desktop\Colors
HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics

 

active panel.PNG

as when you click on active panel you get the system font info.*

 

Regards

Sabri JATLAOUI - Certified LabVIEW Architect - Certified LabVIEW Developer
0 Kudos
Message 4 of 5
(3,817 Views)
Solution
Accepted by topic author Hooovahh

Hi Hooovahh,

 

Found another solution. UsingPropriété SystemFonts::DefaultFont. with a .net contructor node.

 

Didn't spend much time on finding the right constructor or method.

HooovahhFont.PNG

 

Regards

 

Sabri JATLAOUI - Certified LabVIEW Architect - Certified LabVIEW Developer
Message 5 of 5
(3,780 Views)