Address yury's review comments
This commit is contained in:
parent
658c6936fc
commit
47809fe316
@ -510,6 +510,8 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|||||||
getTextContent: function partialEvaluatorGetIRQueue(
|
getTextContent: function partialEvaluatorGetIRQueue(
|
||||||
stream, resources, state) {
|
stream, resources, state) {
|
||||||
var bidiTexts;
|
var bidiTexts;
|
||||||
|
var kSpaceFactor = 0.35;
|
||||||
|
var kMultipleSpaceFactor = 1.5;
|
||||||
|
|
||||||
if (!state) {
|
if (!state) {
|
||||||
bidiTexts = [];
|
bidiTexts = [];
|
||||||
@ -552,12 +554,12 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|||||||
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 fakeSpaces = -items[j] / font.spaceWidth;
|
var fakeSpaces = -items[j] / font.spaceWidth;
|
||||||
if (fakeSpaces > 1.5) {
|
if (fakeSpaces > kMultipleSpaceFactor) {
|
||||||
fakeSpaces = Math.round(fakeSpaces);
|
fakeSpaces = Math.round(fakeSpaces);
|
||||||
while (fakeSpaces--) {
|
while (fakeSpaces--) {
|
||||||
chunk += ' ';
|
chunk += ' ';
|
||||||
}
|
}
|
||||||
} else if (-items[j] / font.spaceWidth > 0.35) {
|
} else if (fakeSpaces > kSpaceFactor) {
|
||||||
chunk += ' ';
|
chunk += ' ';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user