Skip to content

Normalize the font name in getBaseFontMetrics (issue 20246)#20637

Merged
timvandermeij merged 2 commits intomozilla:masterfrom
Snuffleupagus:issue-20246
Feb 8, 2026
Merged

Normalize the font name in getBaseFontMetrics (issue 20246)#20637
timvandermeij merged 2 commits intomozilla:masterfrom
Snuffleupagus:issue-20246

Conversation

@Snuffleupagus
Copy link
Collaborator

We tried to lookup the font metrics using the font name as-is, which didn't work since the PDF file in question has non-embedded fonts with names that include commas.
Hence the font names need to be normalized here as well, similar to elsewhere in the font code.

We tried to lookup the font metrics using the font name as-is, which didn't work since the PDF file in question has non-embedded fonts with names that include commas.
Hence the font names need to be normalized here as well, similar to elsewhere in the font code.
@Snuffleupagus
Copy link
Collaborator Author

Please note: This was throw together very quickly and it's completely untested. If it breaks something I'm unlikely to spend any more time trying to fix this.

/botio unittest
/botio browsertest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.241.84.105:8877/04a9939c7eb5852/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

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

Live output at: http://54.193.163.58:8877/198fbc4c10624d0/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/04a9939c7eb5852/output.txt

Total script time: 2.79 mins

  • Unit Tests: Passed

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/198fbc4c10624d0/output.txt

Total script time: 9.02 mins

  • Unit Tests: FAILED

@Snuffleupagus
Copy link
Collaborator Author

/botio browsertest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.241.84.105:8877/3900ea266732680/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

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

Live output at: http://54.193.163.58:8877/1bfe4efe8a5185c/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/3900ea266732680/output.txt

Total script time: 19.07 mins

  • Regression tests: FAILED
  different ref/snapshot: 2

Image differences available at: http://54.241.84.105:8877/3900ea266732680/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/1bfe4efe8a5185c/output.txt

Total script time: 34.49 mins

  • Regression tests: FAILED
  different ref/snapshot: 2

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

@Snuffleupagus
Copy link
Collaborator Author

Snuffleupagus commented Feb 8, 2026

The test movement looks like an improvement, since that font should be Times-Roman and previously wasn't correctly recognized as such (in the textLayer) because of the spaces; note https://brendandahl.github.io/pdf.js.utils/browser/

spaces

@Snuffleupagus Snuffleupagus linked an issue Feb 8, 2026 that may be closed by this pull request
Copy link
Contributor

@calixteman calixteman left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you.

@timvandermeij
Copy link
Contributor

/botio-linux preview

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 1

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

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

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

Total script time: 1.06 mins

Published

@timvandermeij timvandermeij merged commit 2a2806d into mozilla:master Feb 8, 2026
11 checks passed
@timvandermeij
Copy link
Contributor

Thank you for fixing this!

/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/75570fd496defc8/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

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

Live output at: http://54.193.163.58:8877/360b4b0cf7128d3/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/75570fd496defc8/output.txt

Total script time: 18.67 mins

  • Make references: Passed
  • Check references: Passed

@Snuffleupagus Snuffleupagus deleted the issue-20246 branch February 8, 2026 19:19
@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/360b4b0cf7128d3/output.txt

Total script time: 34.55 mins

  • Make references: Passed
  • Check references: Passed

@Snuffleupagus Snuffleupagus restored the issue-20246 branch February 8, 2026 21:29
@Snuffleupagus Snuffleupagus deleted the issue-20246 branch February 8, 2026 21:29
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.

[Bug]: Text and numbers not properly aligned

4 participants