944,149 Members | Top Members by Rank

Ad:
0

Disable font smoothing (Anti-aliased font)

by on Mar 18th, 2006
This code disables font smoothing for a TLabel component. Can easily be converted for other VCL controls.

Loren Soth
Pascal and Delphi Code Snippet (Toggle Plain Text)
  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:
Previous Thread in Pascal and Delphi Forum Timeline: Delphi vs Pascal
Next Thread in Pascal and Delphi Forum Timeline: Get MAC (Ethernet) Address of NIC





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC