mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-17 07:26:46 +00:00
feat: 更好的自定义字体配置
This commit is contained in:
10
lib/font.js
10
lib/font.js
@@ -2,9 +2,10 @@
|
||||
* 在此处配置字体
|
||||
*/
|
||||
const BLOG = require('../blog.config')
|
||||
|
||||
// const { fontFamily } = require('tailwindcss/defaultTheme')
|
||||
|
||||
function CJK () {
|
||||
function CJK() {
|
||||
switch (BLOG.LANG.toLowerCase()) {
|
||||
case 'zh-cn':
|
||||
case 'zh-sg':
|
||||
@@ -32,12 +33,12 @@ const fontSerifCJK = !CJK()
|
||||
: [`"Noto Serif CJK ${CJK()}"`, `"Noto Serif ${CJK()}"`]
|
||||
|
||||
const fontFamilies = {
|
||||
sans: ['-apple-system', 'BlinkMacSystemFont', '"Apple Color Emoji"',
|
||||
sans: [...(BLOG.CUSTOM_FONT ? BLOG.CUSTOM_FONT_SANS : []), '-apple-system', 'BlinkMacSystemFont', '"Apple Color Emoji"',
|
||||
'"Segoe UI Emoji"', '"Segoe UI Symbol"', '"Segoe UI"', '"PingFang SC"',
|
||||
'HarmonyOS_Regular', '"Hiragino Sans GB"', '"Microsoft YaHei"', '"Helvetica Neue"',
|
||||
'Helvetica', '"Source Han Sans SC"', '"Noto Sans CJK SC"', '"WenQuanYi Micro Hei"',
|
||||
'Arial', 'sans-serif', ...fontSansCJK],
|
||||
serif: ['STZhongsong', 'STSong', '"Noto Serif CJK"', '"Noto Serif SC"', 'PMingLiu',
|
||||
serif: [...(BLOG.CUSTOM_FONT ? BLOG.CUSTOM_FONT_SERIF : []), 'STZhongsong', 'STSong', '"Noto Serif CJK"', '"Noto Serif SC"', 'PMingLiu',
|
||||
'SimSun', '"WenQuanYi Bitmap Song"', '"Times New Roman"', 'Times', 'serif',
|
||||
'"Apple Color Emoji"', '"Segoe UI Emoji"', '"Segoe UI Symbol"', ...fontSerifCJK],
|
||||
noEmoji: [
|
||||
@@ -46,8 +47,7 @@ const fontFamilies = {
|
||||
'-apple-system',
|
||||
'BlinkMacSystemFont',
|
||||
'sans-serif'
|
||||
],
|
||||
custom: BLOG.FONT_CUSTOM_FAMILY
|
||||
]
|
||||
}
|
||||
|
||||
module.exports = fontFamilies
|
||||
|
||||
Reference in New Issue
Block a user