Disable font smoothing (Anti-aliased font)

Lord Soth Lord Soth is offline Offline Mar 18th, 2006, 6:40 am |
0
This code disables font smoothing for a TLabel component. Can easily be converted for other VCL controls.

Loren Soth
Quick reply to this message  
Pascal and Delphi Syntax
  1. procedure TForm1.DisableFontSmoothing(LabelName: TLabel);
  2. var
  3. tagLOGFONT: TLogFont;
  4. begin
  5. GetObject(LabelName.Font.Handle, SizeOf(TLogFont), @tagLOGFONT);
  6. tagLOGFONT.lfQuality := NONANTIALIASED_QUALITY;
  7. LabelName.Font.Handle := CreateFontIndirect(tagLOGFONT);
  8. end;
  9.  
  10. //Example Use for Label2
  11. procedure TForm1.Button1Click(Sender: TObject);
  12. begin
  13. DisableFontSmoothing(Label2);
  14. end;

Message:


Similar Threads
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC