Fix PDF reference regression
This commit is contained in:
parent
3fd2f42a50
commit
ec1a8e98cf
14
fonts.js
14
fonts.js
@ -2210,12 +2210,22 @@ var Type2CFF = (function() {
|
|||||||
|
|
||||||
var charstrings = [];
|
var charstrings = [];
|
||||||
var differences = properties.differences;
|
var differences = properties.differences;
|
||||||
|
var index = 1;
|
||||||
|
var kCmapGlyphOffset = 0xE000;
|
||||||
for (var i = 1; i < charsets.length; i++) {
|
for (var i = 1; i < charsets.length; i++) {
|
||||||
var glyph = charsets[i];
|
var glyph = charsets[i];
|
||||||
|
for (var j = index; j < differences.length; j++) {
|
||||||
|
if (differences[j]) {
|
||||||
|
index = j;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var code = differences.indexOf(glyph);
|
var code = differences.indexOf(glyph);
|
||||||
var width = widths[code] || defaultWidth;
|
var width = widths[code] || defaultWidth;
|
||||||
properties.encoding[i] = i + 0x1F;
|
properties.encoding[index] = index + kCmapGlyphOffset;
|
||||||
charstrings.push({unicode: code + 0x1F, width: width, gid: i});
|
charstrings.push({unicode: code + kCmapGlyphOffset, width: width, gid: i});
|
||||||
|
index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// sort the array by the unicode value
|
// sort the array by the unicode value
|
||||||
|
Loading…
x
Reference in New Issue
Block a user