mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-23 08:38:06 +02:00
Fix reading number of HTMX metrics.
The length of the HHEA table can be incorrect, so it is better to read the number of metrics offset from beginning of table instead.
This commit is contained in:
parent
b39ec7af96
commit
32eace043b
4 changed files with 20 additions and 1 deletions
|
@ -1613,7 +1613,19 @@ var Font = (function FontClosure() {
|
|||
}
|
||||
|
||||
font.pos = (font.start ? font.start : 0) + header.offset;
|
||||
font.pos += header.length - 2;
|
||||
font.pos += 4; // version
|
||||
font.pos += 2; // ascent
|
||||
font.pos += 2; // descent
|
||||
font.pos += 2; // linegap
|
||||
font.pos += 2; // adv_width_max
|
||||
font.pos += 2; // min_sb1
|
||||
font.pos += 2; // min_sb2
|
||||
font.pos += 2; // max_extent
|
||||
font.pos += 2; // caret_slope_rise
|
||||
font.pos += 2; // caret_slope_run
|
||||
font.pos += 2; // caret_offset
|
||||
font.pos += 8; // reserved
|
||||
font.pos += 2; // format
|
||||
var numOfMetrics = font.getUint16();
|
||||
|
||||
if (numOfMetrics > numGlyphs) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue