Roblox Gotham Font Changer

Change the font on Roblox to Gotham

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 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));
})();