Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add sbix fallback twemoji font (and bump to emoji 12) #3050

Merged
merged 5 commits into from Jun 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Binary file modified res/fonts/Twemoji_Mozilla/TwemojiMozilla-colr.woff2
Binary file not shown.
Binary file not shown.
8 changes: 7 additions & 1 deletion src/utils/FontManager.js
Expand Up @@ -114,7 +114,13 @@ export async function fixupColorFonts() {
// 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 }));
} else {
// fall back to SBIX, generated via https://github.com/matrix-org/twemoji-colr/tree/matthew/sbix
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's very unfortunate that we're not able to use upstream for this. I have many fears about us forgetting to upgrade, or falling behind, or otherwise not maintaining our fork very well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, but i see no alternative sadly.

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 }));
}
// if not supported, the browser will fall back to one of the native fonts specified.
// ...and if SBIX is not supported, the browser will fall back to one of the native fonts specified.
}