What's New
Q & A
Tip Jar
C# Helper...
Follow VBHelper on Twitter
MSDN Visual Basic Community
  Tip: Install fonts  

Thanks to Storm Aki.

Storm checked a bunch of sites for code that installs fonts but couldn't find anything that worked in all Windows envirnoments and font types. Here's the solution Storm found.

When opening the Fonts folder, Windows Scans the folder for any non-Registered fonts and Registers them. That's why, when installing certain fonts, you need to reboot the machine or open the fonts folder before the fonts will work; but asking the user to open this folder is not good coding practice. I'm sure there is another way to do the same but I could not find out exactly windows does this. So I came up with this idea...

These are the steps I used:

  1. Copy the required fonts to the Fonts Folder. Run a Custom DLL to find the fonts folder
  2. Open the Fonts Folder. Again by running a Custom DLL to find the fonts folder and open it
  3. Detect when the folder is actually open (*** VERY IMPORTANT STEP! *** as slower machines with low memory can wreak havoc on this step) yes again... a custom DLL ;-)
  4. Give the System around 2-4 seconds to register the font
  5. Close the Fonts Folder... again another custom DLL

All done!

To get the DLL's I use (which speeds up your development tremendously!!!) please email me and I'll be happy to give you a royalty free copy of them... I use a huge amount of royalty free custom DLL's which you are welcome to use but I may unfortunately not release the source code...


Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.