Font ascent descent calculation fix
This commit is contained in:
parent
466760efca
commit
af8292058f
@ -257,8 +257,8 @@ var CFFParser = (function CFFParserClosure() {
|
||||
var fontBBox = topDict.getByName('FontBBox');
|
||||
if (fontBBox) {
|
||||
// adjusting ascent/descent
|
||||
properties.ascent = fontBBox[3];
|
||||
properties.descent = fontBBox[1];
|
||||
properties.ascent = Math.max(fontBBox[3], fontBBox[1]);
|
||||
properties.descent = Math.min(fontBBox[1], fontBBox[3]);
|
||||
properties.ascentScaled = true;
|
||||
}
|
||||
|
||||
|
@ -705,8 +705,8 @@ var Type1Parser = (function Type1ParserClosure() {
|
||||
case 'FontBBox':
|
||||
var fontBBox = this.readNumberArray();
|
||||
// adjusting ascent/descent
|
||||
properties.ascent = fontBBox[3];
|
||||
properties.descent = fontBBox[1];
|
||||
properties.ascent = Math.max(fontBBox[3], fontBBox[1]);
|
||||
properties.descent = Math.min(fontBBox[1], fontBBox[3]);
|
||||
properties.ascentScaled = true;
|
||||
break;
|
||||
}
|
||||
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
@ -271,3 +271,4 @@
|
||||
!zero_descent.pdf
|
||||
!operator-in-TJ-array.pdf
|
||||
!issue7878.pdf
|
||||
!font_ascent_descent.pdf
|
||||
|
BIN
test/pdfs/font_ascent_descent.pdf
Executable file
BIN
test/pdfs/font_ascent_descent.pdf
Executable file
Binary file not shown.
@ -3367,5 +3367,11 @@
|
||||
"link": false,
|
||||
"rounds": 1,
|
||||
"type": "text"
|
||||
},
|
||||
{ "id": "font_ascent_descent",
|
||||
"file": "pdfs/font_ascent_descent.pdf",
|
||||
"md5": "c0048a7735010002b998c112335e47bf",
|
||||
"rounds": 1,
|
||||
"type": "eq"
|
||||
}
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user