Skip to content

Commit

Permalink
Fix getTextCol text vert alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaasuni committed Mar 21, 2024
1 parent 864f22a commit 95337a8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,7 @@
$txtbox = $pdf->getTextCol(
$txt3,
20, // float $posx = 0,
50, // float $posy = 0,
30, // float $posy = 0,
150, // float $width = 0,
1, // float $linespace = 0,
0, // float $strokewidth = 0,
Expand Down
2 changes: 1 addition & 1 deletion src/Text.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ public function getTextCol(
$lines = $this->splitLines($ordarr, $dim, $this->toPoints($width));
$lastline = (count($lines) - 1);
$jwidth = ($justify ? $width : 0);
$line_posy = $posy;
$curfont = $this->font->getCurrentFont();
$font_ascent = $this->toUnit($curfont['ascent']);
$line_posy = $posy + $font_ascent;
$out = '';

foreach ($lines as $i => $data) {
Expand Down

0 comments on commit 95337a8

Please sign in to comment.