From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

UI Interest Group Blog

Community Browser
cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Font Sizes in LabVIEW - Conversion Utility VI

SimonH
NI Employee (retired)

Someone recently asked me if there was a way to standardize LabVIEW font sizes relative to other Windows applications as altenbach describes in his idea exchange post

Screen Shot 2013-06-07 at 3.57.12 PM.png

I did some digging and was able to write a VI to convert a point size into the equivalent LabVIEW size.

Screen Shot 2013-06-07 at 4.02.26 PM.png

I'm posting here just in case anyone else is in need of this functionality. (Note that I haven't tested the backsaved LabVIEW 8.0 VI)

Comments
Darin.K
Trusted Enthusiast

Something funny is still going on, I run the program to find out what size 72 point Arial should be.  Your code says 107 "point".

Create a label with 107 "point" Arial and it measures 0.75".  (72/96 = 0.75)

MS Word produces a 1.0" font with 72 pt Arial.

LV FontCalculatorIssue.png

And the backsaved version was completely messed up and crashed my LV9 mercilessly.

Edit:  Found a non-standard display setting on my machine which must not have been sniffed down by this program.  It actually gets it much closer now.  I use a lot of graphic drawing programs so I really like to have 72pt = 1 in.

SimonH
NI Employee (retired)

Darin,

Do you know which setting it was? If it's a common one we could track down where Windows keeps track of it and correct for it.

When I use 107 as my size in LabVIEW it lines up perfectly with 72 in WordPad (which I'm assuming renders the same as Word).

Screen Shot 2013-06-10 at 10.04.01 AM.png

Darin.K
Trusted Enthusiast

I'll see if I can track it down on that machine again.  I just turned off a few third-party tools and it snapped into place.

I may never use the code as you intended, but I always appreciate adding a few CLFN wrapped Windows functions to my collection. 

Active Participant

I would appreciate you publishing that collection!

Active Participant

Darin, did you ever reproduce the problem?

Active Participant

Not working for me, either. I asked for 11pt Arial, but the recommended LV font (18 pt Arial) is one pixel taller than what WordPad shows at 100% zoom.

one_size_off.png

Hooovahh
Proven Zealot

So this is useful and I appreciate it, but what about the reverse function?  Given a LabVIEW sized font text, what point size is that?  I can probably just run the posted VI for every point size I expect, and generate a list of LabVIEW font sizes, then reverse this in some look up, but if there is a more straight forward solution I'd appreciate it.

Jason_Drotman
Member

Just a note, please keep in mind that Windows offers a "font scaling" option that tends to mess up applications. Win10 is "supposed" to be a bit better, but this sort of functionality would almost certianly not work with the windows scaling feature.

Just for kicks, I looked it up and found an article suggesting Labview *does* take windows font scaling into consideration:

http://digital.ni.com/public.nsf/allkb/2F11E12E565D2DD5862579490062827D

kongmingpeng
Member

Thanks a lot,but it seems like your result do not suit me. Px for 蓝湖 is compared with pt for labview,but I can't find the regular to convert.

kongmingpeng_0-1689760684739.png

 

kongmingpeng
Member

Hello SimonH,Hello Darin.k
I used the VI you wrote, but I got the same result as Darin.k

kongmingpeng_0-1690186594179.png

I checked that the zoom ratio on my machine is 100%, which should satisfy the default Windows of 96DPI per 1 inch, so I'm not sure what other display Settings I need to change to achieve the same results as yours