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');
|
var fontBBox = topDict.getByName('FontBBox');
|
||||||
if (fontBBox) {
|
if (fontBBox) {
|
||||||
// adjusting ascent/descent
|
// adjusting ascent/descent
|
||||||
properties.ascent = fontBBox[3];
|
properties.ascent = Math.max(fontBBox[3], fontBBox[1]);
|
||||||
properties.descent = fontBBox[1];
|
properties.descent = Math.min(fontBBox[1], fontBBox[3]);
|
||||||
properties.ascentScaled = true;
|
properties.ascentScaled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -705,8 +705,8 @@ var Type1Parser = (function Type1ParserClosure() {
|
|||||||
case 'FontBBox':
|
case 'FontBBox':
|
||||||
var fontBBox = this.readNumberArray();
|
var fontBBox = this.readNumberArray();
|
||||||
// adjusting ascent/descent
|
// adjusting ascent/descent
|
||||||
properties.ascent = fontBBox[3];
|
properties.ascent = Math.max(fontBBox[3], fontBBox[1]);
|
||||||
properties.descent = fontBBox[1];
|
properties.descent = Math.min(fontBBox[1], fontBBox[3]);
|
||||||
properties.ascentScaled = true;
|
properties.ascentScaled = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
@ -271,3 +271,4 @@
|
|||||||
!zero_descent.pdf
|
!zero_descent.pdf
|
||||||
!operator-in-TJ-array.pdf
|
!operator-in-TJ-array.pdf
|
||||||
!issue7878.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,
|
"link": false,
|
||||||
"rounds": 1,
|
"rounds": 1,
|
||||||
"type": "text"
|
"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