|
|
@ -411,7 +411,7 @@ var Font = (function Font() { |
|
|
|
this.encoding = properties.encoding; |
|
|
|
this.encoding = properties.encoding; |
|
|
|
this.sizes = []; |
|
|
|
this.sizes = []; |
|
|
|
|
|
|
|
|
|
|
|
var names = name.split("+"); |
|
|
|
var names = name.split('+'); |
|
|
|
names = names.length > 1 ? names[1] : names[0]; |
|
|
|
names = names.length > 1 ? names[1] : names[0]; |
|
|
|
names = names.split(/[-,_]/g)[0]; |
|
|
|
names = names.split(/[-,_]/g)[0]; |
|
|
|
this.serif = serifFonts[names] || (name.search(/serif/gi) != -1); |
|
|
|
this.serif = serifFonts[names] || (name.search(/serif/gi) != -1); |
|
|
@ -448,8 +448,8 @@ var Font = (function Font() { |
|
|
|
this.mimetype = 'font/opentype'; |
|
|
|
this.mimetype = 'font/opentype'; |
|
|
|
|
|
|
|
|
|
|
|
var subtype = properties.subtype; |
|
|
|
var subtype = properties.subtype; |
|
|
|
var cff = (subtype === 'Type1C') ? new Type2CFF(file, properties) |
|
|
|
var cff = (subtype === 'Type1C') ? |
|
|
|
: new CFF(name, file, properties); |
|
|
|
new Type2CFF(file, properties) : new CFF(name, file, properties); |
|
|
|
|
|
|
|
|
|
|
|
// Wrap the CFF data inside an OTF font file
|
|
|
|
// Wrap the CFF data inside an OTF font file
|
|
|
|
data = this.convert(name, cff, properties); |
|
|
|
data = this.convert(name, cff, properties); |
|
|
@ -875,7 +875,7 @@ var Font = (function Font() { |
|
|
|
// Check that table are sorted by platformID then encodingID,
|
|
|
|
// Check that table are sorted by platformID then encodingID,
|
|
|
|
records.sort(function(a, b) { |
|
|
|
records.sort(function(a, b) { |
|
|
|
return ((a.platformID << 16) + a.encodingID) - |
|
|
|
return ((a.platformID << 16) + a.encodingID) - |
|
|
|
((b.platformID << 16) + b.encodingID) |
|
|
|
((b.platformID << 16) + b.encodingID); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
var tables = [records[0]]; |
|
|
|
var tables = [records[0]]; |
|
|
@ -2340,7 +2340,8 @@ var Type2CFF = (function() { |
|
|
|
return charstrings; |
|
|
|
return charstrings; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
parseEncoding: function cff_parseencoding(pos, properties, strings, charset) { |
|
|
|
parseEncoding: function cff_parseencoding(pos, properties, strings, |
|
|
|
|
|
|
|
charset) { |
|
|
|
var encoding = {}; |
|
|
|
var encoding = {}; |
|
|
|
var bytes = this.bytes; |
|
|
|
var bytes = this.bytes; |
|
|
|
|
|
|
|
|
|
|
@ -2355,8 +2356,8 @@ var Type2CFF = (function() { |
|
|
|
|
|
|
|
|
|
|
|
if (pos == 0 || pos == 1) { |
|
|
|
if (pos == 0 || pos == 1) { |
|
|
|
var gid = 1; |
|
|
|
var gid = 1; |
|
|
|
var baseEncoding = pos ? Encodings.ExpertEncoding |
|
|
|
var baseEncoding = |
|
|
|
: Encodings.StandardEncoding; |
|
|
|
pos ? Encodings.ExpertEncoding : Encodings.StandardEncoding; |
|
|
|
for (var i = 0; i < charset.length; i++) { |
|
|
|
for (var i = 0; i < charset.length; i++) { |
|
|
|
var index = baseEncoding.indexOf(charset[i]); |
|
|
|
var index = baseEncoding.indexOf(charset[i]); |
|
|
|
if (index != -1) |
|
|
|
if (index != -1) |
|
|
@ -2393,7 +2394,7 @@ var Type2CFF = (function() { |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
default: |
|
|
|
default: |
|
|
|
error('Unknow encoding format: ' + format + " in CFF"); |
|
|
|
error('Unknow encoding format: ' + format + ' in CFF'); |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|