字体相关调整

This commit is contained in:
tangly1024.com
2023-02-09 14:46:32 +08:00
parent f9d4472245
commit 6f13f0a57b
17 changed files with 42 additions and 43 deletions

View File

@@ -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',

View File

@@ -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