Roblox Gotham Font Changer

Change the font on Roblox to Gotham

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Roblox Gotham Font Changer
// @namespace    http://tampermonkey.net/
// @version      0.12
// @description  Change the font on Roblox to Gotham
// @author       verticalfx
// @match        *://*.roblox.com/*
// @grant        none
// @run-at document-start
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    // there is a variation between Gotham and Gotham SSm. I haven't been able to find an identical copy of the font with similar font weights that match.
    // I would have self hosted but it goes against their terms of use. Best I can do for now.

    var fontFaces = `
    @font-face{font-family:'Gotham';font-style:normal;font-weight:400;src:local('Gotham'),url(https://fonts.cdnfonts.com/s/14898/GothamBook.woff) format('woff')}
    @font-face{font-family:'Gotham';font-style:italic;font-weight:400;src:local('Gotham'),url(https://fonts.cdnfonts.com/s/14898/GothamBookItalic.woff) format('woff')}
    @font-face{font-family:'Gotham';font-style:normal;font-weight:300;src:local('Gotham'),url(https://fonts.cdnfonts.com/s/14898/GothamLight.woff) format('woff')}
    @font-face{font-family:'Gotham';font-style:italic;font-weight:300;src:local('Gotham'),url(https://fonts.cdnfonts.com/s/14898/GothamLightItalic.woff) format('woff')}
    @font-face{font-family:'Gotham';font-style:normal;font-weight:500;src:local('Gotham'),url(https://fonts.cdnfonts.com/s/14898/GothamMedium.woff) format('woff')}
    @font-face{font-family:'Gotham';font-style:italic;font-weight:500;src:local('Gotham'),url(https://fonts.cdnfonts.com/s/14898/GothamMediumItalic.woff) format('woff')}
    @font-face{font-family:'Gotham';font-style:normal;font-weight:700;src:local('Gotham'),url(https://fonts.cdnfonts.com/s/14898/GothamBold.woff) format('woff')}
    @font-face{font-family:'Gotham';font-style:italic;font-weight:700;src:local('Gotham'),url(https://fonts.cdnfonts.com/s/14898/GothamBoldItalic.woff) format('woff')}
    `;

    // Apply Gotham as the primary font family with 'HCo Gotham SSm' as fallback
    var css = `* { font-family:  'HCo Gotham SSm', 'Gotham' !important; }`;

    var head = document.head || document.getElementsByTagName('head')[0];
    var style = document.createElement('style');
    head.appendChild(style);
    style.type = 'text/css';
    style.appendChild(document.createTextNode(fontFaces + css));
})();