I need fonts with ANTIALIASED_QUALITY in NexGrid and NxHTMLLabel.
This code may help, it works to set ANTIALIASED_QUALITY for a TLabel.
CODE
unit AntiAliasedLabel;
interface
uses
Windows, Messages, SysUtils, Controls, StdCtrls, Graphics;
type
TLabel = class(StdCtrls.TLabel)
private
fFontChanged: boolean;
public
procedure Paint; override;
end;
implementation
procedure TLabel.Paint;
var
LF: TLogFont;
begin
if self.caption = 'Coucou' then
if not fFontChanged then
begin
Win32Check(GetObject(Font.Handle, SizeOf(TLogFont), @LF) <> 0);
LF.lfQuality := 4; //ANTIALIASED_QUALITY=4;
Font.Handle := CreateFontIndirect(LF);
fFontChanged := TRUE;
end;
inherited;
end;
end.
interface
uses
Windows, Messages, SysUtils, Controls, StdCtrls, Graphics;
type
TLabel = class(StdCtrls.TLabel)
private
fFontChanged: boolean;
public
procedure Paint; override;
end;
implementation
procedure TLabel.Paint;
var
LF: TLogFont;
begin
if self.caption = 'Coucou' then
if not fFontChanged then
begin
Win32Check(GetObject(Font.Handle, SizeOf(TLogFont), @LF) <> 0);
LF.lfQuality := 4; //ANTIALIASED_QUALITY=4;
Font.Handle := CreateFontIndirect(LF);
fFontChanged := TRUE;
end;
inherited;
end;
end.
Thanks for help.











