Browse Source

* PChar -> PAnsiChar

Michaël Van Canneyt 2 years ago
parent
commit
f60987bd44

+ 1 - 1
packages/fcl-image/examples/imgconv.pp

@@ -29,7 +29,7 @@ var img : TFPMemoryImage;
     ReadFile, WriteFile, WriteOptions : string;
 
 procedure Init;
-var t : char;
+var t : AnsiChar;
 begin
   if paramcount = 4 then
     begin

+ 8 - 8
packages/fcl-image/src/fpbarcode.pp

@@ -85,7 +85,7 @@ Function IntToBarcodeParams(I : Int64; aEncoding : TBarcodeEncoding; aWidth : In
 Function BarTypeToBarParams(aType : TBarType) : TBarParams;
 Function BarTypeArrayToBarParamsArray(anArray : TBarTypeArray) : TBarParamsArray;
 Function CalcBarWidths(aEncoding : TBarcodeEncoding; aUnit : Integer; AWeight : Double) : TBarWidthArray;
-Function CalcStringWidthInBarCodeEncoding(S : String;aEncoding : TBarcodeEncoding; aUnit : Integer; AWeight : Double) : Cardinal;
+Function CalcStringWidthInBarCodeEncoding(S : AnsiString;aEncoding : TBarcodeEncoding; aUnit : Integer; AWeight : Double) : Cardinal;
 
 // Check with barcode unit
 
@@ -543,7 +543,7 @@ Const
 
 var
   L,i, P, Idx, CC, CK, WC, WK  : integer;
-  C : Char;
+  C : AnsiChar;
 
 begin
   L:=Length(S);
@@ -599,7 +599,7 @@ begin
 end;
 
 
-function Encode93Extended(S: string) : TBarTypeArray;
+function Encode93Extended(S: AnsiString) : TBarTypeArray;
 
 const
   CharEncoding: array[0..127] of string[2] = (
@@ -1010,7 +1010,7 @@ begin
     Result:=-1;
 end;
 
-Function AllowEncode128A(S : String) : Boolean;
+Function AllowEncode128A(S : AnsiString) : Boolean;
 
 Var
   I,L : integer;
@@ -1061,7 +1061,7 @@ begin
     Result:=-1;
 end;
 
-Function AllowEncode128B(S : String) : Boolean;
+Function AllowEncode128B(S : AnsiString) : Boolean;
 
 Var
   I,L : integer;
@@ -1237,7 +1237,7 @@ Const
 
 var
   P,I,J : integer;
-  C : Char;
+  C : AnsiChar;
 begin
   // Length of AnsiString * 2 + StartCode+StopCode
   SetLength(Result,Length(S)*10+6+6);
@@ -1262,7 +1262,7 @@ Const
 
 var
   P,I,J : integer;
-  C : Char;
+  C : AnsiChar;
   BT : TBarType;
 begin
   // Length of AnsiString  + StartCode+StopCode
@@ -1423,7 +1423,7 @@ begin
   Result[bw200]:=Result[bwWeighted]*2;
 end;
 
-function CalcStringWidthInBarCodeEncoding(S : String;aEncoding: TBarcodeEncoding; aUnit: Integer; AWeight: Double): Cardinal;
+function CalcStringWidthInBarCodeEncoding(S : AnsiString;aEncoding: TBarcodeEncoding; aUnit: Integer; AWeight: Double): Cardinal;
 
 Var
   BP : TBarParams;

+ 11 - 11
packages/fcl-image/src/fpcanvas.inc

@@ -312,7 +312,7 @@ begin
   Result:=FLocks>0;
 end;
 
-procedure TFPCustomCanvas.TextOut (x,y:integer;text:string);
+procedure TFPCustomCanvas.TextOut (x,y:integer;text:ansistring);
 begin
   if Font is TFPCustomDrawFont then
     TFPCustomDrawFont(Font).DrawText(x,y, text)
@@ -320,7 +320,7 @@ begin
     DoTextOut (x,y, text);
 end;
 
-procedure TFPCustomCanvas.GetTextSize (text:string; var w,h:integer);
+procedure TFPCustomCanvas.GetTextSize (text:ansistring; var w,h:integer);
 begin
   if Font is TFPCustomDrawFont then
     TFPCustomDrawFont(Font).GetTextSize (text, w, h)
@@ -328,23 +328,23 @@ begin
     DoGetTextSize (Text, w, h);
 end;
 
-function TFPCustomCanvas.GetTextHeight (text:string) : integer;
+function TFPCustomCanvas.GetTextHeight (text:ansistring) : integer;
 begin
   Result := TextHeight(Text);
 end;
 
-function TFPCustomCanvas.GetTextWidth (text:string) : integer;
+function TFPCustomCanvas.GetTextWidth (text:ansistring) : integer;
 begin
   Result := TextWidth(Text);
 end;
 
-function TFPCustomCanvas.TextExtent(const Text: string): TSize;
+function TFPCustomCanvas.TextExtent(const Text: ansistring): TSize;
 begin
   Result:=Default(TSize);
   GetTextSize(Text, Result.cx, Result.cy);
 end;
 
-function TFPCustomCanvas.TextHeight(const Text: string): Integer;
+function TFPCustomCanvas.TextHeight(const Text: ansistring): Integer;
 begin
   if Font is TFPCustomDrawFont then
     result := TFPCustomDrawFont(Font).GetTextHeight (text)
@@ -352,7 +352,7 @@ begin
     result := DoGetTextHeight (Text);
 end;
 
-function TFPCustomCanvas.TextWidth(const Text: string): Integer;
+function TFPCustomCanvas.TextWidth(const Text: ansistring): Integer;
 begin
   if Font is TFPCustomDrawFont then
     result := TFPCustomDrawFont(Font).GetTextWidth (text)
@@ -411,25 +411,25 @@ end;
 procedure TFPCustomCanvas.DoTextOut (x,y:integer;text:unicodestring); 
 
 begin
-  DoTextOut(x,y,string(text));
+  DoTextOut(x,y,UTF8Encode(text));
 end;
 
 procedure TFPCustomCanvas.DoGetTextSize (text:unicodestring; var w,h:integer); 
 
 begin
-  DoGetTextSize(String(Text),w,h);
+  DoGetTextSize(UTF8Encode(Text),w,h);
 end;
 
 function  TFPCustomCanvas.DoGetTextHeight (text:unicodestring) : integer; 
 
 begin
-  Result:=DoGetTextHeight(String(text));
+  Result:=DoGetTextHeight(UTF8Encode(text));
 end;
 
 function  TFPCustomCanvas.DoGetTextWidth (text:unicodestring) : integer; 
 
 begin
-  Result:=DoGetTextWidth(String(text));
+  Result:=DoGetTextWidth(UTF8Encode(text));
 end;
 
 procedure TFPCustomCanvas.Arc(ALeft, ATop, ARight, ABottom, Angle16Deg,

+ 22 - 22
packages/fcl-image/src/fpcanvas.pp

@@ -94,9 +94,9 @@ type
   public
     function CopyFont : TFPCustomFont;
     // Creates a copy of the font with all properties the same, but not allocated
-    procedure GetTextSize (text:string; var w,h:integer);
-    function GetTextHeight (text:string) : integer;
-    function GetTextWidth (text:string) : integer;
+    procedure GetTextSize (text:ansistring; var w,h:integer);
+    function GetTextHeight (text:ansistring) : integer;
+    function GetTextWidth (text:ansistring) : integer;
     property Name : string read FName write SetName;
     property Size : integer read FSize write SetSize;
     property Bold : boolean index 5 read GetFlags write SetFlags;
@@ -287,10 +287,10 @@ type
     procedure SetClipRegion(const AValue: TFPCustomRegion);
     procedure DoLockCanvas; virtual;
     procedure DoUnlockCanvas; virtual;
-    procedure DoTextOut (x,y:integer;text:string); virtual; abstract;
-    procedure DoGetTextSize (text:string; var w,h:integer); virtual; abstract;
-    function  DoGetTextHeight (text:string) : integer; virtual; abstract;
-    function  DoGetTextWidth (text:string) : integer; virtual; abstract;
+    procedure DoTextOut (x,y:integer;text:ansistring); virtual; abstract;
+    procedure DoGetTextSize (text:ansistring; var w,h:integer); virtual; abstract;
+    function  DoGetTextHeight (text:ansistring) : integer; virtual; abstract;
+    function  DoGetTextWidth (text:ansistring) : integer; virtual; abstract;
     procedure DoTextOut (x,y:integer;text:unicodestring); virtual; 
     procedure DoGetTextSize (text:unicodestring; var w,h:integer); virtual; 
     function  DoGetTextHeight (text:unicodestring) : integer; virtual; 
@@ -327,13 +327,13 @@ type
     function CreatePen : TFPCustomPen;
     function CreateBrush : TFPCustomBrush;
     // using font
-    procedure TextOut (x,y:integer;text:string); virtual;
-    procedure GetTextSize (text:string; var w,h:integer);
-    function GetTextHeight (text:string) : integer;
-    function GetTextWidth (text:string) : integer;
-    function TextExtent(const Text: string): TSize; virtual;
-    function TextHeight(const Text: string): Integer; virtual;
-    function TextWidth(const Text: string): Integer; virtual;
+    procedure TextOut (x,y:integer;text:Ansistring); virtual;
+    procedure GetTextSize (text:Ansistring; var w,h:integer);
+    function GetTextHeight (text:Ansistring) : integer;
+    function GetTextWidth (text:Ansistring) : integer;
+    function TextExtent(const Text: Ansistring): TSize; virtual;
+    function TextHeight(const Text: Ansistring): Integer; virtual;
+    function TextWidth(const Text: Ansistring): Integer; virtual;
     procedure TextOut (x,y:integer;text:unicodestring); virtual;
     procedure GetTextSize (text:unicodestring; var w,h:integer);
     function GetTextHeight (text:unicodestring) : integer;
@@ -397,19 +397,19 @@ type
 
   TFPCustomDrawFont = class (TFPCustomFont)
   private
-    procedure DrawText (x,y:integer; text:string);
-    procedure GetTextSize (text:string; var w,h:integer);
-    function GetTextHeight (text:string) : integer;
-    function GetTextWidth (text:string) : integer;
+    procedure DrawText (x,y:integer; text:Ansistring);
+    procedure GetTextSize (text:ansistring; var w,h:integer);
+    function GetTextHeight (text:ansistring) : integer;
+    function GetTextWidth (text:ansistring) : integer;
     procedure DrawText (x,y:integer; text:unicodestring);
     procedure GetTextSize (text: unicodestring; var w,h:integer);
     function GetTextHeight (text: unicodestring) : integer;
     function GetTextWidth (text: unicodestring) : integer;
   protected
-    procedure DoDrawText (x,y:integer; text:string); virtual; abstract;
-    procedure DoGetTextSize (text:string; var w,h:integer); virtual; abstract;
-    function DoGetTextHeight (text:string) : integer; virtual; abstract;
-    function DoGetTextWidth (text:string) : integer; virtual; abstract;
+    procedure DoDrawText (x,y:integer; text:ansistring); virtual; abstract;
+    procedure DoGetTextSize (text:ansistring; var w,h:integer); virtual; abstract;
+    function DoGetTextHeight (text:ansistring) : integer; virtual; abstract;
+    function DoGetTextWidth (text:ansistring) : integer; virtual; abstract;
     procedure DoDrawText (x,y:integer; text:unicodestring); virtual;
     procedure DoGetTextSize (text: unicodestring; var w,h:integer); virtual; 
     function DoGetTextHeight (text: unicodestring) : integer; virtual; 

+ 4 - 4
packages/fcl-image/src/fpcdrawh.inc

@@ -58,22 +58,22 @@ end;
 
 { TFPCustomDrawFont }
 
-procedure TFPCustomDrawFont.DrawText (x,y:integer; text:string);
+procedure TFPCustomDrawFont.DrawText (x,y:integer; text:ansistring);
 begin
   DoDrawText (x,y, text);
 end;
 
-procedure TFPCustomDrawFont.GetTextSize (text:string; var w,h:integer);
+procedure TFPCustomDrawFont.GetTextSize (text:ansistring; var w,h:integer);
 begin
   DoGetTextSize (text, w,h);
 end;
 
-function TFPCustomDrawFont.GetTextHeight (text:string) : integer;
+function TFPCustomDrawFont.GetTextHeight (text:ansistring) : integer;
 begin
   result := DoGetTextHeight (Text);
 end;
 
-function TFPCustomDrawFont.GetTextWidth (text:string) : integer;
+function TFPCustomDrawFont.GetTextWidth (text:ansistring) : integer;
 begin
   result := DoGetTextWidth (Text);
 end;

+ 3 - 3
packages/fcl-image/src/fpfont.inc

@@ -52,7 +52,7 @@ begin
   result.DoCopyProps (self);
 end;
 
-procedure TFPCustomFont.GetTextSize (text:string; var w,h:integer);
+procedure TFPCustomFont.GetTextSize (text:AnsiString; var w,h:integer);
 begin
   if inheritsFrom (TFPCustomDrawFont) then
     TFPCustomDrawFont(self).DoGetTextSize (text,w,h)
@@ -60,7 +60,7 @@ begin
     FCanvas.DoGetTextSize (text, w,h);
 end;
 
-function TFPCustomFont.GetTextHeight (text:string) : integer;
+function TFPCustomFont.GetTextHeight (text:AnsiString) : integer;
 begin
   if inheritsFrom (TFPCustomDrawFont) then
     result := TFPCustomDrawFont(self).DoGetTextHeight (text)
@@ -71,7 +71,7 @@ begin
      result :=16; // *some* default better than none.
 end;
 
-function TFPCustomFont.GetTextWidth (text:string) : integer;
+function TFPCustomFont.GetTextWidth (text:AnsiString) : integer;
 begin
   if inheritsFrom (TFPCustomDrawFont) then
     result := TFPCustomDrawFont(self).DoGetTextWidth (text)

+ 1 - 1
packages/fcl-image/src/fpimage.pp

@@ -657,7 +657,7 @@ end;
 
 {$ifdef debug}
 function MakeHex (n:TColordata;nr:byte): string;
-const hexnums : array[0..15] of char =
+const hexnums : array[0..15] of AnsiChar =
               ('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');
 var r : integer;
 begin

+ 10 - 10
packages/fcl-image/src/fppixlcanv.pp

@@ -41,10 +41,10 @@ type
     function DoCreateDefaultPen : TFPCustomPen; override;
     function DoCreateDefaultBrush : TFPCustomBrush; override;
     procedure DoDraw(x, y: integer; const image: TFPCustomImage); override;
-    procedure DoTextOut (x,y:integer;text:string); override;
-    procedure DoGetTextSize (text:string; var w,h:integer); override;
-    function  DoGetTextHeight (text:string) : integer; override;
-    function  DoGetTextWidth (text:string) : integer; override;
+    procedure DoTextOut (x,y:integer;text:AnsiString); override;
+    procedure DoGetTextSize (text:AnsiString; var w,h:integer); override;
+    function  DoGetTextHeight (text:AnsiString) : integer; override;
+    function  DoGetTextWidth (text:AnsiString) : integer; override;
     procedure DoRectangle (const Bounds:TRect); override;
     procedure DoRectangleFill (const Bounds:TRect); override;
     procedure DoEllipseFill (const Bounds:TRect); override;
@@ -64,8 +64,8 @@ type
 const
   PenPatterns : array[psDash..psDashDotDot] of TPenPattern =
     ($EEEEEEEE, $AAAAAAAA, $E4E4E4E4, $EAEAEAEA);
-  sErrNoImage:string = 'No brush image specified';
-  sErrNotAvailable:string = 'Not available';
+  sErrNoImage:AnsiString = 'No brush image specified';
+  sErrNotAvailable:AnsiString = 'Not available';
 
 implementation
 
@@ -139,23 +139,23 @@ begin
       Colors[x+w,y+h]:=Image.Colors[W,H];
 end;
 
-procedure TFPPixelCanvas.DoTextOut (x,y:integer;text:string);
+procedure TFPPixelCanvas.DoTextOut (x,y:integer;text:AnsiString);
 begin
   NotImplemented;
 end;
 
-procedure TFPPixelCanvas.DoGetTextSize (text:string; var w,h:integer);
+procedure TFPPixelCanvas.DoGetTextSize (text:AnsiString; var w,h:integer);
 begin
   NotImplemented;
 end;
 
-function  TFPPixelCanvas.DoGetTextHeight (text:string) : integer;
+function  TFPPixelCanvas.DoGetTextHeight (text:AnsiString) : integer;
 begin
   result := -1;
   NotImplemented;
 end;
 
-function  TFPPixelCanvas.DoGetTextWidth (text:string) : integer;
+function  TFPPixelCanvas.DoGetTextWidth (text:AnsiString) : integer;
 begin
   result := -1;
   NotImplemented;

+ 2 - 2
packages/fcl-image/src/fpreadgif.pas

@@ -30,8 +30,8 @@ type
   end;
 
   TGIFHeader = packed record
-    Signature:array[0..2] of Char;    //* Header Signature (always "GIF") */
-    Version:array[0..2] of Char;      //* GIF format version("87a" or "89a") */
+    Signature:array[0..2] of AnsiChar;    //* Header Signature (always "GIF") */
+    Version:array[0..2] of AnsiChar;      //* GIF format version("87a" or "89a") */
     // Logical Screen Descriptor
     ScreenWidth:word;                 //* Width of Display Screen in Pixels */
     ScreenHeight:word;                //* Height of Display Screen in Pixels */

+ 5 - 4
packages/fcl-image/src/fpreadjpeg.pas

@@ -23,8 +23,9 @@
 }
 unit FPReadJPEG;
 
-{$mode objfpc}{$H+}
-
+{$mode objfpc}
+{$H+}
+{$openstrings on}
 interface
 
 uses
@@ -102,7 +103,7 @@ procedure ReadCompleteStreamToStream(SrcStream, DestStream: TStream;
 var
   NewLength: Integer;
   ReadLen: Integer;
-  Buffer: string;
+  Buffer: AnsiString;
 begin
   if (SrcStream is TMemoryStream) or (SrcStream is TFileStream)
   or (SrcStream is TStringStream)
@@ -142,7 +143,7 @@ begin
   if CurInfo=nil then exit;
 end;
 
-procedure FormatMessage(CurInfo: j_common_ptr; var buffer: string);
+procedure FormatMessage(CurInfo: j_common_ptr; var buffer: shortstring);
 begin
   if CurInfo=nil then exit;
   {$ifdef FPC_Debug_Image}

+ 7 - 7
packages/fcl-image/src/fpreadpnm.pp

@@ -42,9 +42,9 @@ type
       FHeight     : Integer;
       FBufPos : Integer;
       FBufLen : Integer;
-      FBuffer : Array of char;
-      function DropWhiteSpaces(Stream: TStream): Char;
-      function ReadChar(Stream: TStream): Char;
+      FBuffer : Array of AnsiChar;
+      function DropWhiteSpaces(Stream: TStream): AnsiChar;
+      function ReadChar(Stream: TStream): AnsiChar;
       function ReadInteger(Stream: TStream): Integer;
       procedure ReadScanlineBuffer(Stream: TStream;p:Pbyte;Len:Integer);
     protected
@@ -70,7 +70,7 @@ const
 
 function TFPReaderPNM.InternalCheck(Stream:TStream):boolean;
 var
-  hdr: array[0..2] of char;
+  hdr: array[0..2] of AnsiChar;
   oldPos: Int64;
   i,n: Integer;
 begin
@@ -93,7 +93,7 @@ begin
   end;
 end;
 
-function TFPReaderPNM.DropWhiteSpaces(Stream : TStream) :Char;
+function TFPReaderPNM.DropWhiteSpaces(Stream : TStream) :AnsiChar;
 
 begin
   with Stream do
@@ -145,7 +145,7 @@ begin
     Stream.ReadBuffer(p^,len);
 end;
 
-function TFPReaderPNM.ReadChar(Stream: TStream): Char;
+Function TFPReaderPNM.ReadChar(Stream : TStream) : AnsiChar;
 
 begin
   If (FBufPos>=FBufLen) then
@@ -164,7 +164,7 @@ end;
 procedure TFPReaderPNM.ReadHeader(Stream : TStream);
 
 Var
-  C : Char;
+  C : AnsiChar;
 
 begin
   C:=ReadChar(Stream);

+ 1 - 1
packages/fcl-image/src/fpreadtiff.pas

@@ -1515,7 +1515,7 @@ begin
   end;
 end;
 
-function TFPReaderTiff.ReadEntryString: string;
+function TFPReaderTiff.ReadEntryString: AnsiString;
 var
   EntryType: Word;
   EntryCount: LongWord;

+ 17 - 17
packages/fcl-image/src/fpreadxpm.pp

@@ -25,9 +25,9 @@ type
       width, height, ncols, cpp, xhot, yhot : integer;
       xpmext : boolean;
       palette : TStringList;
-      function HexToColor(s : string) : TFPColor;
-      function NameToColor(s : string) : TFPColor;
-      function DiminishWhiteSpace (s : string) : string;
+      function HexToColor(s : AnsiString) : TFPColor;
+      function NameToColor(s : AnsiString) : TFPColor;
+      function DiminishWhiteSpace (s : AnsiString) : AnsiString;
     protected
       procedure InternalRead  (Str:TStream; Img:TFPCustomImage); override;
       function  InternalCheck (Str:TStream) : boolean; override;
@@ -53,9 +53,9 @@ begin
   inherited destroy;
 end;
 
-function TFPReaderXPM.HexToColor(s : string) : TFPColor;
+function TFPReaderXPM.HexToColor(s : AnsiString) : TFPColor;
 var l : integer;
-  function CharConv (c : char) : longword;
+  function CharConv (c : AnsiChar) : longword;
   begin
     if (c >= 'A') and (c <= 'F') then
       result := ord (c) - ord('A') + 10
@@ -64,7 +64,7 @@ var l : integer;
     else
       raise exception.CreateFmt ('Wrong character (%s) in hexadecimal number', [c]);
   end;
-  function convert (n : string) : word;
+  function convert (n : AnsiString) : word;
   var t,r: integer;
   begin
     result := 0;
@@ -89,7 +89,7 @@ begin
   result.alpha := AlphaOpaque;
 end;
 
-function TFPReaderXPM.NameToColor(s : string) : TFPColor;
+function TFPReaderXPM.NameToColor(s : AnsiString) : TFPColor;
 begin
   s := lowercase (s);
   if s = 'transparent' then
@@ -152,7 +152,7 @@ begin
     result := colTransparent;
 end;
 
-function TFPReaderXPM.DiminishWhiteSpace (s : string) : string;
+function TFPReaderXPM.DiminishWhiteSpace (s : AnsiString) : AnsiString;
 var r : integer;
     Doit : boolean;
 begin
@@ -175,7 +175,7 @@ end;
 procedure TFPReaderXPM.InternalRead  (Str:TStream; Img:TFPCustomImage);
 var l : TStringList;
 
-  procedure TakeInteger (var s : string; var i : integer);
+  procedure TakeInteger (var s : AnsiString; var i : integer);
   var r : integer;
   begin
     r := pos (' ', s);
@@ -192,7 +192,7 @@ var l : TStringList;
   end;
 
   procedure ParseFirstLine;
-  var s : string;
+  var s : AnsiString;
   begin
     s := l[0];
     // diminish all whitespace to 1 blank
@@ -211,15 +211,15 @@ var l : TStringList;
       end;
   end;
 
-  procedure AddPalette (const code:string;const Acolor:TFPColor);
+  procedure AddPalette (const code:AnsiString;const Acolor:TFPColor);
   var r : integer;
   begin
     r := Palette.Add(code);
     img.palette.Color[r] := Acolor;
   end;
 
-  procedure AddToPalette(s : string);
-  var code : string;
+  procedure AddToPalette(s : AnsiString);
+  var code : AnsiString;
       c : TFPColor;
        p : integer;
   begin
@@ -260,9 +260,9 @@ var l : TStringList;
       AddToPalette (l[r]);
   end;
 
-  procedure ReadLine (const s : string; imgindex : integer);
+  procedure ReadLine (const s : AnsiString; imgindex : integer);
   var color, r, p : integer;
-      code : string;
+      code : AnsiString;
   begin
     p := 1;
     for r := 1 to width do
@@ -309,12 +309,12 @@ begin
 end;
 
 function  TFPReaderXPM.InternalCheck (Str:TStream) : boolean;
-var s : string[9];
+var s : String[9];
     l : integer;
 begin
   try
     l := str.Read (s[1],9);
-    s[0] := char(l);
+    s[0] := AnsiChar(l);
     if l <> 9 then
       result := False
     else

+ 1 - 1
packages/fcl-image/src/fpreadxwd.pas

@@ -46,7 +46,7 @@ type
       procedure WriteScanLine(Row: Integer; Img: TFPCustomImage);
     protected
       XWDFileHeader: TXWDFileHeader;  // The header, as read from the file
-      WindowName: array of Char;
+      WindowName: array of AnsiChar;
       XWDColors: TXWDColors;
       LineBuf: PByte;                 // Buffer for 1 line
 

+ 18 - 18
packages/fcl-image/src/fptiffcmn.pas

@@ -119,7 +119,7 @@ type
   public
     IFDStart: DWord; // tiff position
     IFDNext: DWord; // tiff position
-    Artist: String;
+    Artist: AnsiString;
     BitsPerSample: DWord; // tiff position of entry
     BitsPerSampleArray: array of Word;
     CellLength: DWord;
@@ -127,30 +127,30 @@ type
     ColorMap: DWord;// tiff position of entry
     Compression: DWord;
     Predictor: Word;
-    Copyright: string;
-    DateAndTime: string;
-    DocumentName: string;
+    Copyright: AnsiString;
+    DateAndTime: AnsiString;
+    DocumentName: AnsiString;
     ExtraSamples: DWord;// tiff position of entry
     FillOrder: DWord;
-    HostComputer: string;
-    ImageDescription: string;
+    HostComputer: AnsiString;
+    ImageDescription: AnsiString;
     ImageHeight: DWord;
     ImageIsMask: Boolean;
     ImageIsPage: Boolean;
     ImageIsThumbNail: Boolean;
     ImageWidth: DWord;
-    Make_ScannerManufacturer: string;
-    Model_Scanner: string;
+    Make_ScannerManufacturer: AnsiString;
+    Model_Scanner: AnsiString;
     Orientation: DWord;
     PageNumber: word; // the page number starting at 0, the total number of pages is PageCount
     PageCount: word; // see PageNumber
-    PageName: string;
+    PageName: AnsiString;
     PhotoMetricInterpretation: DWord;
     PlanarConfiguration: DWord;
     ResolutionUnit: DWord;
     RowsPerStrip: DWord;
     SamplesPerPixel: DWord;
-    Software: string;
+    Software: AnsiString;
     StripByteCounts: DWord;// tiff position of entry
     StripOffsets: DWord; // tiff position of entry
     TileWidth: DWord;
@@ -177,24 +177,24 @@ type
     destructor Destroy; override;
   end;
 
-function TiffRationalToStr(const r: TTiffRational): string;
-function StrToTiffRationalDef(const s: string; const Def: TTiffRational): TTiffRational;
+function TiffRationalToStr(const r: TTiffRational): AnsiString;
+function StrToTiffRationalDef(const s: AnsiString; const Def: TTiffRational): TTiffRational;
 procedure ClearTiffExtras(Img: TFPCustomImage);
 procedure CopyTiffExtras(SrcImg, DestImg: TFPCustomImage);
-procedure WriteTiffExtras(Msg: string; Img: TFPCustomImage);
-function TiffCompressionName(c: Word): string;
+procedure WriteTiffExtras(Msg: AnsiString; Img: TFPCustomImage);
+function TiffCompressionName(c: Word): AnsiString;
 
 function TifResolutionUnitToResolutionUnit(ATifResolutionUnit: DWord): TResolutionUnit;
 function ResolutionUnitToTifResolutionUnit(AResolutionUnit: TResolutionUnit): DWord;
 
 implementation
 
-function TiffRationalToStr(const r: TTiffRational): string;
+function TiffRationalToStr(const r: TTiffRational): AnsiString;
 begin
   Result:=IntToStr(r.Numerator)+'/'+IntToStr(r.Denominator);
 end;
 
-function StrToTiffRationalDef(const s: string; const Def: TTiffRational
+function StrToTiffRationalDef(const s: AnsiString; const Def: TTiffRational
   ): TTiffRational;
 var
   p: LongInt;
@@ -225,7 +225,7 @@ begin
       DestImg.Extra[SrcImg.ExtraKey[i]]:=SrcImg.ExtraValue[i];
 end;
 
-procedure WriteTiffExtras(Msg: string; Img: TFPCustomImage);
+procedure WriteTiffExtras(Msg: AnsiString; Img: TFPCustomImage);
 var
   i: Integer;
 begin
@@ -235,7 +235,7 @@ begin
       writeln('  ',i,' ',Img.ExtraKey[i],'=',Img.ExtraValue[i]);
 end;
 
-function TiffCompressionName(c: Word): string;
+function TiffCompressionName(c: Word): AnsiString;
 begin
   case c of
   1: Result:='no compression';

+ 4 - 2
packages/fcl-image/src/fpwritejpeg.pas

@@ -21,7 +21,9 @@
 }
 unit FPWriteJPEG;
 
-{$mode objfpc}{$H+}
+{$mode objfpc}
+{$H+}
+{$openstrings on}
 
 interface
 
@@ -76,7 +78,7 @@ begin
   if CurInfo=nil then exit;
 end;
 
-procedure FormatMessage(CurInfo: j_common_ptr; var buffer: string);
+procedure FormatMessage(CurInfo: j_common_ptr; var buffer: shortstring);
 begin
   if CurInfo=nil then exit;
   {$ifdef FPC_Debug_Image}

+ 1 - 1
packages/fcl-image/src/fpwritepng.pp

@@ -139,7 +139,7 @@ begin
     {$ELSE}
     chead.CLength := alength;
     {$ENDIF}
-	if (ReadType = '') then
+	if (Length(ReadType)=0) then
       if atype <> ctUnknown then
         chead.CType := ChunkTypes[aType]
       else

+ 9 - 9
packages/fcl-image/src/fpwritepnm.pp

@@ -41,8 +41,8 @@ type
   public
     Property FullWidth: Boolean Read FFullWidth Write SetFullWidth; {if true write 16 bits per colour for P5, P6 formats}
     function GuessColorDepthOfImage(Img: TFPCustomImage): TPNMColorDepth;
-    function GetColorDepthOfExtension(AExtension: string): TPNMColorDepth;
-    function GetFileExtension(AColorDepth: TPNMColorDepth): string;
+    function GetColorDepthOfExtension(AExtension: AnsiString): TPNMColorDepth;
+    function GetFileExtension(AColorDepth: TPNMColorDepth): AnsiString;
     constructor Create; override;
     Property BinaryFormat : Boolean Read FBinaryFormat Write FBinaryFormat;
     Property ColorDepth: TPNMColorDepth Read FColorDepth Write FColorDepth;
@@ -66,13 +66,13 @@ type
       constructor Create; override;
   end;
 
-procedure SaveImageToPNMFile(Img: TFPCustomImage; filename: string; UseBinaryFormat: boolean = true);
+procedure SaveImageToPNMFile(Img: TFPCustomImage; filename: AnsiString; UseBinaryFormat: boolean = true);
 
 implementation
 
-procedure SaveImageToPNMFile(Img: TFPCustomImage; filename: string; UseBinaryFormat: boolean = true);
+procedure SaveImageToPNMFile(Img: TFPCustomImage; filename: AnsiString; UseBinaryFormat: boolean = true);
 var writer: TFPWriterPNM;
-    curExt: string;
+    curExt: AnsiString;
 begin
   writer := TFPWriterPNM.Create;
   writer.BinaryFormat := UseBinaryFormat;
@@ -158,8 +158,8 @@ var
     aColor:TFPColor;
     aLine:PByte;
     dLine : PWord;
-    strCol:String[3];
-    LinuxEndOfLine: char;
+    strCol: String[3];
+    LinuxEndOfLine: AnsiChar;
     UseColorDepth: TPNMColorDepth;
 
 begin
@@ -258,7 +258,7 @@ begin
     FreeMem(aLine,nBpLine);
 end;
 
-function TFPWriterPNM.GetColorDepthOfExtension(AExtension: string
+function TFPWriterPNM.GetColorDepthOfExtension(AExtension: AnsiString
   ): TPNMColorDepth;
 begin
   if (length(AExtension) > 0) and (AExtension[1]='.') then
@@ -294,7 +294,7 @@ begin
      end;
 end;
 
-function TFPWriterPNM.GetFileExtension(AColorDepth: TPNMColorDepth): string;
+function TFPWriterPNM.GetFileExtension(AColorDepth: TPNMColorDepth): AnsiString;
 begin
   case AColorDepth of
     pcdBlackWhite: result := 'pbm';

+ 3 - 3
packages/fcl-image/src/fpwritetiff.pas

@@ -96,7 +96,7 @@ type
   protected
     procedure WriteIFDs; virtual;
     procedure InternalWrite(Stream: TStream; Img: TFPCustomImage); override;
-    procedure AddEntryString(Tag: word; const s: string);
+    procedure AddEntryString(Tag: word; const s: AnsiString);
     procedure AddEntryShort(Tag: word; Value: Word);
     procedure AddEntryLong(Tag: word; Value: DWord);
     procedure AddEntryShortOrLong(Tag: word; Value: DWord);
@@ -252,7 +252,7 @@ end;
 
 procedure TFPWriterTiff.WriteHeader;
 var
-  EndianMark: String;
+  EndianMark: AnsiString;
 begin
   EndianMark:={$IFDEF FPC_BIG_ENDIAN}'MM'{$ELSE}'II'{$ENDIF};
   WriteBuf(EndianMark[1],2);
@@ -751,7 +751,7 @@ begin
   SaveToStream(Stream);
 end;
 
-procedure TFPWriterTiff.AddEntryString(Tag: word; const s: string);
+procedure TFPWriterTiff.AddEntryString(Tag: word; const s: AnsiString);
 begin
   if s<>'' then
     AddEntry(Tag,2,length(s)+1,@s[1],length(s)+1)

+ 9 - 9
packages/fcl-image/src/fpwritexpm.pp

@@ -23,17 +23,17 @@ type
 
   TFPWriterXPM = class (TFPCustomImageWriter)
     private
-      FPalChars : string;
-      FColorFormat : string;
+      FPalChars : AnsiString;
+      FColorFormat : AnsiString;
       FColorShift : word;
       FColorSize : byte;
       procedure SetColorSize (AValue : byte);
-      function ColorToHex (const c:TFPColor) : string;
+      function ColorToHex (const c:TFPColor) : AnsiString;
     protected
       procedure InternalWrite (Str:TStream; Img:TFPCustomImage); override;
     public
       constructor Create; override;
-      property PalChars : string read FPalChars write FPalChars;
+      property PalChars : AnsiString read FPalChars write FPalChars;
       property ColorCharSize : byte read FColorSize write SetColorSize;
       // number of characters to use for 1 colorcomponent
   end;
@@ -61,7 +61,7 @@ begin
     FColorSize := AValue;
 end;
 
-function TFPWriterXPM.ColorToHex (const c:TFPColor) : string;
+function TFPWriterXPM.ColorToHex (const c:TFPColor) : AnsiString;
 var r,g,b : word;
 begin
   with c do
@@ -79,7 +79,7 @@ var p, l : TStringList;
     TmpPalette, Palette: TFPPalette;
   procedure BuildPaletteStrings;
   var r,c,e : integer;
-    procedure MakeCodes (const head:string; charplace:integer);
+    procedure MakeCodes (const head:AnsiString; charplace:integer);
     var r : integer;
     begin
       r := 1;
@@ -109,7 +109,7 @@ var p, l : TStringList;
     MakeCodes ('',len);
   end;
   procedure InitConsts;
-  var fmt : string;
+  var fmt : AnsiString;
   begin
     fmt := inttostr(FColorSize);
     fmt := '%'+fmt+'.'+fmt+'x';
@@ -121,14 +121,14 @@ var p, l : TStringList;
       else FColorShift := 0;
     end;
   end;
-var s : string;
+var s : AnsiString;
 begin
   l := TStringList.Create;
   p := TStringList.Create;
   TmpPalette := nil;
   try
     l.Add ('/* XPM */');
-    l.Add ('static char *graphic[] = {');
+    l.Add ('static AnsiChar *graphic[] = {');
     Palette := img.palette;
     if not Assigned(Palette) then begin
       TmpPalette := TFPPalette.Create(0);

+ 20 - 14
packages/fcl-image/src/freetype.pp

@@ -12,7 +12,9 @@
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
  **********************************************************************}
-{$mode objfpc}{$h+}
+{$mode objfpc}
+{$h+}
+
 unit freetype;
 
 {$DEFINE DYNAMIC}
@@ -136,8 +138,8 @@ type
       function CreateGlyph (c : cardinal) : PMgrGlyph;
       procedure MakeTransformation (angle:real; out Transformation:FT_Matrix);
       procedure InitMakeString (FontID, Size:real);
-      function MakeString (FontId:integer; Text:string; size:real; angle:real) : TStringBitmaps;
-      function MakeString (FontId:integer; Text:string; Size:real) : TStringBitmaps;
+      function MakeString (FontId:integer; Text:AnsiString; size:real; angle:real) : TStringBitmaps;
+      function MakeString (FontId:integer; Text:AnsiString; Size:real) : TStringBitmaps;
       function MakeString (FontId:integer; Text:Unicodestring; size:real; angle:real) : TUnicodeStringBitmaps;
       function MakeString (FontId:integer; Text:Unicodestring; Size:real) : TUnicodeStringBitmaps;
     public
@@ -147,16 +149,16 @@ type
       function RequestFont (afilename:string) : integer;
       function RequestFont (afilename:string; anindex:integer) : integer;
       function GetFreeTypeFont (aFontID:integer) : PFT_Face;
-      function GetString (FontId:integer; Text:string; size:real; angle:real) : TStringBitmaps;
+      function GetString (FontId:integer; Text:AnsiString; size:real; angle:real) : TStringBitmaps;
       function GetString (FontId:integer; Text:Unicodestring; size:real; angle:real) : TUnicodeStringBitmaps;
       // Black and white
-      function GetStringGray (FontId:integer; Text:string; size:real; angle:real) : TStringBitmaps;
+      function GetStringGray (FontId:integer; Text:AnsiString; size:real; angle:real) : TStringBitmaps;
       function GetStringGray (FontId:integer; Text:unicodestring; size:real; angle:real) : TUnicodeStringBitmaps;
       // Anti Aliased gray scale
-      function GetString (FontId:integer; Text:string; Size:real) : TStringBitmaps;
+      function GetString (FontId:integer; Text:AnsiString; Size:real) : TStringBitmaps;
       function GetString (FontId:integer; Text:Unicodestring; Size:real) : TUnicodeStringBitmaps;
       // Black and white, following the direction of the font (left to right, top to bottom, ...)
-      function GetStringGray (FontId:integer; Text: String; Size:real) : TStringBitmaps;
+      function GetStringGray (FontId:integer; Text:AnsiString; Size:real) : TStringBitmaps;
       function GetStringGray (FontId:integer; Text:Unicodestring; Size:real) : TUnicodeStringBitmaps;
       // Anti Aliased gray scale, following the direction of the font (left to right, top to bottom, ...)
       property SearchPath : string read GetSearchPath write SetSearchPath;
@@ -262,6 +264,9 @@ end;}
 
 constructor TMgrFont.Create (aMgr:TFontManager; afilename:string; anindex:integer);
 
+var
+  FN : AnsiString;
+
 begin
   inherited create;
   Filename := afilename;
@@ -269,7 +274,8 @@ begin
   FSizes := TList.create;
   LastSize := nil;
   Try
-    FTCheck(FT_New_Face (aMgr.FTLib, pchar(afilename), anindex, font),format (sErrLoadFont,[anindex,afilename]));
+    FN:=aFileName;
+    FTCheck(FT_New_Face (aMgr.FTLib, PAnsiChar(FN), anindex, font),format (sErrLoadFont,[anindex,afilename]));
     //WriteFT_Face(font);
   except
     Font:=Nil;
@@ -602,7 +608,7 @@ begin
   UseKerning := ((Curfont.font^.face_flags and FT_FACE_FLAG_KERNING) <> 0);
 end;
 
-function TFontManager.MakeString (FontId:integer; Text:string; size:real; angle:real) : TStringBitmaps;
+function TFontManager.MakeString (FontId:integer; Text:Ansistring; size:real; angle:real) : TStringBitmaps;
 
 Var
   T : Array of cardinal;
@@ -752,7 +758,7 @@ begin
     end;
 end;
 
-function TFontManager.MakeString (FontId:integer; Text:string; Size:real) : TStringBitmaps;
+function TFontManager.MakeString (FontId:integer; Text:AnsiString; Size:real) : TStringBitmaps;
 
 Var
   T : Array of Cardinal;
@@ -876,14 +882,14 @@ begin
   ABitmaps.CalculateGlobals;
 end;
 
-function TFontManager.GetString (FontId:integer; Text:string; size:real; angle:real) : TStringBitmaps;
+function TFontManager.GetString (FontId:integer; Text:AnsiString; size:real; angle:real) : TStringBitmaps;
 // Black and white
 begin
   CurRenderMode := FT_RENDER_MODE_MONO;
   result := MakeString (FontID, text, Size, angle);
 end;
 
-function TFontManager.GetStringGray (FontId:integer; Text:string; size:real; angle:real) : TStringBitmaps;
+function TFontManager.GetStringGray (FontId:integer; Text:AnsiString; size:real; angle:real) : TStringBitmaps;
 // Anti Aliased gray scale
 begin
   CurRenderMode := FT_RENDER_MODE_NORMAL;
@@ -892,14 +898,14 @@ end;
 
 { Procedures without angle have own implementation to have better speed }
 
-function TFontManager.GetString (FontId:integer; Text:string; Size:real) : TStringBitmaps;
+function TFontManager.GetString (FontId:integer; Text:AnsiString; Size:real) : TStringBitmaps;
 // Black and white, following the direction of the font (left to right, top to bottom, ...)
 begin
   CurRenderMode := FT_RENDER_MODE_MONO;
   result := MakeString (FontID, text, Size);
 end;
 
-function TFontManager.GetStringGray (FontId:integer; Text:string; Size:real) : TStringBitmaps;
+function TFontManager.GetStringGray (FontId:integer; Text:AnsiString; Size:real) : TStringBitmaps;
 // Anti Aliased gray scale, following the direction of the font (left to right, top to bottom, ...)
 begin
   CurRenderMode := FT_RENDER_MODE_NORMAL;

+ 10 - 10
packages/fcl-image/src/ftfont.pp

@@ -52,15 +52,15 @@ type
     procedure DoAllocateResources; override;
     procedure DoDeAllocateResources; override;
     procedure DoCopyProps (From:TFPCanvasHelper); override;
-    procedure DoDrawText (atx,aty:integer; atext:string); override;
-    procedure DoGetTextSize (text:string; var w,h:integer); override;
-    function DoGetTextHeight (text:string) : integer; override;
-    function DoGetTextWidth (text:string) : integer; override;
+    procedure DoDrawText (atx,aty:integer; atext:Ansistring); override;
+    procedure DoGetTextSize (text:ansistring; var w,h:integer); override;
+    function DoGetTextHeight (text:ansistring) : integer; override;
+    function DoGetTextWidth (text:ansistring) : integer; override;
     procedure DoDrawText (atx,aty:integer; atext: unicodestring); override;
     procedure DoGetTextSize (text:unicodestring; var w,h:integer); override;
     function DoGetTextHeight (text:unicodestring) : integer; override;
     function DoGetTextWidth (text: unicodestring) : integer; override;
-    procedure GetText (aText:string);
+    procedure GetText (aText:ansistring);
     procedure GetText (aText:unicodestring);
     procedure GetFace;
   public
@@ -175,7 +175,7 @@ procedure TFreeTypeFont.DoDeAllocateResources;
 begin
 end;
 
-procedure TFreeTypeFont.DoGetTextSize (text:string; var w,h:integer);
+procedure TFreeTypeFont.DoGetTextSize (text:ansistring; var w,h:integer);
 var r : TRect;
 begin
   GetText (text);
@@ -187,7 +187,7 @@ begin
     end;
 end;
 
-function TFreeTypeFont.DoGetTextHeight (text:string) : integer;
+function TFreeTypeFont.DoGetTextHeight (text:ansistring) : integer;
 var r : TRect;
 begin
   GetText (text);
@@ -196,7 +196,7 @@ begin
     result := top - bottom;
 end;
 
-function TFreeTypeFont.DoGetTextWidth (text:string) : integer;
+function TFreeTypeFont.DoGetTextWidth (text:ansistring) : integer;
 var r : TRect;
 begin
   GetText (text);
@@ -263,7 +263,7 @@ begin
     result := inherited GetFlags (index);
 end;
 
-procedure TFreeTypeFont.GetText (aText:string);
+procedure TFreeTypeFont.GetText (aText:AnsiString);
 var b : boolean;
 begin
   if assigned (FLastText) then
@@ -341,7 +341,7 @@ begin
   DrawLastText(atX,atY);
 end;
 
-procedure TFreeTypeFont.DoDrawText (atX,atY:integer; atext:string);
+procedure TFreeTypeFont.DoDrawText (atX,atY:integer; atext:AnsiString);
 
 begin
   GetText (atext);

+ 10 - 10
packages/fcl-image/src/libfreetype.inc

@@ -48,7 +48,7 @@ Const
 {$endif}
 
 type
-  FT_Encoding = array[0..3] of char;
+  FT_Encoding = array[0..3] of AnsiChar;
 
 const
   FT_FACE_FLAG_SCALABLE = 1 shl 0;
@@ -117,9 +117,9 @@ type
   FT_Bool = boolean;
   FT_FWord = smallint;
   FT_UFWord = word;
-  FT_Char = char;
+  FT_Char = AnsiChar;
   FT_Byte = byte;
-  FT_String = char;
+  FT_String = AnsiChar;
   FT_Short = smallint;
   FT_UShort = word;
   FT_Int = longint;
@@ -207,8 +207,8 @@ type
     pitch : integer;
     buffer : pointer;
     num_grays : shortint;
-    pixel_mode : char;
-    palette_mode : char;
+    pixel_mode : AnsiChar;
+    palette_mode : AnsiChar;
     palette : pointer;
   end;
 
@@ -216,7 +216,7 @@ type
     n_contours,
     n_points : smallint;
     points : PFT_Vector;
-    tags : pchar;
+    tags : PAnsiChar;
     contours : ^smallint;
     flags : integer;
   end;
@@ -312,8 +312,8 @@ type
     face_flags : FT_Long;
     style_flags : FT_Long;
     num_glyphs : FT_Long;
-    family_name : pchar;
-    style_name : pchar;
+    family_name : PAnsiChar;
+    style_name : PAnsiChar;
     num_fixed_sizes : FT_Int;
     available_sizes : PFT_Bitmap_Size;     // is array
     num_charmaps : FT_Int;
@@ -364,7 +364,7 @@ function FT_Get_Kerning(face: PFT_Face; left_glyph, right_glyph, kern_mode: FT_U
 function FT_Init_FreeType(var alibrary: PFT_Library): integer; cdecl; external FreeTypeDLL Name 'FT_Init_FreeType';
 function FT_Load_Char(face: PFT_Face; charcode: FT_ULong; load_flags: longint): integer; cdecl; external FreeTypeDLL Name 'FT_Load_Char';
 function FT_Load_Glyph(face: PFT_Face; glyph_index: FT_UInt; load_flags: longint): integer; cdecl; external FreeTypeDLL Name 'FT_Load_Glyph';
-function FT_New_Face(alibrary: PFT_Library; filepathname: PChar; face_index: integer; var aface: PFT_Face): integer; cdecl; external FreeTypeDLL Name 'FT_New_Face';
+function FT_New_Face(alibrary: PFT_Library; filepathname: PAnsiChar; face_index: integer; var aface: PFT_Face): integer; cdecl; external FreeTypeDLL Name 'FT_New_Face';
 function FT_Set_Char_Size(face: PFT_Face; char_width, char_height: FT_F26dot6; horz_res, vert_res: FT_UInt): integer; cdecl; external FreeTypeDLL Name 'FT_Set_Char_Size';
 function FT_Set_Pixel_Sizes(face: PFT_Face; pixel_width, pixel_height: FT_UInt): integer; cdecl; external FreeTypeDLL Name 'FT_Set_Pixel_Sizes';
 procedure FT_Set_Transform(face: PFT_Face; matrix: PFT_Matrix; delta: PFT_Vector); cdecl; external FreeTypeDLL Name 'FT_Set_Transform';
@@ -393,7 +393,7 @@ Type
   TFT_Init_FreeType = function(var alibrary: PFT_Library): integer; cdecl;
   TFT_Load_Char = function(face: PFT_Face; charcode: FT_ULong; load_flags: longint): integer; cdecl;
   TFT_Load_Glyph = function(face: PFT_Face; glyph_index: FT_UInt; load_flags: longint): integer; cdecl;
-  TFT_New_Face = function(alibrary: PFT_Library; filepathname: PChar; face_index: integer; var aface: PFT_Face): integer; cdecl;
+  TFT_New_Face = function(alibrary: PFT_Library; filepathname: PAnsiChar; face_index: integer; var aface: PFT_Face): integer; cdecl;
   TFT_Set_Char_Size = function(face: PFT_Face; char_width, char_height: FT_F26dot6; horz_res, vert_res: FT_UInt): integer; cdecl;
   TFT_Set_Pixel_Sizes = function(face: PFT_Face; pixel_width, pixel_height: FT_UInt): integer; cdecl;
   TFT_Set_Transform = procedure(face: PFT_Face; matrix: PFT_Matrix; delta: PFT_Vector); cdecl;

+ 1 - 1
packages/fcl-image/src/pngcomn.pp

@@ -33,7 +33,7 @@ type
     );
 
   EightLong = array[0..7] of longword;
-  TChunkCode = array[0..3] of char;
+  TChunkCode = array[0..3] of AnsiChar;
 
   TChunk = record
     acapacity, alength, CRC : longword;

+ 3 - 3
packages/fcl-image/src/psdcomn.pas

@@ -160,7 +160,7 @@ type
 
   { File Header Section }
   TPSDHeader = packed record
-    Signature : array[0..3] of Char;   // File IDs '8BPS'
+    Signature : array[0..3] of AnsiChar;   // File IDs '8BPS'
     Version : word;                    // Version number, always 1
     Reserved : array[0..5] of Byte;    // Reserved, must be zeroed
     Channels : Word;                   // Number of color channels (1-24) including alpha channels
@@ -172,10 +172,10 @@ type
 
   { Image Resource Blocks }
   TPSDResourceBlock = packed record
-    Types : array[0..3] of Char;   // Always "8BIM"
+    Types : array[0..3] of AnsiChar;   // Always "8BIM"
     ID:word;                       // see previous Image Resource IDs consts
     NameLen:Byte;                  // Pascal-format string, 2 bytes or longer
-    Name:Char;
+    Name:AnsiChar;
   end;
   PPSDResourceBlock =^TPSDResourceBlock;
 

+ 1 - 1
packages/fcl-image/src/qoicomn.pas

@@ -19,7 +19,7 @@ interface
 
 type  PQoiHeader = ^TQoiHeader;
       TQoiHeader = packed record
-         magic  : array [0..3] of char; { magic bytes 'qoif' }
+         magic  : array [0..3] of AnsiChar; { magic bytes 'qoif' }
          width  : dword;                { image width in pixels (BE)}
          height : dword;                { image height in pixels (BE)}
          channels   : byte;             { 3 = RGB, 4 = RGBA }

+ 2 - 2
packages/fcl-image/src/xwdfile.pp

@@ -117,8 +117,8 @@ type
     red: Word;
     green: Word;
     blue: Word;
-    flags: Char;
-    pad: Char;
+    flags: AnsiChar;
+    pad: AnsiChar;
   end;
 
 { Last comes the image data in the format described by XWDFileHeader. }