LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Size of label text changed on some PC's

Hello,
 
When my program is loaded on some PC's all label text (command buttons, Tab pages,...) increases and messes up the whole User Interface. Is there any way to prevent this? Is this caused by some Windows settings on these PC's?
 
Thanks for all help,
Wim
0 Kudos
Message 1 of 14
(4,702 Views)
Hi Wim,
 
I have noticed that sometimes. What i did was on your uir edit panel....go to other attributes and uncheck scale contents on resize...also try to uncheck sizeable and try auto centring...see if it wrks
 
I doubt its goin to a solution but worth a try. Well if i come across i a better sol will let u know.
 
Good luck!
 
k1_ke
0 Kudos
Message 2 of 14
(4,687 Views)

Hello,

I have done al these things, but it didn't solve the problem... Smiley Sad

0 Kudos
Message 3 of 14
(4,687 Views)
Wim,

Try changing the fonts in a couple of the buttons and see if it makes a difference.

By default, CVI controls use the "NIDialogMetaFont". This is an alias to a system-wide font that can vary from computer to computer, so that user interfaces can enforce the end-user's preference, both for style and size ("large fonts", for example). All the "NI ... MetaFont" fonts are aliases.

If you don't want your font to change you only need to change the size or the style of the font you're using, and then it should always use the same font everywhere.

Luis
NI
Message 4 of 14
(4,677 Views)
One possiblity is that the PCs in question have a high DPI setting (in XP that's Control Panel > Display > Settings > Advanced).   Ensure that is set to "Normal 96 dpi".
 
Hope this helps.
--Ian
Message 5 of 14
(4,657 Views)
I just came across a link I had wanted to include in my last post. Here is an MSDN article on programming for high DPI.
 
Also, I've attached a simple UIR that displays a variety of fonts. It might be useful for anyone testing these issues out.

--Ian

Download All
Message 6 of 14
(4,631 Views)

Hello Luis and Ian,

sorry for my late reply. I was on course this week... Thanks for all information. I'll work on it next monday.

Wim

0 Kudos
Message 7 of 14
(4,586 Views)

Hello,

The computer was set to 120dpi. Changing it into 96dpi solved the problem. If I understand right, I should not use the NIDialogMetaFont with size 11 (which is the standard font in my UIR). Is there any font that looks like this font? Ian, I opened your fonts.uir file, but it only shows NI fonts... Is there any way to change the fonts of all controls (my User Interface is pretty large so I really hope I don't have to change the fonts of each control seperately).

Again, thanks a lot for your help.

0 Kudos
Message 8 of 14
(4,563 Views)
Wim,
If I recall correctly, changing away from NI fonts will not solve the DPI issue for you. That DPI issue is a real pain, and to be fair, it is arguably a Windows issue rather than an NI one.

First I'd suggest trying that fonts.uir example -- take a look at the last column of fonts. They include several TrueType fonts, plus older font types (e.g. Courier & MS Sans Serif).

If you still want to do a mass change of fonts in your UI, I the only way I know of is to save the UIR as a text file (Options > Save In Text Format) and do a search and replace. (Backup originals and proceed carefully!)

One last comment: that DPI issue can be mitigated somewhat by placing text labels in places where they won't overrun other controls if they grow in length. For example the label for a numeric control is better placed to be to the right of the control. Also the UI needs to be well spaced out. Not great, but it helps a bit.

--Ian
Message 9 of 14
(4,550 Views)

So there is no decent way to solve this DPI problem? Smiley Sad

Is there any way I can check the user's DPI settings, so I can warn him when he launches the program? Is it stored in some register?

0 Kudos
Message 10 of 14
(4,546 Views)