Skip to content

Commit

Permalink
Return dictionary info on insert
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaasuni committed Aug 17, 2024
1 parent 7e3591c commit 4e1eb48
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.3
2.3.0
4 changes: 4 additions & 0 deletions src/Stack.php
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ protected function getFontMetric(array $font): array
$wratio = ($cratio * $font['stretching']); // horizontal ratio
$data = $this->getFont($font['key']);
$outfont = sprintf('/F%d %F Tf', $data['i'], $font['size']); // PDF output string
$objname = 'F' . $data['i'];
// add this font in the stack wit metrics in internal units
$this->metric[$mkey] = [
'ascent' => ((float) $data['desc']['Ascent'] * $cratio),
Expand All @@ -468,6 +469,9 @@ protected function getFontMetric(array $font): array
'maxwidth' => ((float) $data['desc']['MaxWidth'] * $cratio * $font['stretching']),
'midpoint' => ((float) ($data['desc']['Ascent'] + $data['desc']['Descent']) * $cratio / 2),
'missingwidth' => ((float) $data['desc']['MissingWidth'] * $cratio * $font['stretching']),
'objdic' => ' /' . $objname . ' ' . $data['n'] . ' 0 R',
'objid' => $data['n'],
'objname' => $objname,
'out' => 'BT ' . $outfont . ' ET' . "\r",
'outraw' => $outfont,
'size' => $size,
Expand Down

0 comments on commit 4e1eb48

Please sign in to comment.