字体替换:XHei Intel

将字体替换为 XHei Intel。

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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
}
`);