-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTwitter_-_Linux-friendly_fonts.user.js
More file actions
31 lines (28 loc) · 1.03 KB
/
Twitter_-_Linux-friendly_fonts.user.js
File metadata and controls
31 lines (28 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// ==UserScript==
// @name Twitter - Linux-friendly fonts
// @namespace https://github.com/adamhotep/userscripts
// @include https://twitter.com/*
// @license GPL
// @grant none
// @version 0.3.20190121
// ==/UserScript==
'use strict';
var head = document.head;
if (head) {
let style = document.createElement('style');
style.setAttribute('type', 'text/css');
// The Twitter fonts are all (mostly) metrically compatible
// and only Macs have access to Helvetica or Helvetica Neue.
let twitter_fonts = `"Helvetica Neue", Helvetica, Arial, sans-serif`;
// The fonts added below are all metric-compatible with Arial:
// https://en.wikipedia.org/wiki/Arial#Free_alternatives
// https://en.wikipedia.org/wiki/Arimo_(typeface)
// https://en.wikipedia.org/wiki/Liberation_fonts
// https://en.wikipedia.org/wiki/Nimbus_Sans#Nimbus_Sans_L
style.textContent = /* syn=css */ `
body {
font-family:Arimo, "Liberation Sans", "Nimbus Sans L", ${twitter_fonts};
}
`;
head.appendChild(style);
}