Since we expect Creative Docs .NET to evolve quickly in the coming weeks, we decided to add an automatic check for updates, done once a day, when you start the application. This can be turned off in the global settings if you don't want the software to connect to the net by itself.
Implementing such a check was really simple in .NET, using System.Net.WebRequest to connect to the web site using a simple URL, such as http://www.creativedocs.net/update/check.php?software=CreativeDocs&version=18.104.22.168. The web page just returns a single line of text, consisting of the latest version number available on-line and the URL from where to download it.
Calling the code through a delegate using BeginInvoke allows us very easily to do the check asynchronously during the (long) start-up phase of the application.
The full source for the VersionChecker class can be found here.
Creative Docs .NET failed to start on some machines, crashing while it was building its font list. Thanks to the help of one of the early testers, I've been able to spot the source of these troubles. It all comes down to the Win32 function GetFontData handling of TTC fonts (TrueType Collections). GetFontData can be used to load specific OpenType font tables by specifying a table name in its dwTable argument, but it can also be used to load the full font file by specifying zero instead. This is what I use to get access to all font tables and parse the OpenType information myself.
However, when GetFontData is applied on a TTC font, it returns only the first TrueType font in the collection, dropping the TTC Header (which consists of the "ttcf" tag, a version, number of fonts in TTC and an offset table specifying where each font starts in the TTC file). The result is a crippled TrueType font, where all internal table offsets are wrong.
Searching for the topic on the web did not provide any resolution to the problem, unless you consider smart-guessing the offsets to be a clean and effective solution.
So I am quite happy to have found a working solution: just call GetFontData by asking it to return the table called "ttcf" (set dwTable to 0x66637474) and you will get the whole TTC font. Finding the start of the first TrueType font is then just a matter of indexing into the OffsetTable...