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 particular code-path has been the source of *numerous* regressions to date, so hopefully this patch won't cause any more of those. Fixes 9915.
This commit is contained in:
parent
cfdb597e4a
commit
17eac2d48a
@ -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`.
|
||||||
|
Loading…
Reference in New Issue
Block a user