--- tag: md-font icon: 🔤 title: 字体组件 description: 设置整个文档的字体和文字颜色,支持 Google Fonts、emfont 和系统本地字体三种来源。 syntax: ':md-font[Noto Sans SC]{source="google" weight="400" color="#ff00dd"}' props: - name: source type: google | emfont | local default: local desc: 字体来源 - name: weight type: string default: '"400"' desc: 字体粗细 - name: color type: string desc: 文字颜色(CSS 颜色值,如 #ff00dd、rgb(255,0,0)) --- **Google 字体:** :md-font[Noto Sans SC]{source="google"} **Emfont 字体:** :md-font[Source Han Serif]{source="emfont" weight="700"} **本地字体(默认):** :md-font[STSong] **设置文字颜色:** :md-font[Noto Sans SC]{source="google" color="#1a1a2e"} :md-font[Noto Sans SC]{source="google" weight="700" color="crimson"} 字体和颜色将应用到整个文档卡片。 ## 使用场景 用于切换文档的显示字体和文字颜色,适配不同风格需求。