// merge in the differences
var firstChar = properties.firstChar;
var lastChar = properties.lastChar;
+ var widths = properties.widths || [];
var glyphs = {};
for (var i = firstChar; i <= lastChar; i++) {
- var glyph = differences[i] || baseEncoding[i];
+ var glyph = differences[i];
+ if (!glyph) {
+ glyph = baseEncoding[i];
+ // skipping already specified by difference glyphs
+ if (differences.indexOf(glyph) >= 0)
+ continue;
+ }
var index = GlyphsUnicode[glyph] || i;
- var width = properties.widths[i] || properties.widths[glyph];
+ var width = widths[i] || widths[glyph];
map[i] = {
unicode: index,
width: IsNum(width) ? width : properties.defaultWidth