Github UI Font: Inter UI

Use the Inter font for all the non-code text on Github. Version code matches inter font version code.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         Github UI Font: Inter UI
// @namespace    https://github.com/holyspiritomb
// @author       spiritomb
// @version      4.1.0
// @description  Use the Inter font for all the non-code text on Github. Version code matches inter font version code.
// @license      MIT
// @match        https://github.com/*
// @match        https://*.github.com/*
// @run-at       document-start
// @grant        GM_addStyle
// @grant        GM_getResourceURL
// @grant        unsafeWindow
// @icon         https://www.google.com/s2/favicons?domain=github.com
// @homepageURL  https://github.com/holyspiritomb/userscripts
// @homepage     https://github.com/holyspiritomb/userscripts
// @resource     interReg https://cdn.jsdelivr.net/npm/[email protected]/web/Inter-Regular.woff2
// @resource     interRegIt https://cdn.jsdelivr.net/npm/[email protected]/web/Inter-Italic.woff2
// @resource     interMed https://cdn.jsdelivr.net/npm/[email protected]/web/Inter-Medium.woff2
// @resource     interMedIt https://cdn.jsdelivr.net/npm/[email protected]/web/Inter-MediumItalic.woff2
// @resource     interBold https://cdn.jsdelivr.net/npm/[email protected]/web/Inter-Bold.woff2
// @resource     interBoldIt https://cdn.jsdelivr.net/npm/[email protected]/web/Inter-BoldItalic.woff2
// ==/UserScript==

(function() {
    let interReg = GM_getResourceURL("interReg", false);
    let interIt = GM_getResourceURL("interRegIt", false);
    let interMed = GM_getResourceURL("interMed", false);
    let interMedIt = GM_getResourceURL("interMedIt", false);
    let interBold = GM_getResourceURL("interBold", false);
    let interBoldIt = GM_getResourceURL("interBoldIt", false);
    var css = "";
    css += `
    @font-face {
      font-family: 'Inter';
      font-style:  normal;
      font-weight: 400;
      font-display: swap;
      src: url(${interReg}) format("woff2");
    }
    @font-face {
      font-family: 'Inter';
      font-style:  italic;
      font-weight: 400;
      font-display: swap;
      src: url(${interIt}) format("woff2");
    }

    @font-face {
      font-family: 'Inter';
      font-style:  normal;
      font-weight: 500;
      font-display: swap;
      src: url(${interMed}) format("woff2");
    }
    @font-face {
      font-family: 'Inter';
      font-style:  italic;
      font-weight: 500;
      font-display: swap;
      src: url(${interMedIt}) format("woff2");
    }

    @font-face {
      font-family: 'Inter';
      font-style:  normal;
      font-weight: 700;
      font-display: swap;
      src: url(${interBold}) format("woff2");
    }
    @font-face {
      font-family: 'Inter';
      font-style:  italic;
      font-weight: 700;
      font-display: swap;
      src: url(${interBoldIt}) format("woff2");
    }

    body, .markdown-body { font-family: 'Inter', 'Lato', sans-serif !important; }`;
    if (typeof GM_addStyle != "undefined") {
        GM_addStyle(css);
    } else {
        var node = document.createElement("style");
        node.type = "text/css";
        node.appendChild(document.createTextNode(css));
        var heads = document.getElementsByTagName("head");
        if (heads.length > 0) {
            heads[0].appendChild(node);
        } else {
            // no head yet, stick it whereever
            document.documentElement.appendChild(node);
        }
    }
})();