add emoji font

This commit is contained in:
pompurin404 2024-08-08 16:06:48 +08:00
parent 94f6596229
commit 9bdee84399
No known key found for this signature in database
9 changed files with 50 additions and 8 deletions

1
.gitignore vendored
View File

@ -6,3 +6,4 @@ out
.DS_Store
*.log*
.idea
*.ttf

View File

@ -257,6 +257,20 @@ const resolveEnableLoopback = () =>
downloadURL: `https://github.com/Kuingsmile/uwp-tool/releases/download/latest/enableLoopback.exe`
})
const resolveFont = async () => {
const targetPath = path.join(cwd, 'src', 'renderer', 'src', 'assets', 'NotoColorEmoji.ttf')
if (fs.existsSync(targetPath)) {
return
}
await downloadFile(
'https://github.com/googlefonts/noto-emoji/raw/main/fonts/NotoColorEmoji.ttf',
targetPath
)
console.log(`[INFO]: NotoColorEmoji.ttf finished`)
}
const tasks = [
{
name: 'verge-mihomo-alpha',
@ -271,6 +285,11 @@ const tasks = [
{ name: 'mmdb', func: resolveMmdb, retry: 5 },
{ name: 'geosite', func: resolveGeosite, retry: 5 },
{ name: 'geoip', func: resolveGeoIP, retry: 5 },
{
name: 'font',
func: resolveFont,
retry: 5
},
{
name: 'enableLoopback',
func: resolveEnableLoopback,

View File

@ -2,6 +2,28 @@
@tailwind components;
@tailwind utilities;
@font-face {
font-family: 'Noto Color Emoji';
src: url('./NotoColorEmoji.ttf');
}
.flag-empji {
font-family:
system-ui,
-apple-system,
BlinkMacSystemFont,
'Segoe UI',
Roboto,
Oxygen,
Ubuntu,
Cantarell,
'Open Sans',
'Helvetica Neue',
sans-serif,
'Apple Color Emoji',
'Noto Color Emoji';
}
.no-scrollbar::-webkit-scrollbar {
display: none;
}

View File

@ -46,7 +46,7 @@ const EditFileModal: React.FC<Props> = (props) => {
enabled: false
},
mouseWheelZoom: true,
fontFamily: `Fira Code, JetBrains Mono, Roboto Mono, "Source Code Pro", Consolas, Menlo, Monaco, monospace, "Courier New", "Apple Color Emoji"`,
fontFamily: `Fira Code, JetBrains Mono, Roboto Mono, "Source Code Pro", Consolas, Menlo, Monaco, monospace, "Courier New", "Apple Color Emoji", "Noto Color Emoji"`,
fontLigatures: true, // 连字符
smoothScrolling: true // 平滑滚动
}}

View File

@ -64,7 +64,7 @@ const ProxyItem: React.FC<Props> = (props) => {
<CardBody className="p-2">
<div className="flex select-none justify-between items-center">
<div>
<div className="inline text-ellipsis whitespace-nowrap overflow-hidden">
<div className="flag-empji inline text-ellipsis whitespace-nowrap overflow-hidden">
{proxy.name}
</div>
{proxyDisplayMode === 'full' && (

View File

@ -46,7 +46,7 @@ const ConfigViewer: React.FC<Props> = (props) => {
enabled: false
},
mouseWheelZoom: true,
fontFamily: `Fira Code, JetBrains Mono, Roboto Mono, "Source Code Pro", Consolas, Menlo, Monaco, monospace, "Courier New", "Apple Color Emoji"`,
fontFamily: `Fira Code, JetBrains Mono, Roboto Mono, "Source Code Pro", Consolas, Menlo, Monaco, monospace, "Courier New", "Apple Color Emoji", "Noto Color Empji"`,
fontLigatures: true, // 连字符
smoothScrolling: true // 平滑滚动
}}

View File

@ -2,7 +2,7 @@ import { Button, Card, CardBody, CardFooter, Chip, Progress } from '@nextui-org/
import { useProfileConfig } from '@renderer/hooks/use-profile-config'
import { useLocation, useNavigate } from 'react-router-dom'
import { calcTraffic, calcPercent } from '@renderer/utils/calc'
import { LiaGripfire } from 'react-icons/lia'
import { CgLoadbarDoc } from 'react-icons/cg'
import { IoMdRefresh } from 'react-icons/io'
import relativeTime from 'dayjs/plugin/relativeTime'
import 'dayjs/locale/zh-cn'
@ -57,7 +57,7 @@ const ProfileCard: React.FC = () => {
setShowRuntimeConfig(true)
}}
>
<LiaGripfire className={`text-[24px] ${match ? 'text-white' : 'text-foreground'}`} />
<CgLoadbarDoc className={`text-[24px] ${match ? 'text-white' : 'text-foreground'}`} />
</Button>
{info.type === 'remote' && (
<Button

View File

@ -38,7 +38,7 @@ const PacEditorViewer: React.FC<Props> = (props) => {
enabled: false
},
mouseWheelZoom: true,
fontFamily: `Fira Code, JetBrains Mono, Roboto Mono, "Source Code Pro", Consolas, Menlo, Monaco, monospace, "Courier New", "Apple Color Emoji"`,
fontFamily: `Fira Code, JetBrains Mono, Roboto Mono, "Source Code Pro", Consolas, Menlo, Monaco, monospace, "Courier New", "Apple Color Emoji", "Noto Color Empji"`,
fontLigatures: true, // 连字符
smoothScrolling: true // 平滑滚动
}}

View File

@ -158,14 +158,14 @@ const Proxies: React.FC = () => {
src={groups[index].icon}
/>
) : null}
<div className="h-[32px] select-none text-ellipsis whitespace-nowrap overflow-hidden text-md leading-[32px]">
<div className="flag-emoji h-[32px] select-none text-ellipsis whitespace-nowrap overflow-hidden text-md leading-[32px]">
{groups[index].name}
{proxyDisplayMode === 'full' && (
<>
<div className="inline ml-2 text-sm text-default-500">
{groups[index].type}
</div>
<div className="inline ml-2 text-sm text-default-500">
<div className="flag-empji inline ml-2 text-sm text-default-500">
{groups[index].now}
</div>
</>