Greasy Fork is available in English.

强制使用字体 - 核心

所有 强制使用字体 脚本的核心脚本

Version vom 29.10.2018. Aktuellste Version

Dieses Skript sollte nicht direkt installiert werden. Es handelt sich hier um eine Bibliothek für andere Skripte, welche über folgenden Befehl in den Metadaten eines Skriptes eingebunden wird // @require https://update.greasyfork.org/scripts/29500/640705/%E5%BC%BA%E5%88%B6%E4%BD%BF%E7%94%A8%E5%AD%97%E4%BD%93%20-%20%E6%A0%B8%E5%BF%83.js

// ==UserScript==
// @name         强制使用字体 - 核心
// @namespace    http://tampermonkey.net/
// @version      1.6
// @description  所有 强制使用字体 脚本的核心脚本
// @author       BackRunner
// @include      *
// @grant        unsafeWindow
// @license      MIT
// ==/UserScript==
function changeFont(s_font,mode){
	if (s_font !==  ""){
		
		switch(mode){
			case 0:
				var element = document.createElement("link");
				element.rel="stylesheet";
				element.type="text/css";
				element.href='data:text/css,*:not([class*="icon"]):not([class*="fa"]):not([class*="logo"]):not([class*="mi"]):not([class*="hwic"]):not([class*="blob-code"]):not(i){font-family:' + s_font + ',Arial,"Material Icons Extended",stonefont,iknow-qb_share_icons,review-iconfont,mui-act-font,fontAwesome,tm-detail-font,office365icons,MWF-MDL2,global-iconfont,"Bowtie",sans-serif !important;}';
				document.documentElement.appendChild(element);
				break;
			case 1:
				setTimeout(function(){
					var modStyle = document.querySelector('#modCSS_font');
					if (modStyle === null)
					{
						modStyle = document.createElement('style');
						modStyle.id = 'modCSS_font';
						document.body.appendChild(modStyle);
					}   
					modStyle.innerHTML = '*:not([class*="icon"]):not([class*="fa"]):not([class*="logo"]):not([class*="mi"]):not([class*="hwic"]):not([class*="blob-code"]):not(i){font-family:' + s_font + ',Arial,"Material Icons Extended",stonefont,iknow-qb_share_icons,review-iconfont,mui-act-font,fontAwesome,tm-detail-font,office365icons,MWF-MDL2,global-iconfont,"Bowtie",sans-serif !important;}';
				},300);
				break;
			case 2:
				var element = document.createElement("link");
				element.rel="stylesheet";
				element.type="text/css";
				element.href='data:text/css,*:not([class*="icon"]):not([class*="fa"]):not([class*="logo"]):not([class*="mi"]):not([class*="hwic"]):not([class*="blob-code"]):not(i){font-family:' + s_font + ',Arial,"Material Icons Extended",stonefont,iknow-qb_share_icons,review-iconfont,mui-act-font,fontAwesome,tm-detail-font,office365icons,MWF-MDL2,global-iconfont,"Bowtie",sans-serif !important;}';
				document.documentElement.appendChild(element);
				setTimeout(function(){
					var modStyle = document.querySelector('#modCSS_font');
					if (modStyle === null)
					{
						modStyle = document.createElement('style');
						modStyle.id = 'modCSS_font';
						document.body.appendChild(modStyle);
					}   
					modStyle.innerHTML = '*:not([class*="icon"]):not([class*="fa"]):not([class*="logo"]):not([class*="mi"]):not(i){font-family:' + s_font + ',Arial,"Material Icons Extended",stonefont,iknow-qb_share_icons,review-iconfont,mui-act-font,fontAwesome,tm-detail-font,office365icons,MWF-MDL2,global-iconfont,"Bowtie" !important;}';
				},300);
				break;
			case 3:
				var element = document.createElement("link");
				element.rel="stylesheet";
				element.type="text/css";
				element.href='data:text/css,*:not(i):not([class*="icon"]):not([class*="fa"]):not([class*="logo"]):not([class*="mi"]):not([class*="blob-code"]){font-family:' + s_font + ',Arial,"Material Icons Extended"";}';
				document.documentElement.appendChild(element);
				setTimeout(function(){
					var modStyle = document.querySelector('#modCSS_font');
					if (modStyle === null)
					{
						modStyle = document.createElement('style');
						modStyle.id = 'modCSS_font';
						document.body.appendChild(modStyle);
					}   
					modStyle.innerHTML = '*:not(i):not([class*="icon"]):not([class*="fa"]):not([class*="logo"]):not([class*="mi"]):not([class*="blob-code"]){font-family:' + s_font + ',"Material Icons Extended",Arial,"Material Icons Extended";}';
				},300);
				break;
		}
	}
}