字体替换:XHei Intel

将字体替换为 XHei Intel。

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name                 	字体替换:XHei Intel
// @name:en-EN     	  Fonts Replacer: XHei Intel
// @namespace       	   https://gist.github.com/897601689/14ed64dadef9deb36953b3d78f7c79fc
// @version              	1.2
// @author              	xiaoyu
// @description       	     将字体替换为 XHei Intel。
// @description:en-EN   Replace fonts with XHei Intel.
// @match                	*://*/*
// @run-at              	 document-body
// @grant                	 GM_addStyle
// @grant                	 GM_registerMenuCommand
// @grant                	 GM_unregisterMenuCommand
// @license             	MIT
// ==/UserScript==

GM_addStyle(`
@font-face {
    font-family: "XHei Intel";
    src: local("XHei Intel");
    unicode-range: U+200C, U+200D, U+FE0E, U+FE0F, U+2190-21FF, U+27F?, U+2900-297F, U+2B??, U+23??, U+25A0-27BF, U+32??, U+1F???
}

:not(i, span[class ^= fa], #_):not([class *= icon], [class *= icon] span, #_) {
	font-family: "XHei Intel", system-ui
}
: is([lang$ = HK], [lang$ = MO]):not(i, span[class ^= fa], #_):not([class *= icon], [class *= icon] span, #_) {
	font-family: "XHei Intel", system-ui
}
: is([lang$ = TW], [lang$ = hant]):not(i, span[class ^= fa], #_):not([class *= icon], [class *= icon] span, #_) {
	font-family: "XHei Intel", system-ui
}
: lang(ja):not(i, span[class ^= fa], #_):not([class *= icon], [class *= icon] span, #_) {
	font-family: "XHei Intel", system-ui
}
: lang(ko):not(i, span[class ^= fa], #_):not([class *= icon], [class *= icon] span, #_) {
	font-family: "XHei Intel", system-ui
}
: root: is(pre, code, samp, kbd,
	var, [class *= code], #_):not([class *= icon], #_) {
	font-family: "XHei Intel", monospace
}
: root: is(pre, code, samp, kbd,
	var, [class *= code], #_):not([class *= icon], #_) span {
	font-family: "XHei Intel", monospace
}
`);