LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Font deployment

Solved!
Go to solution

If I want to use custom font (non-default Windows font) in compiled LV code (EXE or PPL) what is the best way to deploy it? Do I need to install it on the target machine or it can/is somehow embedded into a compiled code? If I need to install it, what would be the best automated approach? How do you manage custom fonts in general?

Michał Bieńkowski
CLA, CTA

Someone devote his time to help solve your problem? Appreciate it and give kudos. Problem solved? Accept as a solution so that others can find it faster in the future.
Make a contribution to the development of TestStand - vote on TestStand Idea Exchange.
0 Kudos
Message 1 of 2
(1,106 Views)
Solution
Accepted by topic author bienieck

Generally fonts have to be installed on the target system. Only a few applications have embedded font handling such as Adobes PDF Reader (Adobe is one of the main developers of the Font standards on Mac and Windows so they have both the knowledge and incentive to do such things). But for most others, font handling with the built in OS capabilities is already more than complex enough the handle, so they won't want to start to worry about providing font embedding capabilities into the application itself.

 

And you can't just drop a font file into the Font folder anymore. That worked back in Windows 95 days but in a modern OS even fonts can be something that can and sometimes do contain malicious code so you need elevated rights to install them in the system.

 

As such installing a program on a computer also requires elevated rights so the standard method is to create an installer for your program and add the font installation routines in the post install hook of that installer. You can do that even in a LabVIEW generated installer. An easy solution to make sure the font is copied to the right location and added to the registry is to use this tool. The archive even comes with the according source code and it would be relatively simple to create the same code in LabVIEW too but it requires elevated rights. So the easiest would be to simply add the call to FontReg.exe into the PostInstall call for your installer as an installer always is started with elevated rights and any child process started by it inherits those rights too.

Rolf Kalbermatter
My Blog
Message 2 of 2
(1,094 Views)