Skip to content

Commit 203a660

Browse files
committed
Set the head table checkSumAdjustment to zero
...before calculating the head table checksum. Per the head table specification: > checkSumAdjustment: To compute set it to 0, calculate the checksum for the 'head' table and put it in the table directory, sum the entire font as a uint32_t, then store 0xB1B0AFBA - sum. (The checksum for the 'head' table will be wrong as a result. That is OK; do not reset it.) ref #123
1 parent f7cfe59 commit 203a660

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/FontLib/Table/Type/head.php

+5
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,9 @@ protected function _parse() {
4343
throw new Exception("Incorrect magic number (" . dechex($this->data["magicNumber"]) . ")");
4444
}
4545
}
46+
47+
function _encode() {
48+
$this->data["checkSumAdjustment"] = 0;
49+
return parent::_encode();
50+
}
4651
}

0 commit comments

Comments
 (0)