Merge pull request #9938 from Snuffleupagus/issue-9915
Ensure that Type0, i.e. composite, OpenType fonts with `CFF ` tables are *not* treated as CFF fonts if their glyph mapping is non-default (issue 9915)
This commit is contained in:
commit
716acf63d4
@ -16,8 +16,8 @@
|
|||||||
import {
|
import {
|
||||||
AbortException, assert, CMapCompressionType, createPromiseCapability,
|
AbortException, assert, CMapCompressionType, createPromiseCapability,
|
||||||
FONT_IDENTITY_MATRIX, FormatError, getLookupTableFactory, IDENTITY_MATRIX,
|
FONT_IDENTITY_MATRIX, FormatError, getLookupTableFactory, IDENTITY_MATRIX,
|
||||||
info, isNum, isString, NativeImageDecoding, OPS, TextRenderingMode,
|
info, isNum, isString, NativeImageDecoding, OPS, stringToPDFString,
|
||||||
UNSUPPORTED_FEATURES, Util, warn
|
TextRenderingMode, UNSUPPORTED_FEATURES, Util, warn
|
||||||
} from '../shared/util';
|
} from '../shared/util';
|
||||||
import { CMapFactory, IdentityCMap } from './cmap';
|
import { CMapFactory, IdentityCMap } from './cmap';
|
||||||
import { DecodeStream, Stream } from './stream';
|
import { DecodeStream, Stream } from './stream';
|
||||||
@ -1871,8 +1871,8 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|||||||
var cidSystemInfo = dict.get('CIDSystemInfo');
|
var cidSystemInfo = dict.get('CIDSystemInfo');
|
||||||
if (isDict(cidSystemInfo)) {
|
if (isDict(cidSystemInfo)) {
|
||||||
properties.cidSystemInfo = {
|
properties.cidSystemInfo = {
|
||||||
registry: cidSystemInfo.get('Registry'),
|
registry: stringToPDFString(cidSystemInfo.get('Registry')),
|
||||||
ordering: cidSystemInfo.get('Ordering'),
|
ordering: stringToPDFString(cidSystemInfo.get('Ordering')),
|
||||||
supplement: cidSystemInfo.get('Supplement'),
|
supplement: cidSystemInfo.get('Supplement'),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,7 @@ import {
|
|||||||
getUnicodeForGlyph, getUnicodeRangeFor, mapSpecialUnicodeValues
|
getUnicodeForGlyph, getUnicodeRangeFor, mapSpecialUnicodeValues
|
||||||
} from './unicode';
|
} from './unicode';
|
||||||
import { FontRendererFactory } from './font_renderer';
|
import { FontRendererFactory } from './font_renderer';
|
||||||
|
import { IdentityCMap } from './cmap';
|
||||||
import { Stream } from './stream';
|
import { Stream } from './stream';
|
||||||
import { Type1Parser } from './type1_parser';
|
import { Type1Parser } from './type1_parser';
|
||||||
|
|
||||||
@ -2308,9 +2309,11 @@ var Font = (function FontClosure() {
|
|||||||
|
|
||||||
var isTrueType = !tables['CFF '];
|
var isTrueType = !tables['CFF '];
|
||||||
if (!isTrueType) {
|
if (!isTrueType) {
|
||||||
// OpenType font (skip composite fonts with non-default CID to GID map).
|
const isComposite = properties.composite &&
|
||||||
if ((header.version === 'OTTO' &&
|
((properties.cidToGidMap || []).length > 0 ||
|
||||||
!(properties.composite && properties.cidToGidMap)) ||
|
!(properties.cMap instanceof IdentityCMap));
|
||||||
|
// OpenType font (skip composite fonts with non-default glyph mapping).
|
||||||
|
if ((header.version === 'OTTO' && !isComposite) ||
|
||||||
!tables['head'] || !tables['hhea'] || !tables['maxp'] ||
|
!tables['head'] || !tables['hhea'] || !tables['maxp'] ||
|
||||||
!tables['post']) {
|
!tables['post']) {
|
||||||
// No major tables: throwing everything at `CFFFont`.
|
// No major tables: throwing everything at `CFFFont`.
|
||||||
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
@ -70,6 +70,7 @@
|
|||||||
!issue9291.pdf
|
!issue9291.pdf
|
||||||
!issue9418.pdf
|
!issue9418.pdf
|
||||||
!issue9458.pdf
|
!issue9458.pdf
|
||||||
|
!issue9915_reduced.pdf
|
||||||
!bad-PageLabels.pdf
|
!bad-PageLabels.pdf
|
||||||
!decodeACSuccessive.pdf
|
!decodeACSuccessive.pdf
|
||||||
!filled-background.pdf
|
!filled-background.pdf
|
||||||
|
BIN
test/pdfs/issue9915_reduced.pdf
Normal file
BIN
test/pdfs/issue9915_reduced.pdf
Normal file
Binary file not shown.
@ -1339,6 +1339,13 @@
|
|||||||
"link": false,
|
"link": false,
|
||||||
"type": "eq"
|
"type": "eq"
|
||||||
},
|
},
|
||||||
|
{ "id": "issue9915",
|
||||||
|
"file": "pdfs/issue9915_reduced.pdf",
|
||||||
|
"md5": "c56dabe5066a6c821901920e09dffe00",
|
||||||
|
"rounds": 1,
|
||||||
|
"link": false,
|
||||||
|
"type": "eq"
|
||||||
|
},
|
||||||
{ "id": "issue8570",
|
{ "id": "issue8570",
|
||||||
"file": "pdfs/issue8570.pdf",
|
"file": "pdfs/issue8570.pdf",
|
||||||
"md5": "0355731adb72df233eaa10464dcc8c51",
|
"md5": "0355731adb72df233eaa10464dcc8c51",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user