Last active
January 1, 2026 02:44
-
-
Save Bryan2333/a00d7403839718d8608a86bd4cc23c0e to your computer and use it in GitHub Desktop.
自定义字体
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name 自定义字体 | |
| // @namespace http://tampermonkey.net/ | |
| // @version 1.2 | |
| // @description 设置自定义字体,修复图标显示并优化中英文 | |
| // @match *://*/* | |
| // @grant GM_addStyle | |
| // @run-at document-start | |
| // ==/UserScript== | |
| (function () { | |
| 'use strict'; | |
| GM_addStyle(` | |
| body { | |
| /* | |
| 字体栈顺序策略: | |
| 1. Segoe UI / Roboto / Helvetica: 针对 Windows/Android/macOS 的优质西文 | |
| 2. PingFang SC / Microsoft YaHei: 针对 Mac 和 Windows 的中文 | |
| 3. sans-serif: 通用无衬线兜底 | |
| 4. Symbols Nerd Font: 最后加载图标字体以修复方块 | |
| */ | |
| font-family: | |
| "Segoe UI", Roboto, "Helvetica Neue", Arial, | |
| "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", | |
| sans-serif, | |
| "Symbols Nerd Font Mono", "Symbols Nerd Font" !important; | |
| } | |
| /* 以下部分保持原样,未做修改 */ | |
| pre, code, kbd, samp { | |
| font-family: 'Ubuntu Sans Mono', 'Symbols Nerd Font Mono', monospace !important; | |
| font-size: inherit; | |
| } | |
| [style*="monospace"] { | |
| font-family: 'Ubuntu Sans Mono', 'Symbols Nerd Font Mono', monospace !important; | |
| font-size: inherit; | |
| } | |
| `); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment