Merge pull request #3015 from matrix-org/jryans/windows-emoji
Windows emoji tweaks
This commit is contained in:
commit
1ff196a964
2 changed files with 8 additions and 5 deletions
|
@ -5,9 +5,9 @@
|
||||||
Arial empirically gets it right, hence prioritising Arial here. */
|
Arial empirically gets it right, hence prioritising Arial here. */
|
||||||
/* We fall through to Twemoji for emoji rather than falling through
|
/* We fall through to Twemoji for emoji rather than falling through
|
||||||
to native Emoji fonts (if any) to ensure cross-browser consistency */
|
to native Emoji fonts (if any) to ensure cross-browser consistency */
|
||||||
$font-family: Nunito, Twemoji, 'Apple Color Emoji', 'Noto Color Emoji', Arial, Helvetica, Sans-Serif;
|
$font-family: Nunito, Twemoji, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', Arial, Helvetica, Sans-Serif;
|
||||||
|
|
||||||
$monospace-font-family: Inconsolata, Twemoji, 'Apple Color Emoji', 'Noto Color Emoji', Courier, monospace;
|
$monospace-font-family: Inconsolata, Twemoji, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', Courier, monospace;
|
||||||
|
|
||||||
// unified palette
|
// unified palette
|
||||||
// try to use these colors when possible
|
// try to use these colors when possible
|
||||||
|
|
|
@ -77,9 +77,12 @@ export async function fixupColorFonts() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (await isColrFontSupported()) {
|
if (await isColrFontSupported()) {
|
||||||
const font = new FontFace("Twemoji",
|
const path = `url('${require("../../res/fonts/Twemoji_Mozilla/TwemojiMozilla-colr.woff2")}')`;
|
||||||
`url('${require("../../res/fonts/Twemoji_Mozilla/TwemojiMozilla-colr.woff2")}')`, {});
|
document.fonts.add(new FontFace("Twemoji", path, {}));
|
||||||
document.fonts.add(font);
|
// For at least Chrome on Windows 10, we have to explictly add extra
|
||||||
|
// weights for the emoji to appear in bold messages, etc.
|
||||||
|
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.
|
// if not supported, the browser will fall back to one of the native fonts specified.
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue