LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CVI 8.5: Bold NIDialog size 14 for panel titles doesn't work

Is it a CVI 8.5 issue, that I can't have panel titles in classic style with bold NIDialog font size 14? After pressing OK is changes to "NIDialogMetaFontPrototypeBoldface - (not found)", and this font doesn't display Umlauts correctly. Also this is just with size 14, as far as I can tell.
-----------------------
/* Nothing past this point should fail if the code is working as intended */
0 Kudos
Message 1 of 7
(4,032 Views)
Dear CVI-User

I didn't see this behavior with a font size of 14 but 11. It doesn't seem to have any effect after all; did you see any difference?

Best regards

Philipp R.
0 Kudos
Message 2 of 7
(3,979 Views)
Sorry for the late reply.

The effect I get is, that in UIR editor, it looks 'normal', but when the program is run, the panel title font has an odd size and umlauts are some other special characters.
I included a little picture.
-----------------------
/* Nothing past this point should fail if the code is working as intended */
0 Kudos
Message 3 of 7
(3,856 Views)
This is a bit bizarre. Let me ask you a couple of questions:
 
1. Is the computer that is running the program the same computer in which you edit the .uir?
 
2. Do you have any font-related keys in the registry, in this location:
 
           HKEY_LOCAL_MACHINE\SOFTWARE\National Instruments\CVI Run-Time Engine\cvirte
 
3. Do you create any metafonts in your program?
 
Luis
0 Kudos
Message 4 of 7
(3,835 Views)
1. Yes and no. The screen shot is genuine (exept from the orange writing and the font dialog cut-out). But the 'strange' symbols also show on the target machines, which are plain XP SP2/SP3 installations with the current runtime.

2. The mentioned key is empty

3. No. The test program just loads the panels and displays them.

I guess the font is broken the time I click OK in the editor and the saved in the UIR.

I have different CVI versions (8.5, 8.1, 8.0 and even older ones) installed. Maybe this caused a problem on installation?

-----------------------
/* Nothing past this point should fail if the code is working as intended */
0 Kudos
Message 5 of 7
(3,816 Views)

Okay, I found the problem. It is in fact a bug in the CVI environment. There is an internal-use only metafont that was not properly registered as internal-use only, that happens to match the font settings that you chose ("NIDialog", 14, bold, etc...). What's happening is that the .UIR is being saved with a reference to the name of this metafont. Then, when you load the .uir, this metafont does not exist, so your panel ends up with the different typeface (and as of CVI 8.0.1, whenever a nonexisting font is specified, you also end up with the OEM character set, instead of the Latin character set, which is why your umlauts don't work).

There are a couple of workarounds that you can choose from, until this bug is fixed:

1. Save a .tui file alongside your .uir file. Then, edit the .tui file in any text editor, and replace the ATTR_TITLE_FONT value for that panel with "NIDialog". In your program, pass the .tui file to LoadPanel, instead of the .uir file.
The disadvantage of this method is that you'd have to do this every time you make a change in the .uir. Also, loading a .tui file is going to be a bit slower than loading the .uir file.

2. A better method might be to create the "required" metafont in your program. You do this by making the following call, before calling LoadPanel:

CreateMetaFont ("NIDialogMetaFontPrototypeBoldface", "NIDialog", 14, 1, 0, 0, 0);

Luis

0 Kudos
Message 6 of 7
(3,799 Views)
Thank you.

The workaround I use is to simply select NIDialog 13 bold. It is the same (pixel) size as the 14 dots one. At least I see no difference...
-----------------------
/* Nothing past this point should fail if the code is working as intended */
0 Kudos
Message 7 of 7
(3,785 Views)