文字字体

category
tags
type
status
slug
date
password
Last edited time
Aug 2, 2023 03:53 AM
summary
icon
系统预设Google的Noto Sans字体,您可以在blog.config.js 中自定义字体 ,相关配置如下:
 

配置说明

参数名
默认值
参数含义
FONT_STYLE
font-sans
字体是否有衬线:font-sansfont-serif
FONT_URL
[ 'https://fonts.googleapis.com/css?family=Bitter&display=swap', 'https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300&display=swap', 'https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@300&display=swap']
字体文件URL,这里默认使用googlewebfont的 Bitter 作为英文字体;Noto+Sans+SC 和 Noto+Serif+SC 作为中文字体。
FONT_SANS
[ '"PingFang SC"', '-apple-system', 'BlinkMacSystemFont', '"Hiragino Sans GB"', '"Microsoft YaHei"', '"Segoe UI Emoji"', '"Segoe UI Symbol"', '"Segoe UI"', '"Noto Sans SC"', 'HarmonyOS_Regular', '"Helvetica Neue"', 'Helvetica', '"Source Han Sans SC"', 'Arial', 'sans-serif', '"Apple Color Emoji"' ],
无衬线字体名;按照英文、数字、中文、EMOJI顺序排列,越前面优先级越高。 这里如果是苹果系统,则优先使用苹果的苹方字体、冬青黑字体。 否则windows系统的微软雅黑字体。最后使用谷歌的NotoSans字体。
FONT_SERIF
FONT_SERIF: [ 'Bitter', '"Noto Serif SC"', 'SimSun', '"Times New Roman"', 'Times', 'serif', '"Segoe UI Emoji"', '"Segoe UI Symbol"', '"Apple Color Emoji"' ],
无衬线字体名;按照英文、数字、中文、EMOJI顺序排列,越前面优先级越高。
FONT_AWESOME
https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css
图标库字体,默认使用 cloudflare的cdnjs。版本使用Fontawesome 6.4.0

修改示范

按照以下配置网站将默认显示霞鹜文楷字体,标粗下划线部分是修改的内容:
💡
注意,如果字体名称中间有空格,则要用双引号包装,对比如下: 无空格的字体:’Bitter’ 有空格的字体: '"LXGW WenKai"'
基础信息图标字库
  • Twikoo
  • Giscus
  • Cusdis