var cff = new CFF(name, file, properties);
}
+ var widths = properties.glyphWidths;
+ if (widths) {
+ var charstrings = cff.charstrings;
+ for (var i = 0, ii = charstrings.length; i < ii; ++i) {
+ var charstring = charstrings[i];
+ var unicode = charstring.unicode;
+ var width = widths[unicode];
+ if (width)
+ charstring.width = width;
+ }
+ }
+
// Wrap the CFF data inside an OTF font file
data = this.convert(name, cff, properties);
break;
fileType = fileType.name;
}
+ var widths = fontDict.get('Widths');
+ var firstChar = fontDict.get('FirstChar');
+ var lastChar = fontDict.get('LastChar');
+ if (widths) {
+ var glyphWidths = [];
+ for (var i = 0; i < firstChar; ++i)
+ glyphWidths.push(0);
+
+ for (var i = 0, ii = widths.length; i < ii; ++i)
+ glyphWidths.push(widths[i]);
+ }
+
var properties = {
type: subType.name,
subtype: fileType,
+ glyphWidths: glyphWidths,
encoding: encodingMap,
charset: charset,
firstChar: fontDict.get('FirstChar'),