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:
parent
8763002c44
commit
c7aec8ac8a
2 changed files with 25 additions and 0 deletions
12
fonts.js
12
fonts.js
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue