Font.Quality in Delphi XE

by Radek Červinka 21. April 2011 21:44

Very interesting property in Delphi XE - Font.Quality.

For me big surprise - in Delphi XE there is new property for font antialiasing. Very interesting because I don't know about different clear type implementations in windows - but wikipedia explained this topic.

  TFontQuality = (fqDefault, fqDraft, fqProof, fqNonAntialiased, fqAntialiased,
    fqClearType, fqClearTypeNatural);

Program on listing produce similar output to screenshot bellow. Compiled application with sources.

    1const
    2  csLoremIpsum =
    3  'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor '+
    4  'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud '+
    5  'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure '+
    6  'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. '+
    7  'Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt '+
    8  'mollit anim id est laborum.';
    9
   10
   11procedure TForm1.FormCreate(Sender: TObject);
   12var
   13  mem: TMemo;
   14  fq: TFontQuality;
   15begin
   16  for fq := fqDefault to fqClearTypeNatural do
   17  begin
   18    mem := TMemo.Create(Self);
   19    mem.Parent := Self;
   20    mem.Top := Ord(fq)* 70;
   21    mem.Height := 70;
   22    mem.Width := 550;
   23    mem.Text := csLoremIpsum;
   24    mem.Font.Quality := fq;
   25    mem.Font.Size := 12;
   26    mem.Font.Name := 'Arial';
   27  end;
   28end;

Clear type Delphi

Tags: , ,

Delphi news

Comments are closed