mirror of
https://github.com/element-hq/element-web
synced 2024-11-28 12:28:50 +03:00
Merge pull request #3011 from matrix-org/bwindels/removesbix
remove SBIX font and fallback to native emoji
This commit is contained in:
commit
e44f3b65e6
2 changed files with 5 additions and 8 deletions
Binary file not shown.
|
@ -31,7 +31,8 @@ async function isColrFontSupported() {
|
||||||
// Firefox has supported COLR fonts since version 26
|
// Firefox has supported COLR fonts since version 26
|
||||||
// but doesn't support the check below with content blocking enabled.
|
// but doesn't support the check below with content blocking enabled.
|
||||||
if (navigator.userAgent.includes("Firefox")) {
|
if (navigator.userAgent.includes("Firefox")) {
|
||||||
return true;
|
colrFontSupported = true;
|
||||||
|
return colrFontSupported;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -75,15 +76,11 @@ export async function fixupColorFonts() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// we programatically add the right fontface.
|
|
||||||
let font;
|
|
||||||
if (await isColrFontSupported()) {
|
if (await isColrFontSupported()) {
|
||||||
font = new FontFace("Twemoji",
|
const font = new FontFace("Twemoji",
|
||||||
`url('${require("../../res/fonts/Twemoji_Mozilla/TwemojiMozilla-colr.woff2")}')`, {});
|
`url('${require("../../res/fonts/Twemoji_Mozilla/TwemojiMozilla-colr.woff2")}')`, {});
|
||||||
} else {
|
document.fonts.add(font);
|
||||||
font = new FontFace("Twemoji",
|
|
||||||
`url('${require("../../res/fonts/Twemoji_Mozilla/TwemojiMozilla-sbix.woff2")}')`, {});
|
|
||||||
}
|
}
|
||||||
document.fonts.add(font);
|
// if not supported, the browser will fall back to one of the native fonts specified.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue