}
var data;
- switch (properties.type) {
+ var type = properties.type;
+ switch (type) {
case 'Type1':
case 'CIDFontType0':
this.mimetype = 'font/opentype';
var subtype = properties.subtype;
- var cff = (subtype == 'Type1C' || properties.type == 'CIDFontType0') ?
+ var cff = (subtype == 'Type1C' || subtype == 'CIDFontType0C') ?
new Type2CFF(file, properties) : new CFF(name, file, properties);
// Wrap the CFF data inside an OTF font file
}
this.data = data;
- this.type = properties.type;
+ this.type = type;
this.textMatrix = properties.textMatrix;
this.defaultWidth = properties.defaultWidth;
this.loadedName = getUniqueName();
if (pos == 0 || pos == 1) {
var gid = 1;
- var baseEncoding =
- pos ? Encodings.ExpertEncoding : Encodings.StandardEncoding;
+ var baseEncoding = pos ? Encodings.ExpertEncoding.slice() :
+ Encodings.StandardEncoding.slice();
for (var i = 0; i < charset.length; i++) {
var index = baseEncoding.indexOf(charset[i]);
if (index != -1)
parseCharsets: function cff_parsecharsets(pos, length, strings) {
if (pos == 0) {
- return ISOAdobeCharset;
+ return ISOAdobeCharset.slice();
} else if (pos == 1) {
- return ExpertCharset;
+ return ExpertCharset.slice();
} else if (pos == 2) {
- return ExpertSubsetCharset;
+ return ExpertSubsetCharset.slice();
}
var bytes = this.bytes;
properties.widths = glyphsWidths;
var cidToGidMap = dict.get('CIDToGIDMap');
- if (!cidToGidMap || !IsRef(cidToGidMap))
- return GlyphsUnicode;
+ if (!cidToGidMap || !IsRef(cidToGidMap)) {
+ return Object.create(GlyphsUnicode);
+ }
// Extract the encoding from the CIDToGIDMap
var glyphsStream = xref.fetchIfRef(cidToGidMap);
'9.7.5.3');
}
}
- return GlyphsUnicode;
+ return Object.create(GlyphsUnicode);
}
var differences = properties.differences;
var map = {};
if (/^Symbol(-?(Bold|Italic))*$/.test(name)) {
// special case for symbols
- var encoding = Encodings.symbolsEncoding;
+ var encoding = Encodings.symbolsEncoding.slice();
for (var i = 0, n = encoding.length, j; i < n; i++) {
if (!(j = encoding[i]))
continue;