Remember that the name of the font is defined within the contents of the font file, so there's no reason there should be any relation with the name of the font file itself.
In Windows XP the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts
lists all the permanent installed system fonts. You can enumerate this list of font files, opening each one in turn and if it is a ttf you can get the checkSumAdjustment
from its head
table. Build a list of items, each item containing a pair of values - the font file name and the checksum value.
Then when you later realize a font, call GetFontData
on it and read the head
table and find the checkSumAdjustment
for that font. Then look it up in the list you made earlier.