Skip to content

Commit

Permalink
Fix issues in text selection
Browse files Browse the repository at this point in the history
  - PR #13257 fixed a lot of issues but not all and this patch aims to fix almost all remaining issues.
  - the idea in this new patch is to compare position of new glyph with the last position where a glyph has been drawn;
    - no space are "drawn": it just moves the cursor but they aren't added in the chunk;
    - so this way a space followed by a cursor move can be treated as only one space: it helps to merge all spaces into one.
  - to make difference between real spaces and tracking ones, we used a factor of the space width (from the font)
    - it was a pretty good idea in general but it fails with some fonts where space was too big:
    - in Poppler, they're using a factor of the font size: this is an excellent idea (<= 0.1 * fontSize implies tracking space).
  • Loading branch information
calixteman committed May 29, 2021
1 parent 3538ef0 commit fe968b1
Show file tree
Hide file tree
Showing 11 changed files with 236 additions and 132 deletions.
1 change: 1 addition & 0 deletions src/core/document.js
Expand Up @@ -436,6 +436,7 @@ class Page {
includeMarkedContent,
combineTextItems,
sink,
rotate: this.rotate,
});
});
}
Expand Down

0 comments on commit fe968b1

Please sign in to comment.