[Lazarus] Changing font colour

Timothy Groves the.tail.kinker at gmail.com
Sat Aug 3 12:16:26 CEST 2013


So I've got a program that saves a graphic image, and I copied chunks of 
it from http://wiki.freepascal.org/fcl-image because I'm new at this.  
However, whenever I draw text, it comes out in black, and I wish to be 
able to change the colour.  I've hunted online and through the source 
code, and nothing seems to work.  Can someone tell me what I'm doing wrong?

   Image := TFPMemoryImage.Create (1025,513);
   Image.UsePalette := FALSE;
   Canvas := TFPImageCanvas.Create (Image);
   FontMgr.SearchPath:='/usr/share/fonts/truetype/ttf-dejavu/';
   AFont := TFreeTypeFont.Create;

     Canvas.brush.FPCOlor := colWhite;
     Canvas.pen.FPColor := colWhite;
     Canvas.Font := aFont;
     Canvas.Font.Name := 'DejaVuSerif';
     Canvas.Font.Size := 6 + ZoomFactor;

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20130803/49275116/attachment-0002.html>


More information about the Lazarus mailing list