Hello,
I know that you are using Delphi to develop Font Creator, and I was wondering how you get around the limitations of the VCL which seems unable to handle fonts with styles as introduced in Windows 7.
Screen.Fonts
The issue seems to come from an incorrect use of the EnumFontFamiliesEx() WinAPI call.
-
The call to EnumFontFamilies should occur twice, once parameter-less to get a list of all the font families, and then for each family name found, using that family name as parameter, to then obtain all the styles of that family.
-
It would seem that the VCL just calls the enum once, getting the list of font families, but never goes the extra step of listing all the styles of each family (this is why the tweaking of the AvenirRoman, discussed earlier, where we created one family per font, works with the VCL, as all it looks at are the family names obtained from the first iteration of EnumFontFamilies).
TFontDialog
There is also a problem in the implementation of the TFontDialog in the VCL, whereby, after the Windows ChooseFont() dialog returns, the VCL tries to guess the style of the returned font, in the function TFontDialog.UpdateFromLogFont(), using the lfWeight parameter of the TLogFont returned by ChooseFont(), instead of getting the exact name of the style from the lpszStyle field of the TChooseFont record returned from the Windows ChooseFont() dialog.
The result is that using the TFontDialog to select one of the basic Windows fonts (such as Tahoma), fails, while my tweaked version of TFontDialog returns the full font name and style (see attached TFontDialog.png).
I am wondering how you got around these issues ?
Very best regards,
Olivier