From 11828c40e546a5a1485857b37c1aab6d7731eba9 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Wed, 22 May 2019 16:22:18 +0100 Subject: [PATCH] Add more weight of emoji font For at least Chrome on Windows 10, we need to explicitly add additional weights for emoji to appear when bold. --- src/utils/FontManager.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/utils/FontManager.js b/src/utils/FontManager.js index fd0fcdd8de..3080526135 100644 --- a/src/utils/FontManager.js +++ b/src/utils/FontManager.js @@ -77,9 +77,10 @@ export async function fixupColorFonts() { } if (await isColrFontSupported()) { - const font = new FontFace("Twemoji", - `url('${require("../../res/fonts/Twemoji_Mozilla/TwemojiMozilla-colr.woff2")}')`, {}); - document.fonts.add(font); + const path = `url('${require("../../res/fonts/Twemoji_Mozilla/TwemojiMozilla-colr.woff2")}')`; + document.fonts.add(new FontFace("Twemoji", path, {})); + document.fonts.add(new FontFace("Twemoji", path, { weight: 600 })); + document.fonts.add(new FontFace("Twemoji", path, { weight: 700 })); } // if not supported, the browser will fall back to one of the native fonts specified. }