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

Use Calibri and Lucida Console, when it's possible, in place of sans-serif and monospaced (bug 1922063) #18844

Merged
merged 1 commit into from
Oct 6, 2024

Conversation

calixteman
Copy link
Contributor

A recent change in Firefox induced too much difference between the text widths computed in using a Canvas and the ones computed by the text layout engine when rendering the text layer. Consequently, the text selection can be bad on Windows with some fonts like Arial or Consolas. This patch is a workaround to try to use in first place some fonts which don't have the problem.

@Snuffleupagus
Copy link
Collaborator

Snuffleupagus commented Oct 3, 2024

Can we work-around this in src/display/text_layer.js instead, since this feels like the wrong place given that this affects the API in general (it's basically a breaking change) and may thus cause problems elsewhere?

@Snuffleupagus Snuffleupagus added the release-blocker Blocker for the upcoming release label Oct 5, 2024
@Snuffleupagus
Copy link
Collaborator

Having this as a temporary work-around probably can't hurt, assuming it passes all tests of course, however since it's a browser regression it would be even better if it can be fixed there instead.

As-is this would still affect older PDF.js versions once the regressing code-change reaches Firefox Release, and it'd likely lead to numerous (future) bug-reports about this problem here at GitHub.

(Tentatively setting the release-blocker label, since if this is something we want it probably should be included in the upcoming release.)

@timvandermeij
Copy link
Contributor

/botio test

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.241.84.105:8877/d06001f09481c5c/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

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

Live output at: http://54.193.163.58:8877/6ea4fef84bd8802/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/d06001f09481c5c/output.txt

Total script time: 31.73 mins

  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 97
  different first/second rendering: 1

Image differences available at: http://54.241.84.105:8877/d06001f09481c5c/reftest-analyzer.html#web=eq.log

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/6ea4fef84bd8802/output.txt

Total script time: 47.44 mins

  • Unit tests: Passed
  • Integration Tests: FAILED
  • Regression tests: FAILED
  different ref/snapshot: 94

Image differences available at: http://54.193.163.58:8877/6ea4fef84bd8802/reftest-analyzer.html#web=eq.log

Copy link
Contributor

@timvandermeij timvandermeij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, with the comment below addressed. Especially if the scope of this workaround is reduced I'm fine with including this and making the release directly afterwards if the impact of this issue is deemed large enough.

src/display/text_layer.js Show resolved Hide resolved
@calixteman
Copy link
Contributor Author

/botio test

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.241.84.105:8877/a6f16a2b6f009d3/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

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

Live output at: http://54.193.163.58:8877/ac135e3951e421f/output.txt

src/shared/util.js Outdated Show resolved Hide resolved
src/shared/util.js Outdated Show resolved Hide resolved
@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/a6f16a2b6f009d3/output.txt

Total script time: 31.60 mins

  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 15
  different first/second rendering: 1

Image differences available at: http://54.241.84.105:8877/a6f16a2b6f009d3/reftest-analyzer.html#web=eq.log

…serif and monospaced (bug 1922063)

A recent change in Firefox induced too much difference between the text widths computed in using a Canvas
and the ones computed by the text layout engine when rendering the text layer. Consequently, the
text selection can be bad on Windows with some fonts like Arial or Consolas.
This patch is a workaround to try to use in first place some fonts which don't have the problem.
@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/ac135e3951e421f/output.txt

Total script time: 47.17 mins

  • Unit tests: Passed
  • Integration Tests: FAILED
  • Regression tests: FAILED
  different ref/snapshot: 94

Image differences available at: http://54.193.163.58:8877/ac135e3951e421f/reftest-analyzer.html#web=eq.log

@timvandermeij
Copy link
Contributor

/botio test

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.241.84.105:8877/9e3e1a84c4c88da/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

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

Live output at: http://54.193.163.58:8877/7af02adb706f02a/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/9e3e1a84c4c88da/output.txt

Total script time: 31.51 mins

  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 16

Image differences available at: http://54.241.84.105:8877/9e3e1a84c4c88da/reftest-analyzer.html#web=eq.log

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/7af02adb706f02a/output.txt

Total script time: 48.25 mins

  • Unit tests: Passed
  • Integration Tests: FAILED
  • Regression tests: FAILED
  different ref/snapshot: 93

Image differences available at: http://54.193.163.58:8877/7af02adb706f02a/reftest-analyzer.html#web=eq.log

@timvandermeij timvandermeij merged commit 8b73b82 into mozilla:master Oct 6, 2024
8 checks passed
@timvandermeij
Copy link
Contributor

Thank you for the patch!

/botio makeref

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.241.84.105:8877/5ba50208d9af880/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

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

Live output at: http://54.193.163.58:8877/6cc4680a28e0331/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/5ba50208d9af880/output.txt

Total script time: 20.47 mins

  • Make references: Passed
  • Check references: Passed

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/6cc4680a28e0331/output.txt

Total script time: 25.98 mins

  • Make references: Passed
  • Check references: Passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
font-conversion release-blocker Blocker for the upcoming release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants