Normalize the font name in getBaseFontMetrics (issue 20246)#20637
Normalize the font name in getBaseFontMetrics (issue 20246)#20637timvandermeij merged 2 commits intomozilla:masterfrom
getBaseFontMetrics (issue 20246)#20637Conversation
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.
…malizeFontName` helper function
|
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 |
From: Bot.io (Linux m4)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/04a9939c7eb5852/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/198fbc4c10624d0/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/04a9939c7eb5852/output.txt Total script time: 2.79 mins
|
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/198fbc4c10624d0/output.txt Total script time: 9.02 mins
|
|
/botio browsertest |
From: Bot.io (Linux m4)ReceivedCommand cmd_browsertest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/3900ea266732680/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_browsertest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/1bfe4efe8a5185c/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/3900ea266732680/output.txt Total script time: 19.07 mins
Image differences available at: http://54.241.84.105:8877/3900ea266732680/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/1bfe4efe8a5185c/output.txt Total script time: 34.49 mins
Image differences available at: http://54.193.163.58:8877/1bfe4efe8a5185c/reftest-analyzer.html#web=eq.log |
|
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/
|
|
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 1 Live output at: http://54.241.84.105:8877/b3312150911f017/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/b3312150911f017/output.txt Total script time: 1.06 mins Published |
|
Thank you for fixing this! /botio makeref |
From: Bot.io (Linux m4)ReceivedCommand cmd_makeref from @timvandermeij received. Current queue size: 0 Live output at: http://54.241.84.105:8877/75570fd496defc8/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @timvandermeij received. Current queue size: 1 Live output at: http://54.193.163.58:8877/360b4b0cf7128d3/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/75570fd496defc8/output.txt Total script time: 18.67 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.193.163.58:8877/360b4b0cf7128d3/output.txt Total script time: 34.55 mins
|

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.