LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Font installation on Windows 7

Solved!
Go to solution

Hi,

 

I'm trying to include a font in a distribution kit.  I've included it by having it installed to the [Fonts] location on the target computer in the "Edit Installer" dialog.  If I install my application on a Windows XP computer the font seems to install fine, I can see it under "Control Panel"->"Fonts", and my application is able to use the font with no problems.  If I use the same installation package on a Windows 7 system, the font seems to get copied to C:\Windows\Fonts (confirmed through the command prompt), however, the font does not show up in control panel, and my application is not able to use the font, even after rebooting the PC.

 

Any ideas why the installation package is having problems installing the font?  I can manually install the font then it shows up properly in control panel and my application is then able to use it.  Is it something I'm missing in the installation options?

 

The computer I'm using to generate the installer is running Windows XP SP3 with CVI 2012.  The target PC is running Windows 7 Professional 32-bit.  Thanks.

 

 

0 Kudos
Message 1 of 6
(5,389 Views)

Hi tstanley,

 

When copying a font file to the Windows/Fonts folder through the Windows Explorer, Windows Explorer will realize that this is a special directory so it actually does an install operation instead of just copy and paste. It sounds like with your installer the .tff file is only being copied to the Windows/Fonts folder but not being installed. Does running the executable as administrator (right-click » Run as administrator) make a difference?

Humphrey H.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 6
(5,372 Views)

Hi Humphrey H,

 

Thanks for the reply.  I'm under the impression that installers on Windows 7 always run as an administrator, and starting the installer on Windows 7 does trigger the UAC prompt.  Nevertheless, I did try installing the application by right-clicking and running the installer as administrator and the font did not install in that case either.

0 Kudos
Message 3 of 6
(5,365 Views)
Solution
Accepted by topic author tstanley

Okay - so the installer is moving the .tff file to the Fonts folder. You'll probably need to include a script or batch file to install the font. A quick search brought this page up, which also explains why placing the .tff file in the Fonts folder doesn't necessarily install the font: http://blogs.technet.com/b/rspitz/archive/2010/09/25/how-to-install-a-font-from-the-command-line-on-...

Humphrey H.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 6
(5,348 Views)

Hi Humphrey H,

 

It appears that you are correct, and the installer only copies the file to the fonts directory.  This seems to be good enough for Windows XP but not for Windows 7 (and presumably Vista and 8).  I'll put an entry into the LabWindows/CVI Idea Exchange for an improvement to installer that will automatically install fonts correctly in Windows 7.  Thanks for looking into this.

 

Message 5 of 6
(5,343 Views)

You do not need to install the fonts on Windows, for using it in your application.
You can copy the font file during the installation of your program in a sub-folder, such as "\\fonts".
In main () you must add the SDK function (you must also include the library "gdi32.lib")

#include "windows.h"
AddFontResource ("fonts\\xxxxxxxx.ttf");

This allows you to use the fonts without installing it in Windows, for the duration of the user's login session.
It works even if you logged in as a standard user.

Fabrizio

0 Kudos
Message 6 of 6
(4,196 Views)