From f0972cf0569c644fb57a8675764eddd85cbb77a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Mon, 2 Feb 2026 09:58:58 +0100 Subject: [PATCH] Fixed: Font subsetting - incorrect placement of head checksum overwriting head offset. --- include/tcpdf_fonts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/tcpdf_fonts.php b/include/tcpdf_fonts.php index fbe7009c..fc75e0f2 100644 --- a/include/tcpdf_fonts.php +++ b/include/tcpdf_fonts.php @@ -1384,7 +1384,7 @@ public static function _getTrueTypeFontSubset($font, $subsetchars) { } // set checkSumAdjustment on head table $checkSumAdjustment = 0xB1B0AFBA - self::_getTTFtableChecksum($font, strlen($font)); - $font = substr($font, 0, $table['head']['offset'] + $offset + 8).pack('N', $checkSumAdjustment).substr($font, $table['head']['offset'] + $offset + 12); + $font = substr($font, 0, $table['head']['offset'] + $offset + 4).pack('N', $checkSumAdjustment).substr($font, $table['head']['offset'] + $offset + 8); return $font; }