Greasy Fork is available in English.

强制使用字体 - 核心

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

您查看的为 2017-12-03 提交的版本。查看 最新版本

此脚本不应被直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.greasyfork.org/scripts/29500/234582/%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.3.1
// @description  所有 强制使用字体 脚本的核心脚本
// @author       BackRunner
// @include      *
// @grant        unsafeWindow
// @license      MIT
// ==/UserScript==
function changeFont(s_font,mode){
	if (s_font !==  ""){
		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(i){font-family:' + s_font + ',Arial,stonefont,iknow-qb_share_icons,review-iconfont,mui-act-font,fontAwesome,tm-detail-font,office365icons,MWF-MDL2,global-iconfont,"Bowtie" !important;}';
		document.documentElement.appendChild(element);

		if (mode === 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(i){font-family:' + s_font + ',Arial,stonefont,iknow-qb_share_icons,review-iconfont,mui-act-font,fontAwesome,tm-detail-font,office365icons,MWF-MDL2,global-iconfont,"Bowtie" !important;';
			},300);
		}
	}
}