-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Fix how we detect and handle missing glyph data. #8580
Conversation
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @brendandahl received. Current queue size: 0 Live output at: http://54.67.70.0:8877/b3573d0a7ceda07/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @brendandahl received. Current queue size: 0 Live output at: http://54.215.176.217:8877/9bad1d590e6e492/output.txt |
From: Bot.io (Windows)FailedFull output at http://54.215.176.217:8877/9bad1d590e6e492/output.txt Total script time: 29.51 mins
Image differences available at: http://54.215.176.217:8877/9bad1d590e6e492/reftest-analyzer.html#web=eq.log |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/b3573d0a7ceda07/output.txt Total script time: 60.00 mins |
/botio-linux test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @brendandahl received. Current queue size: 0 Live output at: http://54.67.70.0:8877/0ed859f6e25b17d/output.txt |
I didn't see any failure locally (on macOS), but it looks like things have changed (for the worse) on windows. I'm guessing more glyphs are in the private use area not using the CJK shaper, but I'll have to look into it. |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/0ed859f6e25b17d/output.txt Total script time: 16.54 mins
Image differences available at: http://54.67.70.0:8877/0ed859f6e25b17d/reftest-analyzer.html#web=eq.log |
One additional data-point, in case it's helpful: I ran the full test-suite locally on Windows 7 (in Firefox Nightly 56), and I didn't notice any failures locally either. |
src/core/fonts.js
Outdated
@@ -834,6 +834,7 @@ var Font = (function FontClosure() { | |||
if ((usedFontCharCodes[fontCharCode] !== undefined || | |||
isProblematicUnicodeLocation(fontCharCode) || | |||
(isSymbolic && !hasUnicodeValue)) && | |||
!missingGlyphs[glyphId] && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just asking, and it might be a totally pointless micro-optimization, but would it make sense (at all) to check !missingGlyphs[glyphId]
first in this condition? I.e. instead do:
if (!missingGlyphs[glyphId] &&
(usedFontCharCodes[fontCharCode] !== undefined ||
isProblematicUnicodeLocation(fontCharCode) ||
(isSymbolic && !hasUnicodeValue)) &&
nextAvailableFontCharCode <= PRIVATE_USE_OFFSET_END) { // Room left.
The reason that I'm asking is that we could then avoid pointless isProblematicUnicodeLocation
function calls when we know that a glyph
is missing, since I'm assuming that it's cheaper to lookup missingGlyphs[glyphId]
than it's to call a function?
Again, this might be a completely unnecessary change, but I figured it can't hurt to ask!
Edit: If nothing else, it will help improve my understanding of these things :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it depends on a number of things and would really need to be benchmarked, but I don't thing this code is particularly hot, so it's not really worth worrying about it. I've updated it to be first though.
Looks like the windows failures may be a firefox update since the refs failed over in #8585 (comment) |
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @brendandahl received. Current queue size: 0 Live output at: http://54.67.70.0:8877/6d0b994bd5d9a33/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @brendandahl received. Current queue size: 0 Live output at: http://54.215.176.217:8877/f18d8ce6030aa74/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/6d0b994bd5d9a33/output.txt Total script time: 16.52 mins
Image differences available at: http://54.67.70.0:8877/6d0b994bd5d9a33/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.215.176.217:8877/f18d8ce6030aa74/output.txt Total script time: 29.18 mins
Image differences available at: http://54.215.176.217:8877/f18d8ce6030aa74/reftest-analyzer.html#web=eq.log |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a really nice improvement, not to mention simplification, of the way we detect missing glyphs.
This makes a lot more sense than the old hacks (that I added); thanks for doing this!
/botio makeref |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.215.176.217:8877/fe3d0ee9524daaa/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_makeref from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/bcbdfcc542acc37/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/bcbdfcc542acc37/output.txt Total script time: 15.64 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.215.176.217:8877/fe3d0ee9524daaa/output.txt Total script time: 27.11 mins
|
Fix how we detect and handle missing glyph data.
I had started looking at #8255 awhile back, but after seeing @Snuffleupagus pr #8572 I realized what was going on.
This fixes a couple of things:
Fixes #8255.
Fixes #8570.
Fixes #7696.