mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 14:48:08 +02:00
Merge pull request #18324 from calixteman/bug1539074_1
Fix the computation of unitsPerEm when the fontMatrix has some negative coefficients
This commit is contained in:
commit
4899b2ea07
4 changed files with 10 additions and 2 deletions
|
@ -799,7 +799,7 @@ function createOS2Table(properties, charstrings, override) {
|
|||
const unitsPerEm =
|
||||
override.unitsPerEm ||
|
||||
(properties.fontMatrix
|
||||
? 1 / Math.max(...properties.fontMatrix.slice(0, 4))
|
||||
? 1 / Math.max(...properties.fontMatrix.slice(0, 4).map(Math.abs))
|
||||
: 1000);
|
||||
|
||||
// if the font units differ to the PDF glyph space units
|
||||
|
@ -3199,7 +3199,7 @@ class Font {
|
|||
}
|
||||
|
||||
const unitsPerEm = properties.fontMatrix
|
||||
? 1 / Math.max(...properties.fontMatrix.slice(0, 4))
|
||||
? 1 / Math.max(...properties.fontMatrix.slice(0, 4).map(Math.abs))
|
||||
: 1000;
|
||||
|
||||
const builder = new OpenTypeFileBuilder("\x4F\x54\x54\x4F");
|
||||
|
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
|
@ -650,3 +650,4 @@
|
|||
!issue17998.pdf
|
||||
!pdfjs_wikipedia.pdf
|
||||
!bug1539074.pdf
|
||||
!bug1539074.1.pdf
|
||||
|
|
BIN
test/pdfs/bug1539074.1.pdf
Executable file
BIN
test/pdfs/bug1539074.1.pdf
Executable file
Binary file not shown.
|
@ -10098,6 +10098,13 @@
|
|||
"rounds": 1,
|
||||
"type": "eq"
|
||||
},
|
||||
{
|
||||
"id": "bug1539074_1",
|
||||
"file": "pdfs/bug1539074.1.pdf",
|
||||
"md5": "d15c49142fda433323d3d35f2762cd33",
|
||||
"rounds": 1,
|
||||
"type": "eq"
|
||||
},
|
||||
{
|
||||
"id": "bug1903731",
|
||||
"file": "pdfs/bug1903731.pdf",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue