|
From: <CW...@us...> - 2012-03-29 23:32:24
|
Revision: 1532
http://graphics32.svn.sourceforge.net/graphics32/?rev=1532&view=rev
Author: CWBudde
Date: 2012-03-29 23:32:17 +0000 (Thu, 29 Mar 2012)
Log Message:
-----------
* fixed font rendering issue with FPC and Non-Windows widget sets
Modified Paths:
--------------
trunk/Source/GR32.pas
Modified: trunk/Source/GR32.pas
===================================================================
--- trunk/Source/GR32.pas 2012-03-29 23:31:41 UTC (rev 1531)
+++ trunk/Source/GR32.pas 2012-03-29 23:32:17 UTC (rev 1532)
@@ -5640,6 +5640,7 @@
// -------------------------------------------------------------------
+{$IFNDEF FPC}
procedure SetFontAntialiasing(const Font: TFont; Quality: Cardinal);
var
LogFont: TLogFont;
@@ -5692,6 +5693,7 @@
end;
Font.Handle := CreateFontIndirect(LogFont);
end;
+{$ENDIF}
procedure TextBlueToAlpha(const B: TCustomBitmap32; const Color: TColor32);
(*
@@ -5776,10 +5778,17 @@
AALevel := Constrain(AALevel, -1, 4);
PaddedText := Text + ' ';
+ {$IFDEF FPC}
if AALevel > -1 then
+ Font.Quality := fqNonAntialiased
+ else
+ Font.Quality := fqAntialiased;
+ {$ELSE}
+ if AALevel > -1 then
SetFontAntialiasing(Font, NONANTIALIASED_QUALITY)
else
SetFontAntialiasing(Font, ANTIALIASED_QUALITY);
+ {$ENDIF}
{ TODO : Optimize Clipping here }
B := TBitmap32.Create;
@@ -5827,7 +5836,11 @@
Free;
end;
+ {$IFDEF FPC}
+ Font.Quality := fqDefault;
+ {$ELSE}
SetFontAntialiasing(Font, DEFAULT_QUALITY);
+ {$ENDIF}
end;
procedure TBitmap32.RenderTextW(X, Y: Integer; const Text: Widestring; AALevel: Integer; Color: TColor32);
@@ -5845,10 +5858,17 @@
AALevel := Constrain(AALevel, -1, 4);
PaddedText := Text + ' ';
+ {$IFDEF FPC}
if AALevel > -1 then
+ Font.Quality := fqNonAntialiased
+ else
+ Font.Quality := fqAntialiased;
+ {$ELSE}
+ if AALevel > -1 then
SetFontAntialiasing(Font, NONANTIALIASED_QUALITY)
else
SetFontAntialiasing(Font, ANTIALIASED_QUALITY);
+ {$ENDIF}
{ TODO : Optimize Clipping here }
B := TBitmap32.Create;
@@ -5903,7 +5923,12 @@
finally
B.Free;
end;
+
+ {$IFDEF FPC}
+ Font.Quality := fqDefault;
+ {$ELSE}
SetFontAntialiasing(Font, DEFAULT_QUALITY);
+ {$ENDIF}
end;
// -------------------------------------------------------------------
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|