Skip to content

Commit

Permalink
Merge pull request #7390 from Snuffleupagus/issue-7180
Browse files Browse the repository at this point in the history
Add upper-case `I` as a possible space replacement fallback in `Font.spaceWidth` to improve text-selection (issue 7180)
  • Loading branch information
brendandahl authored Jun 29, 2016
2 parents e908b71 + 6a0b047 commit e2e657e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/fonts.js
Original file line number Diff line number Diff line change
Expand Up @@ -2650,7 +2650,7 @@ var Font = (function FontClosure() {
}

// trying to estimate space character width
var possibleSpaceReplacements = ['space', 'minus', 'one', 'i'];
var possibleSpaceReplacements = ['space', 'minus', 'one', 'i', 'I'];
var width;
for (var i = 0, ii = possibleSpaceReplacements.length; i < ii; i++) {
var glyphName = possibleSpaceReplacements[i];
Expand Down
1 change: 1 addition & 0 deletions test/pdfs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
!issue7020.pdf
!issue7101.pdf
!issue7115.pdf
!issue7180.pdf
!issue7200.pdf
!issue7229.pdf
!filled-background.pdf
Expand Down
Binary file added test/pdfs/issue7180.pdf
Binary file not shown.
7 changes: 7 additions & 0 deletions test/test_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1555,6 +1555,13 @@
"link": false,
"type": "eq"
},
{ "id": "issue7180-text",
"file": "pdfs/issue7180.pdf",
"md5": "73ed92d7ca55475f1f31d1d75fee3283",
"rounds": 1,
"link": false,
"type": "text"
},
{
"id": "bug1123803",
"file": "pdfs/bug1123803.pdf",
Expand Down

0 comments on commit e2e657e

Please sign in to comment.