Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [UNRELEASE]

### Fixed

- Change default font for special letters

## [4.0.0] - 2025-03-06

Expand Down
8 changes: 2 additions & 6 deletions inc/simplepdf.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,9 @@ public function __construct($format = 'A4', $orient = '')

$pdf->SetCreator('GLPI');
$pdf->SetAuthor('GLPI');
$font = 'helvetica';
//$subsetting = true;
$font = 'dejavusans';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't we just moving the problem to another language?

A few lines down (I can't comment on this), $font is overwritten by $_SESSION[‘glpipdffont’]. Where can we change this value? This is probably what's missing.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have removed the use of the glpipdffont session variable. Because apart from causing problems when applying fonts that don't take all character styles into account, it's not very useful.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have the same code in the core, so I assume that $_SESSION[‘glpipdffont’] was modifiable in the past. I think that's what we need to look into.

image

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've checked it's not modified anywhere in the code

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I mean is that in the core and the plugin, we are trying to use $_SESSION['glpipdffont'], which is never defined.

The fix you're making in the plugin should also be applied in the core, I think.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay 👍

$fonsize = 8;
if (isset($_SESSION['glpipdffont']) && $_SESSION['glpipdffont']) {
$font = $_SESSION['glpipdffont'];
//$subsetting = false;
}

$pdf->setHeaderFont([$font, 'B', 8]);
$pdf->setFooterFont([$font, 'B', 8]);

Expand Down