Skip to content

Conversation

@jindrapetrik
Copy link

Currently, during font subsetting, head checksum is calculated and placed on offset 8 after head table start,
but this is incorrect and causes overwriting head.offset field!

The checksum should be placed in offset 4 after the tag 'head'.

This PR fixes this.

For me, this fixed PDF display error on Adobe Reader and or not diplaying proper characters in Edge PDF viewer.

@CLAassistant
Copy link

CLAassistant commented Feb 2, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@williamdes williamdes left a comment

Choose a reason for hiding this comment

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

Can you provide a before and after pdf please?

@jindrapetrik
Copy link
Author

Yes, here:
before.pdf
after.pdf

Using code like this:

      $pdf = new \TCPDF();
      $pdf->AddFont('Unifont', '', PDF_FONTPATH . 'unifont.php', true);
      $pdf->setFont('Unifont', '', 16);
      $pdf->AddPage();
      $pdf->Write(16, "ABC");
      $pdf->Output('out.pdf', 'D');

(I am using TCPDF 6.4.4, but the problem is probably the same in current.)

@williamdes
Copy link
Contributor

Thanks
@nicolaasuni ready for your review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants