Font Replacer

Replaces specified fonts with alternatives across all page elements

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

Autor
pfzim
Denně instalací
0
Celkem instalací
14
Hodnocení
0 0 0
Verze
0.4
Vytvořeno
28. 03. 2025
Aktualizováno
04. 04. 2025
Size
12,9 KB
Licence
GPL-3.0-or-later
Spustit na
všech stránkách

Font Replacer Script Overview

This UserScript automatically replaces specified fonts with alternatives across all webpage elements. Its primary purpose is to improve text readability when font anti-aliasing is disabled, as some fonts (like Helvetica or GitLab Sans) may render poorly without smoothing.


Key Features

  1. Real-Time Font Replacement
    Scans for target fonts (e.g., Helvetica, GitLab Sans) and substitutes them with more legible alternatives (Verdana, Arial, etc.).

  2. Customizable Replacements
    Configure font mappings in the fontReplacements object:

    const fontReplacements = {
       "Helvetica": "Verdana",
       "Segoe UI": "Arial"
       // Add more as needed
    };
    
  3. Comprehensive Coverage

    • Recursively checks all DOM elements (including nested/dynamic content via MutationObserver).
    • Handles inline styles and CSS-computed fonts.
  4. Non-Intrusive Execution

    • No grant permissions required.
    • Only modifies fonts that match replacement rules.

How to Use

  1. Install the script in Tampermonkey/Greasemonkey.
  2. Edit fontReplacements to match your preferences.
  3. Fonts will update automatically upon page load.

Example Replacements

Original Font Replacement Reason
Helvetica Verdana Better readability without AA
GitLab Sans Verdana Fixes jagged edges
Roboto Mono Courier New Crisper monospace rendering

Technical Notes

  • Works on all sites (via @match *://*/*).
  • Optional @font-face override (commented out) for forced enforcement.
  • Processes dynamically added content without page reloads.

Ideal for GitLab, Jira, and other interfaces where fonts degrade without anti-aliasing.

Pro Tip: Uncomment the console.log lines to debug font changes in real time.

// Debug example:
// console.log('Replaced:', originalFont, '→', newFont);