mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Font ascent descent calculation fix
This commit is contained in:
parent
466760efca
commit
af8292058f
5 changed files with 11 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue