You are not logged in.
Pages: 1
Using exact position result the following:
As you can see the space betweeen the letters are different and the document looks ugly. The only way to keep it looking good is using SetTextJustification. But it doesn't handle character spacing. This is why I switched to the exact method in this case.
If you have any idea how to fix the character shifting problem, please let me know. It is important, that I'm using fastreport to generate PDF with the component posted in this forum.
Look in SynPdf.pas at TPdfEnum.TextOut
To get better results if positioning method is tpSetTextJustification, rendering should switch to tpExactTextCharacterPositining if special char spacing is used.
if R.emrtext.offDx>0 then begin
DX := pointer(PtrUInt(@R)+R.emrtext.offDx);
W := DXTextWidth(DX, R.emrText.nChars);
//BS.2015.03.21. - Start
if Positioning=tpSetTextJustification then
Positioning := tpExactTextCharacterPositining;
//BS.2015.03.21. - End
if W<R.rclBounds.Right-R.rclBounds.Left then // offDX=0 or within box
DX := nil;
end else
DX := nil;
Best regards
Sándor Bógáncs
in
procedure TPdfDocumentGDI.SaveToStream(AStream: TStream; ForceModDate: TDateTime=0);
change
FCanvas.RenderMetaFile(P.fVCLCurrentMetaFile,1,0,0,
fUseMetaFileTextPositioning,KerningHScaleBottom,KerningHScaleBottom,
fDisableTextClipping);
to
FCanvas.RenderMetaFile(P.fVCLCurrentMetaFile,1,0,0,
fUseMetaFileTextPositioning,KerningHScaleBottom,KerningHScaleTop,
fDisableTextClipping);
in
procedure TPdfDocumentGDI.SaveToStreamDirectPageFlush;
change
FCanvas.RenderMetaFile(P.fVCLCurrentMetaFile,1,0,0,
fUseMetaFileTextPositioning,KerningHScaleBottom,KerningHScaleBottom,
fDisableTextClipping);
to
FCanvas.RenderMetaFile(P.fVCLCurrentMetaFile,1,0,0,
fUseMetaFileTextPositioning,KerningHScaleBottom,KerningHScaleTop,
fDisableTextClipping);
Pages: 1