mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Tune whitespace insertion
This commit is contained in:
parent
e98eba1b11
commit
658c6936fc
1 changed files with 7 additions and 2 deletions
|
@ -551,8 +551,13 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|||
if (typeof items[j] === 'string') {
|
||||
chunk += fontCharsToUnicode(items[j], font);
|
||||
} else if (items[j] < 0 && font.spaceWidth > 0) {
|
||||
var numFakeSpaces = Math.round(-items[j] / font.spaceWidth);
|
||||
if (numFakeSpaces > 0) {
|
||||
var fakeSpaces = -items[j] / font.spaceWidth;
|
||||
if (fakeSpaces > 1.5) {
|
||||
fakeSpaces = Math.round(fakeSpaces);
|
||||
while (fakeSpaces--) {
|
||||
chunk += ' ';
|
||||
}
|
||||
} else if (-items[j] / font.spaceWidth > 0.35) {
|
||||
chunk += ' ';
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue