mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-01 15:10:14 +00:00
字体相关调整
This commit is contained in:
12
lib/font.js
12
lib/font.js
@@ -33,16 +33,8 @@ const fontSerifCJK = !CJK()
|
||||
: [`"Noto Serif CJK ${CJK()}"`, `"Noto Serif ${CJK()}"`]
|
||||
|
||||
const fontFamilies = {
|
||||
sans: [...(BLOG.CUSTOM_FONT ? BLOG.CUSTOM_FONT_SANS : []),
|
||||
'"PingFang SC"', '-apple-system', 'BlinkMacSystemFont', '"Hiragino Sans GB"',
|
||||
'"Segoe UI Emoji"', '"Segoe UI Symbol"', '"Segoe UI"', '"Noto Sans SC"', 'HarmonyOS_Regular',
|
||||
'"Microsoft YaHei"', '"Helvetica Neue"', 'Helvetica', '"Source Han Sans SC"',
|
||||
'Arial', 'sans-serif', '"Apple Color Emoji"',
|
||||
...fontSansCJK],
|
||||
serif: [...(BLOG.CUSTOM_FONT ? BLOG.CUSTOM_FONT_SERIF : []),
|
||||
'"Noto Serif SC"', 'SimSun', '"Times New Roman"', 'Times', 'serif',
|
||||
'"Segoe UI Emoji"', '"Segoe UI Symbol"', '"Apple Color Emoji"',
|
||||
...fontSerifCJK],
|
||||
sans: [...BLOG.FONT_SANS, ...fontSansCJK],
|
||||
serif: [...BLOG.FONT_SERIF, ...fontSerifCJK],
|
||||
noEmoji: [
|
||||
'ui-sans-serif',
|
||||
'system-ui',
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
* @returns {Promise<unknown>}
|
||||
*/
|
||||
export function loadExternalResource(url, type) {
|
||||
console.log('加载', url, type)
|
||||
return new Promise((resolve, reject) => {
|
||||
let tag
|
||||
|
||||
@@ -14,6 +15,11 @@ export function loadExternalResource(url, type) {
|
||||
tag = document.createElement('link')
|
||||
tag.rel = 'stylesheet'
|
||||
tag.href = url
|
||||
} else if (type === 'font') {
|
||||
tag = document.createElement('link')
|
||||
tag.rel = 'preload'
|
||||
tag.as = 'font'
|
||||
tag.href = url
|
||||
} else if (type === 'js') {
|
||||
tag = document.createElement('script')
|
||||
tag.src = url
|
||||
|
||||
Reference in New Issue
Block a user