mirror of
https://github.com/element-hq/element-web
synced 2024-11-25 18:55:58 +03:00
add SBIX fallback twemoji font
This commit is contained in:
parent
7a4d69f037
commit
caa950f625
2 changed files with 8 additions and 1 deletions
BIN
res/fonts/Twemoji_Mozilla/TwemojiMozilla-sbix.woff2
Normal file
BIN
res/fonts/Twemoji_Mozilla/TwemojiMozilla-sbix.woff2
Normal file
Binary file not shown.
|
@ -115,6 +115,13 @@ export async function fixupColorFonts() {
|
|||
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.
|
||||
else {
|
||||
// fall back to SBIX, generated via https://github.com/matrix-org/twemoji-colr/tree/matthew/sbix
|
||||
const path = `url('${require("../../res/fonts/Twemoji_Mozilla/TwemojiMozilla-sbix.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 }));
|
||||
}
|
||||
// ...and if SBIX is not supported, the browser will fall back to one of the native fonts specified.
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue