aggpas: fixed win32 compilation

git-svn-id: trunk@21995 -
This commit is contained in:
mattias 2009-10-03 15:42:27 +00:00
parent 1fe0e7fad4
commit 50874df45f
2 changed files with 16 additions and 8 deletions

View File

@ -5,8 +5,8 @@ unit Unit1;
interface interface
uses uses
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, Classes, SysUtils, LCLProc, FileUtil, LResources, Forms, Controls, Graphics,
FPimage, agg_fpimage, Agg_LCL; Dialogs, FPimage, agg_fpimage, Agg_LCL;
type type
@ -30,6 +30,8 @@ implementation
{ TForm1 } { TForm1 }
procedure TForm1.FormCreate(Sender: TObject); procedure TForm1.FormCreate(Sender: TObject);
var
FontFilename: String;
begin begin
Bitmap1:=TBitmap.Create; Bitmap1:=TBitmap.Create;
AggLCLCanvas:=TAggLCLCanvas.Create; AggLCLCanvas:=TAggLCLCanvas.Create;
@ -56,7 +58,9 @@ begin
Ellipse(40,65,120,130); Ellipse(40,65,120,130);
// solid blue text // solid blue text
Font.LoadFromFile('../../verdana.ttf'); FontFilename:=SetDirSeparators('../../verdana.ttf');
DebugLn(['TForm1.FormCreate ',FontFilename,' ',FileExists(FontFilename)]);
Font.LoadFromFile(FontFilename);
Font.Size:=18; Font.Size:=18;
Font.Color:=clRed; Font.Color:=clRed;
TextOut(10,30,'LCL and AggPas'); TextOut(10,30,'LCL and AggPas');

View File

@ -9,11 +9,12 @@
// //
unit agg_fpimage; unit agg_fpimage;
{$mode objfpc}{$H+} {$mode objfpc}{$H+}
interface interface
{$IFDEF LINUX} {$IFNDEF WINDOWS}
{$DEFINE AGG2D_USE_FREETYPE} {$DEFINE AGG2D_USE_FREETYPE}
{$ENDIF} {$ENDIF}
@ -60,7 +61,7 @@ uses
{$ENDIF } {$ENDIF }
Math, types , Math, types ,
{$IFDEF AGG_WINDOWS} {$IFDEF WINDOWS}
Windows , Windows ,
{$ENDIF} {$ENDIF}
@ -3377,13 +3378,15 @@ begin
end; end;
procedure TAggFPFont.SetAggHeight(const AValue: double); procedure TAggFPFont.SetAggHeight(const AValue: double);
{$IFDEF AGG2D_USE_FREETYPE}
var var
c: TAggFPCanvas; c: TAggFPCanvas;
{$ENDIF}
begin begin
if FAggHeight=AValue then exit; if FAggHeight=AValue then exit;
FAggHeight:=AValue; FAggHeight:=AValue;
c:=TAggFPCanvas(Canvas);
{$IFDEF AGG2D_USE_FREETYPE} {$IFDEF AGG2D_USE_FREETYPE}
c:=TAggFPCanvas(Canvas);
if FAggCache = AGG_VectorFontCache then if FAggCache = AGG_VectorFontCache then
c.m_fontEngine.height_(FAggHeight ) c.m_fontEngine.height_(FAggHeight )
else else
@ -3448,7 +3451,8 @@ procedure TAggFPFont.LoadFromFile(aFilename: String; const NewHeight: double;
const NewBold: boolean; const NewItalic: boolean; const NewBold: boolean; const NewItalic: boolean;
const NewCache: TAggFontCacheType; const NewAngle: double; const NewCache: TAggFontCacheType; const NewAngle: double;
const NewHinting: boolean); const NewHinting: boolean);
{$IFNDEF AGG2D_USE_FREETYPE } {$IFDEF AGG2D_USE_FREETYPE }
{$ELSE}
var var
b : int; b : int;
{$ENDIF} {$ENDIF}
@ -3489,7 +3493,7 @@ begin
b:=400; b:=400;
if FAggCache = AGG_VectorFontCache then if FAggCache = AGG_VectorFontCache then
c.m_fontEngine.create_font_(PChar(@AFleName[1 ] ) ,glyph_ren_outline , c.m_fontEngine.create_font_(PChar(@AFileName[1 ] ) ,glyph_ren_outline ,
FAggHeight ,0.0 ,b ,Italic ) FAggHeight ,0.0 ,b ,Italic )
else else
c.m_fontEngine.create_font_(PChar(@AFileName[1 ] ) ,glyph_ren_agg_gray8 , c.m_fontEngine.create_font_(PChar(@AFileName[1 ] ) ,glyph_ren_agg_gray8 ,