Use My Fonts

Use my custom fonts on the pages

目前為 2024-09-24 提交的版本,檢視 最新版本

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

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

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

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

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

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

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name                Use My Fonts
// @name:en-US          Use My Fonts
// @name:zh-CN          使用我的字体
// @description         Use my custom fonts on the pages
// @description:en-US   Use my custom fonts on the pages
// @description:zh-CN   在页面上使用我的自定义字体
// @namespace           use-my-fonts
// @version             2024.09.24
// @author              Akatsuki Rui
// @license             MIT License
// @grant               GM_addStyle
// @run-at              document-start
// @match               *://*/*
// ==/UserScript==

"use strict";

const css = String.raw;

// FONT_CSS is generated by fonts.scss
const FONT_CSS = css`
  @charset "UTF-8";
  @font-face {
    font-family: "Arial";
    src: local("Roboto");
  }
  @font-face {
    font-family: "Helvetica";
    src: local("Roboto");
  }
  @font-face {
    font-family: "Open Sans";
    src: local("Roboto");
  }
  @font-face {
    font-family: "Segoe UI";
    src: local("Roboto");
  }
  @font-face {
    font-family: "Tahoma";
    src: local("Roboto");
  }
  @font-face {
    font-family: "Verdana";
    src: local("Roboto");
  }
  @font-face {
    font-family: "Microsoft YaHei UI";
    src: local("Noto Sans CJK SC");
  }
  @font-face {
    font-family: "Microsoft YaHei";
    src: local("Noto Sans CJK SC");
  }
  @font-face {
    font-family: "微软雅黑";
    src: local("Noto Sans CJK SC");
  }
  @font-face {
    font-family: "NSimsun";
    src: local("Noto Sans CJK SC");
  }
  @font-face {
    font-family: "新宋体";
    src: local("Noto Sans CJK SC");
  }
  @font-face {
    font-family: "Simhei";
    src: local("Noto Sans CJK SC");
  }
  @font-face {
    font-family: "宋体";
    src: local("Noto Sans CJK SC");
  }
  @font-face {
    font-family: "Simsun";
    src: local("Noto Sans CJK SC");
  }
  @font-face {
    font-family: "黑体";
    src: local("Noto Sans CJK SC");
  }
  @font-face {
    font-family: "Microsoft Jhenghei";
    src: local("Noto Sans CJK TC");
  }
  @font-face {
    font-family: "微軟正黑體";
    src: local("Noto Sans CJK TC");
  }
  @font-face {
    font-family: "ヒラギノ角ゴ Pro W3";
    src: local("Noto Sans CJK JP");
  }
  @font-face {
    font-family: "Hiragino Kaku Gothic Pro";
    src: local("Noto Sans CJK JP");
  }
  @font-face {
    font-family: Osaka;
    src: local("Noto Sans CJK JP");
  }
  @font-face {
    font-family: メイリオ;
    src: local("Noto Sans CJK JP");
  }
  @font-face {
    font-family: Meiryo;
    src: local("Noto Sans CJK JP");
  }
  @font-face {
    font-family: "MS Pゴシック";
    src: local("Noto Sans CJK JP");
  }
  @font-face {
    font-family: "MS PGothic";
    src: local("Noto Sans CJK JP");
  }
  @font-face {
    font-family: "MS ゴシック";
    src: local("Noto Sans CJK JP");
  }
  @font-face {
    font-family: "MS Gothic";
    src: local("Noto Sans CJK JP");
  }
  @font-face {
    font-family: "Malgun Gothic";
    src: local("Noto Sans CJK KR");
  }
  @font-face {
    font-family: "맑은 고딕";
    src: local("Noto Sans CJK KR");
  }
  @font-face {
    font-family: "Consolas";
    src: local("Cascadia Code");
  }
`;

GM_addStyle(FONT_CSS.trim());