1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00

used width info in fontDict

This commit is contained in:
sbarman 2011-07-20 12:57:47 -07:00
parent 8763002c44
commit c7aec8ac8a
2 changed files with 25 additions and 0 deletions

View file

@ -399,6 +399,18 @@ var Font = (function() {
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;