Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix problem with horizontal scaling in SynPDF #424

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions SynPdf.pas
Original file line number Diff line number Diff line change
Expand Up @@ -10597,14 +10597,6 @@ procedure DrawLine(var P: TPoint; aH: Single);
end else
Canvas.ShowText(pointer(tmp));
Canvas.EndText;
case Positioning of
tpSetTextJustification:
if nspace>0 then
Canvas.SetWordSpace(0);
tpKerningFromAveragePosition:
if hscale<>100 then
Canvas.SetHorizontalScaling(100); //reset hor. scaling
end;
// handle underline or strike out styles (direct draw PDF lines on canvas)
if font.LogFont.lfUnderline<>0 then
DrawLine(Posi, aSize / 8 / Canvas.GetWorldFactorX / Canvas.FDevScaleX);
Expand All @@ -10615,6 +10607,16 @@ procedure DrawLine(var P: TPoint; aH: Single);
Canvas.GRestore;
fFillColor := -1; // force set drawing color
end;

case Positioning of
tpSetTextJustification:
if nspace>0 then
Canvas.SetWordSpace(0);
tpKerningFromAveragePosition:
if hscale<>100 then
Canvas.SetHorizontalScaling(100); //reset hor. scaling
end;

if not Canvas.FNewPath then begin
if WithClip then
if not DC[nDC].ClipRgnNull then begin
Expand Down