Skip to content

Instantly share code, notes, and snippets.

@patarapolw
Last active December 8, 2022 02:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patarapolw/38c829e8069a502e8d53ea5174485ca2 to your computer and use it in GitHub Desktop.
Save patarapolw/38c829e8069a502e8d53ea5174485ca2 to your computer and use it in GitHub Desktop.
Userscript to force certain fonts
// ==UserScript==
// @name Custom font
// @namespace polv/wanikani
// @version 0.1
// @description Custom font for a CSS selector
// @author You
// @match https://www.wanikani.com/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
// Font list from Jisho.org
// Or specific font, such as Biz UDPMincho;
// Or css values, such as serif or unset;
document.head.append(Object.assign(document.createElement('style'), { textContent: `
[lang="ja"] {
font-family: "Source Han Sans", "源ノ角ゴシック", "Hiragino Sans", "HiraKakuProN-W3", "Hiragino Kaku Gothic ProN W3", "Hiragino Kaku Gothic ProN", "ヒラギノ角ゴ ProN W3", "Noto Sans", "Noto Sans CJK JP", "メイリオ", Meiryo, "游ゴシック", YuGothic, "MS Pゴシック", "MS PGothic", "MS ゴシック", "MS Gothic", sans-serif;
}
` }));
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment