Tune whitespace insertion
This commit is contained in:
parent
e98eba1b11
commit
658c6936fc
@ -551,8 +551,13 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|||||||
if (typeof items[j] === 'string') {
|
if (typeof items[j] === 'string') {
|
||||||
chunk += fontCharsToUnicode(items[j], font);
|
chunk += fontCharsToUnicode(items[j], font);
|
||||||
} else if (items[j] < 0 && font.spaceWidth > 0) {
|
} else if (items[j] < 0 && font.spaceWidth > 0) {
|
||||||
var numFakeSpaces = Math.round(-items[j] / font.spaceWidth);
|
var fakeSpaces = -items[j] / font.spaceWidth;
|
||||||
if (numFakeSpaces > 0) {
|
if (fakeSpaces > 1.5) {
|
||||||
|
fakeSpaces = Math.round(fakeSpaces);
|
||||||
|
while (fakeSpaces--) {
|
||||||
|
chunk += ' ';
|
||||||
|
}
|
||||||
|
} else if (-items[j] / font.spaceWidth > 0.35) {
|
||||||
chunk += ' ';
|
chunk += ' ';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user