Skip to content

Commit

Permalink
Merge pull request #30201 from s-alves10/fix/issue-21923
Browse files Browse the repository at this point in the history
  • Loading branch information
thienlnam authored Nov 5, 2023
2 parents 846a4b7 + 69c53f9 commit 925ff67
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
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';

Check warning on line 3 in src/styles/fontFamily/multiFontFamily.ts

View workflow job for this annotation

GitHub Actions / lint / lint

Unexpected parent import '../../CONST'. Use '@src/CONST' instead
import getOperatingSystem from '../../libs/getOperatingSystem';

Check warning on line 4 in src/styles/fontFamily/multiFontFamily.ts

View workflow job for this annotation

GitHub Actions / lint / lint

Unexpected parent import '../../libs/getOperatingSystem'. Use '@libs/getOperatingSystem' instead

// 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;

0 comments on commit 925ff67

Please sign in to comment.