1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 09:38:06 +02:00

Don't consider space as real space when there is an extra spacing (bug 931481)

- it aims to fix https://bugzilla.mozilla.org/show_bug.cgi?id=931481;
 - real space chars are pushed in the chunk but when there is an extra spacing, the next char position must be compared with the previous one;
 - for example, an extra spacing can cancel a space so visually there are no space.
This commit is contained in:
Calixte Denizet 2021-11-12 18:04:17 +01:00
parent 3a31b7ef0c
commit a88ff34eb7
4 changed files with 38 additions and 1 deletions

View file

@ -2573,7 +2573,8 @@ class PartialEvaluator {
(i === 0 ||
i + 1 === ii ||
glyphs[i - 1].unicode === " " ||
glyphs[i + 1].unicode === " ")
glyphs[i + 1].unicode === " " ||
extraSpacing)
) {
// Don't push a " " in the textContentItem
// (except when it's between two non-spaces chars),