Merge pull request #6736 from Snuffleupagus/adjustWidths
Use `adjustWidths` for TrueType fonts if we handle them as OpenType (issue 5027, issue 5084, issue 6556, bug 1204903)
This commit is contained in:
commit
a96602223f
@ -2133,6 +2133,9 @@ function reverseIfRtl(chars) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function adjustWidths(properties) {
|
function adjustWidths(properties) {
|
||||||
|
if (!properties.fontMatrix) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (properties.fontMatrix[0] === FONT_IDENTITY_MATRIX[0]) {
|
if (properties.fontMatrix[0] === FONT_IDENTITY_MATRIX[0]) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2647,6 +2650,8 @@ var Font = (function FontClosure() {
|
|||||||
// view of the sanitizer
|
// view of the sanitizer
|
||||||
data = this.checkAndRepair(name, file, properties);
|
data = this.checkAndRepair(name, file, properties);
|
||||||
if (this.isOpenType) {
|
if (this.isOpenType) {
|
||||||
|
adjustWidths(properties);
|
||||||
|
|
||||||
type = 'OpenType';
|
type = 'OpenType';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -4079,6 +4084,8 @@ var Font = (function FontClosure() {
|
|||||||
cffFile = new Stream(tables['CFF '].data);
|
cffFile = new Stream(tables['CFF '].data);
|
||||||
cff = new CFFFont(cffFile, properties);
|
cff = new CFFFont(cffFile, properties);
|
||||||
|
|
||||||
|
adjustWidths(properties);
|
||||||
|
|
||||||
return this.convert(name, cff, properties);
|
return this.convert(name, cff, properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
@ -46,6 +46,7 @@
|
|||||||
!issue6413.pdf
|
!issue6413.pdf
|
||||||
!issue4630.pdf
|
!issue4630.pdf
|
||||||
!issue4909.pdf
|
!issue4909.pdf
|
||||||
|
!issue5084.pdf
|
||||||
!issue5202.pdf
|
!issue5202.pdf
|
||||||
!issue5280.pdf
|
!issue5280.pdf
|
||||||
!issue5677.pdf
|
!issue5677.pdf
|
||||||
|
BIN
test/pdfs/issue5084.pdf
Normal file
BIN
test/pdfs/issue5084.pdf
Normal file
Binary file not shown.
@ -748,6 +748,13 @@
|
|||||||
"rounds": 1,
|
"rounds": 1,
|
||||||
"type": "eq"
|
"type": "eq"
|
||||||
},
|
},
|
||||||
|
{ "id": "issue5084",
|
||||||
|
"file": "pdfs/issue5084.pdf",
|
||||||
|
"md5": "a42a076ba90e20e3aae9af869eb4de45",
|
||||||
|
"link": false,
|
||||||
|
"rounds": 1,
|
||||||
|
"type": "eq"
|
||||||
|
},
|
||||||
{ "id": "scan-bad",
|
{ "id": "scan-bad",
|
||||||
"file": "pdfs/scan-bad.pdf",
|
"file": "pdfs/scan-bad.pdf",
|
||||||
"md5": "4cf988f01ab83f61aca57f406dfd6584",
|
"md5": "4cf988f01ab83f61aca57f406dfd6584",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user