Delphi32.com - Home!
| Home/News | Downloads | Forums | D32 Magazine | Resources | Info and Facts |  
 
 Error 'There are no fonts installed'.


When I execute the FontDialog with the Device property set to fdBoth or fdPrinter, I get an error "There are no fonts installed".   

    This setting should show fonts that are compatible with either the Printer or both the Printer and the Screen. The following is an example of calling the Windows ChooseFont dialog directly to provide a list of fonts that are compatible with both the screen and the printer:

    Example:

    uses Printers, CommDlg;

    procedure TForm .Button Click(Sender: TObject); var cf : TChooseFont; lf : TLogFont; tf : TFont; begin if PrintDialog .Execute then begin GetObject(Form .Canvas.Font.Handle, sizeof(lf), @lf); FillChar(cf, sizeof(cf), #0); cf.lStructSize := sizeof(cf); cf.hWndOwner := Form .Handle; cf.hdc := Printer.Handle; cf.lpLogFont := @lf; cf.iPointSize := Form .Canvas.Font.Size * 0; cf.Flags := CF_BOTH or CF_INITTOLOGFONTSTRUCT or CF_EFFECTS or CF_SCALABLEONLY or CF_WYSIWYG; cf.rgbColors := Form .Canvas.Font.Color; if ChooseFont(cf) <> false then begin tf := TFont.Create; tf.Handle := CreateFontIndirect(lf); tf.COlor := cf.RgbColors; Form .Canvas.Font.Assign(tf); tf.Free; Form .Canvas.TextOut( 0, 0, 'Test'); end; end; end;

    7/ 6/98 4:3 :28 PM

     



  << Previous Faq     Complete List     Next Faq >>  



 
 Hits/month  2,500,000+ 
 Downloads
 (Since May 2000)
 7,393,709 
 Total Files  6,023 
 Forum msgs  7,670 
 Articles/FAQs  70+/900+ 
Kylix
Tips n Tricks
FAQs
Knowledge Base
Bug Listings
Articles
Books
Newsgroups
Links
Submissions
Testimonials
Advertising
Contact Us
About Us
Search Amazon:
Top Selling Software at Amazon

| Home/News | Downloads | Forums | Resources | Info and Facts | Testimonials |
  Site Search:
 


Comments/Problems: Webmaster@delphi32.com
Copyright © 1998-2006, Delphi32.com. All rights reserved.
Terms of Use