mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
XFA - Match font family correctly
- partial fix for https://bugzilla.mozilla.org/show_bug.cgi?id=1716980; - some pdf can contain an invalid font family (e.g. 'Windings 3') so in this case remove the space; - the font family in typeface attribute doesn't always match the one defined in the FontDescriptor dictionary.
This commit is contained in:
parent
248efb16a7
commit
7cdbc98716
13 changed files with 221 additions and 57 deletions
|
@ -836,6 +836,7 @@ function createNameTable(name, proto) {
|
|||
class Font {
|
||||
constructor(name, file, properties) {
|
||||
this.name = name;
|
||||
this.psName = null;
|
||||
this.mimetype = null;
|
||||
this.disableFontFace = false;
|
||||
|
||||
|
@ -2730,6 +2731,7 @@ class Font {
|
|||
// ... using existing 'name' table as prototype
|
||||
const namePrototype = readNameTable(tables.name);
|
||||
tables.name.data = createNameTable(name, namePrototype);
|
||||
this.psName = namePrototype[0][6] || null;
|
||||
}
|
||||
|
||||
const builder = new OpenTypeFileBuilder(header.version);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue