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: use twemoji to display flags in win #48

Merged
merged 4 commits into from
Dec 4, 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
Binary file added src/assets/fonts/Twemoji.Mozilla.ttf
Binary file not shown.
16 changes: 16 additions & 0 deletions src/assets/styles/fonts.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// 这个字体是为了解决在 Windows 系统下,微软因为政策问题,不支持显示国旗 emoji 的问题
@font-face {
font-family: "Color Emoji Flags";
src: local("Apple Color Emoji"), local("Noto Color Emoji"),
url("../fonts/Twemoji.Mozilla.ttf");
unicode-range: U+1F1E6-1F1FF;
}

@font-face {
font-family: "Color Emoji";
src: local("Apple Color Emoji"), local("Segoe UI Emoji"),
local("Segoe UI Symbol"), local("Noto Color Emoji"),
url("../fonts/Twemoji.Mozilla.ttf");

// use local emoji font for better backward compatibility
}
16 changes: 13 additions & 3 deletions src/assets/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
@import "./layout.scss";
@import "./page.scss";
@import "./fonts.scss";

body {
margin: 0;
overflow: hidden;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
sans-serif;
font-family:
system-ui,
-apple-system,
BlinkMacSystemFont,
Segoe UI,
Roboto,
"Helvetica Neue",
Arial,
"Noto Sans",
sans-serif,
"Color Emoji Flags",
"Color Emoji";
user-select: none;
-webkit-font-smoothing: antialiased;
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/_theme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const defaultTheme = {
error_color: "#d32f2f",
warning_color: "#ed6c02",
success_color: "#2e7d32",
font_family: `"Roboto", "Helvetica", "Arial", sans-serif`,
font_family: `"Roboto", "Helvetica", "Arial", sans-serif, "Color Emoji Flags"," Color Emoji"`,
};

// dark mode
Expand Down
Loading