1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Only special-case OpenType fonts with CFF data if it's both a composite (i.e. Type0) font and also has a non-default CID to GID map (issue 8480)

*As mentioned the last time that I touched this particular part of the font code, I'm sincerely hope that this doesn't cause any regressions!*

However, the patch passes all tests added in PRs 5770, 6270, and 7904 (and obviously all other tests as well). Furthermore, I've manually checked all the issues/bugs referenced in those PRs without finding any issues.

Fixes 8480.
This commit is contained in:
Jonas Jenwald 2017-06-09 18:51:31 +02:00
parent 999e30723d
commit 8b4a42e5b8
4 changed files with 12 additions and 3 deletions

View file

@ -2144,11 +2144,12 @@ var Font = (function FontClosure() {
var isTrueType = !tables['CFF '];
if (!isTrueType) {
// OpenType font
if ((header.version === 'OTTO' && !properties.composite) ||
// OpenType font (skip composite fonts with non-default CID to GID map).
if ((header.version === 'OTTO' &&
!(properties.composite && properties.cidToGidMap)) ||
!tables['head'] || !tables['hhea'] || !tables['maxp'] ||
!tables['post']) {
// no major tables: throwing everything at CFFFont
// No major tables: throwing everything at `CFFFont`.
cffFile = new Stream(tables['CFF '].data);
cff = new CFFFont(cffFile, properties);