Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add upper-case I as a possible space replacement fallback in Font.spaceWidth to improve text-selection (issue 7180) #7390

Merged
merged 1 commit into from
Jun 29, 2016

Conversation

Snuffleupagus
Copy link
Collaborator

In fonts with only upper-case glyphs, that are also missing a space glyph, get spaceWidth won't be able to return anything useful.
By adding upper-case I as a fallback, we can thus improve text-selection in some PDF files.
Note that locally, the patch causes slight movement in a few existing text tests, but in my opinion this actually looks like slight improvements.

Fixes #7180.

…spaceWidth` to improve text-selection (issue 7180)

In fonts with only upper-case glyphs, that are also missing a space glyph, `get spaceWidth` won't be able to return anything useful.
By adding upper-case `I` as a fallback, we can thus improve text-selection in some PDF files.
Note that locally, the patch causes slight movement in a few existing `text` tests, but in my opinion this actually looks like slight improvements.

Fixes 7180.
@Snuffleupagus
Copy link
Collaborator Author

/botio test

@pdfjsbot
Copy link

pdfjsbot commented Jun 8, 2016

From: Bot.io (Windows)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://107.22.172.223:8877/4cdab74f6238304/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Jun 8, 2016

From: Bot.io (Linux)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://107.21.233.14:8877/119de8c1e4ac4bd/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Jun 8, 2016

From: Bot.io (Windows)


Failed

Full output at http://107.22.172.223:8877/4cdab74f6238304/output.txt

Total script time: 21.11 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: FAILED

Image differences available at: http://107.22.172.223:8877/4cdab74f6238304/reftest-analyzer.html#web=eq.log

@pdfjsbot
Copy link

pdfjsbot commented Jun 8, 2016

From: Bot.io (Linux)


Failed

Full output at http://107.21.233.14:8877/119de8c1e4ac4bd/output.txt

Total script time: 27.57 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: FAILED

Image differences available at: http://107.21.233.14:8877/119de8c1e4ac4bd/reftest-analyzer.html#web=eq.log

@brendandahl
Copy link
Contributor

/botio makeref

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_makeref from @brendandahl received. Current queue size: 0

Live output at: http://107.22.172.223:8877/8042998041752eb/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_makeref from @brendandahl received. Current queue size: 0

Live output at: http://107.21.233.14:8877/7d26cc5960f3765/output.txt

@brendandahl
Copy link
Contributor

@Snuffleupagus Another thought for a different PR: maybe instead of relying on 'i' or 'I' we should just take the first non-zero width if all the others fail?

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://107.22.172.223:8877/8042998041752eb/output.txt

Total script time: 22.48 mins

  • Lint: Passed
  • Make references: Passed
  • Check references: Passed

@pdfjsbot
Copy link

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/7d26cc5960f3765/output.txt

Total script time: 26.99 mins

  • Lint: Passed
  • Make references: Passed
  • Check references: Passed

@brendandahl brendandahl merged commit e2e657e into mozilla:master Jun 29, 2016
@Snuffleupagus Snuffleupagus deleted the issue-7180 branch June 30, 2016 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants