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

feat: new emoji font for Windows #30201

Merged
merged 3 commits into from
Nov 5, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions assets/css/fonts.css
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@
src: url('/fonts/ExpensifyNewKansas-MediumItalic.woff2') format('woff2'), url('/fonts/ExpensifyNewKansas-MediumItalic.woff') format('woff');
}

@font-face {
font-family: Windows Segoe UI Emoji;
src: url('/fonts/seguiemj.ttf');
}

* {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
Expand Down
Binary file added assets/fonts/web/seguiemj.ttf
Binary file not shown.
8 changes: 8 additions & 0 deletions src/styles/fontFamily/multiFontFamily.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import {multiBold} from './bold';
import FontFamilyStyles from './types';
import CONST from '../../CONST';
import getOperatingSystem from '../../libs/getOperatingSystem';

// In windows and ubuntu, we need some extra system fonts for emojis to work properly
// otherwise few of them will appear as black and white
Expand All @@ -16,4 +18,10 @@ const fontFamily: FontFamilyStyles = {
MONOSPACE_BOLD_ITALIC: 'ExpensifyMono-Bold, Segoe UI Emoji, Noto Color Emoji',
};

if (getOperatingSystem() === CONST.OS.WINDOWS) {
Object.keys(fontFamily).forEach((key) => {
fontFamily[key as keyof FontFamilyStyles] = fontFamily[key as keyof FontFamilyStyles].replace('Segoe UI Emoji', 'Windows Segoe UI Emoji');
});
}

export default fontFamily;
Loading