From ef9ef0e6542f8406f727a8cda5a7b9f61dc724c6 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 24 May 2019 10:36:07 -0600 Subject: [PATCH 1/2] Add some logging for COLR checks --- src/utils/FontManager.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/utils/FontManager.js b/src/utils/FontManager.js index b4123c6368..a54efa4384 100644 --- a/src/utils/FontManager.js +++ b/src/utils/FontManager.js @@ -28,10 +28,13 @@ async function isColrFontSupported() { return colrFontSupported; } + console.log("Checking for COLR support"); + // Firefox has supported COLR fonts since version 26 // but doesn't support the check below with content blocking enabled. if (navigator.userAgent.includes("Firefox")) { colrFontSupported = true; + console.log("Browser is Firefox - assuming COLR is supported"); return colrFontSupported; } @@ -62,12 +65,16 @@ async function isColrFontSupported() { const wait = ms => new Promise((r, j)=>setTimeout(r, ms)); await wait(500); + console.log("Drawing canvas to detect COLR support"); context.drawImage(img, 0, 0); colrFontSupported = (context.getImageData(10, 10, 1, 1).data[0] === 200); + console.log("Canvas check revealed COLR is supported? " + colrFontSupported); } catch (e) { - console.error("Couldn't load colr font", e); + console.error("Couldn't load COLR font", e); colrFontSupported = false; } + + console.log({colrFontSupported}); return colrFontSupported; } From 093de71ff8de0796b14477ad9432b0c03dc5b8e9 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 24 May 2019 10:53:24 -0600 Subject: [PATCH 2/2] Minus one log --- src/utils/FontManager.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/utils/FontManager.js b/src/utils/FontManager.js index a54efa4384..7e8fc9d67e 100644 --- a/src/utils/FontManager.js +++ b/src/utils/FontManager.js @@ -74,7 +74,6 @@ async function isColrFontSupported() { colrFontSupported = false; } - console.log({colrFontSupported}); return colrFontSupported; }