Using uninstalled fonts in Delphi programs
Posted on 1998-10-09
I want to use _uninstalled_ fonts in my program.
Now, I am pretty happy using Screen.Fonts to use all the installed fonts, but my problem comes in using uninstalled fonts.
I wrote a little loop to recursively traverse through a directory, and for each file I try AddFontResource () - this succeeds for each file that is a valid font file, and so I can identify the fonts. However, I'm not sure what to do next. AddFontResource () just takes a filename, but then to use the font I must presumably know the name of the font (i.e. the difference between, say, 'ozw88.ttf' and 'Ozzie Bold').
How can I get the name of the font? How can I use the font in my program?