[Lazarus] PDF generator, try 2
Michael Van Canneyt
michael at freepascal.org
Wed Apr 6 19:18:02 CEST 2016
On Wed, 6 Apr 2016, silvioprog wrote:
> On Thu, Mar 31, 2016 at 1:17 PM, Michael Van Canneyt <michael at freepascal.org
>> wrote:
> [...]
>
>> Please, don't do {%H-} etc:
>>
>> procedure CreateTTFCIDSystemInfo(const {%H-}EmbeddedFontNum:
>> integer;{%H-}FontDef: TFontDef);virtual;
>>
>
> {$HINTS OFF} instead of it?
No, fix the hint (if possible).
>> Typecasts like this should also not be done:
>>
>> + FontDef.FDiffs := WideString(lFontDef.Diffs);
>> + FontDef.FCharWidth := WideString(lFontDef.CharWidths);
>>
>
> Because the FontDef.FCharWidth is a WideString.
>
>
>> - Arr.AddIntArray(FontDef.FCharWidth);
>> + Arr.AddIntArray(string(FontDef.FCharWidth));
>>
>
> Because Arr.AddIntArray() is AnsiString (string) and FontDef.FCharWidth
> WideString.
>
>
>> We need to investigate why you think this typecast is needed.
>>
>
> It just stop hints/warnings from compiler.
The correct thing to do is to make sure the types are compatible.
What you do is hide the real issue.
But we will look at it.
Michael.
More information about the Lazarus
mailing list