// Wrap the CFF data inside an OTF font file
data = this.convert(name, cff, properties);
- writeToFile(data, "/tmp/" + name + ".otf");
break;
case 'TrueType':
var charstrings = [];
var differences = properties.differences;
- var index = 1;
+ var index = 0;
var kCmapGlyphOffset = 0xE000;
for (var i = 1; i < charsets.length; i++) {
var glyph = charsets[i];
}
var code = differences.indexOf(glyph);
+ if (code == -1)
+ code = properties.glyphs[glyph] || index;
+
var width = widths[code] || defaultWidth;
properties.encoding[index] = index + kCmapGlyphOffset;
charstrings.push({unicode: code + kCmapGlyphOffset, width: width, gid: i});