However, if this font is not a trueType font, he should not even be able to select a font in a size which is not available. No, I have not tried DISPLAY FONT to see what that does.
Using CF_FORCEFONTEXIST will cause an error indication if the user attemps to select a font or style that doesn't exist. But there is no corresponding flag to prevent the user from using a font size that isn't listed (TTF or not)

The closest flag seems to be CF_LIMITSIZE - but that requires a Min and a Max value be set when the Choosefont call is made - so won't fit all fonts..
If it is important to control / filter what the user selects, one method could be to use Choosefont() with flag CF_ENABLEHOOK. Then, in the HookProc, examine the listed font sizes compared to the user selection when [ OK ] is clicked - 'eating' the button press (or forcing a size) if there is a mismatch or 'out of range' issue..
Example of using a hook procedure here.. http://www.powerbasic.com/support/pb...ead.php?t=6498
Leave a comment: