Force Aptos Font on Specific Sites (v2.0)
This Userscript allows you to selectively apply the Aptos font family to specific websites that you add to a customizable "target list." All other websites will remain unaffected and display their original fonts.
Key Features:
- Selective Aptos Font Forcing: Applies a comprehensive Aptos font stack (including Aptos, Aptos Display, Aptos Narrow, Aptos Serif, Aptos Mono, and common fallbacks) only to websites you specify.
- Customizable Target List:
- Easily add the current website to your Aptos target list, or remove sites, using Userscript menu commands.
- Manually view and edit the entire list of targeted hostnames.
- Only sites on this list will have their font changed to Aptos.
- Persistent Storage: Your target list preferences are saved across browser sessions.
- Early Application: Styles are applied at
document-start
to minimize Flash of Unstyled Content (FOUC) on targeted sites.
Prerequisites:
- Aptos Font Family Installed: You must have the Aptos fonts installed on your operating system for this script to work as intended on your targeted sites. If Aptos is not found, your browser will use the next available font in the specified stack (e.g., Segoe UI, Tahoma, sans-serif).
- Aptos was introduced as the default font in Microsoft Office and is rolling out to Windows. You may need to acquire it or ensure your system is updated.
- Userscript Manager: A Userscript manager extension like Violentmonkey, Tampermonkey, or Greasemonkey is required. This script is tested primarily with Violentmonkey.
Installation:
- Ensure you have a Userscript Manager installed in your browser.
- Click the "Install this script" button on this Greasy Fork page.
- Your Userscript Manager will prompt you to confirm the installation.
How to Use:
Font Forcing on Targeted Sites:
The script will only change the font to Aptos on websites that are present in your "Aptos Target List". Other websites will display their default fonts. Initially, your target list will be empty, so no sites will have their font changed until you add them.
Managing the Aptos Target List:
You can manage the target list through the Userscript commands found in your Userscript Manager's menu (usually accessible by clicking the extension's icon in your browser toolbar):
To Add the Current Site to the Aptos Target List (Force Aptos):
- Navigate to the website where you want to see the Aptos font.
- Open the Userscript commands menu.
- Select
[Force Aptos on Sites] Force Aptos on: example.com
.
- You'll be prompted to confirm or edit the hostname to add. You can add the specific subdomain (e.g.,
sub.example.com
) or the base domain (e.g., example.com
). Adding a base domain will also target all its subdomains for the Aptos font.
- Reload the page for the change to take effect.
To Remove a Site from the Aptos Target List (Stop Forcing Aptos):
- Open the Userscript commands menu (can be done from any page).
- Select
[Force Aptos on Sites] Stop forcing Aptos for a site...
.
- You'll be prompted to enter the hostname you wish to remove from the target list. It will suggest the current site's hostname if applicable (and if it's currently on the list).
- Reload any affected pages for the change to take effect.
To View/Edit the Entire Aptos Target List:
- Open the Userscript commands menu.
- Select
[Force Aptos on Sites] View/Edit Aptos Target List
.
- A prompt will appear showing all hostnames currently targeted for the Aptos font, comma-separated.
- You can edit this list directly. Make sure hostnames are valid and separated by commas.
- Click "OK" to save changes.
- Reload any affected pages for changes to take effect.
Font Stack Used:
On targeted sites, the script attempts to apply fonts in the following order:
"Aptos", "Aptos Display", "Aptos Narrow", "Aptos Serif", "Aptos Mono", "Segoe UI Variable Text", "Segoe UI Variable Display", "Segoe UI Variable Small", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif
Notes:
- CSS Specificity: The script uses
!important
to override existing website styles on targeted sites. On very complex sites, there might still be elements that resist the change, or unintended layout shifts, though this is rare for font changes.
-
*
Selector: The script applies the font to all elements (*
) on targeted pages. A commented-out, more specific list of selectors is available in the code if you experience issues.
License:
This script is released under the MIT License. You are free to use, modify, and distribute it as per the license terms.