Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gerwitz <mtg@gnu.org>2019-01-11 01:54:01 -0500
committerMike Gerwitz <mtg@gnu.org>2019-01-16 23:44:47 -0500
commitb6762c2dfc42b5444b148840670735a8acbf5140 (patch)
tree2f0cdeaabcf2659550dc9f1ab77e300eb30919b5 /bootstrap
parent563a32ff208afa0506d17a88fa489bc4fe1efd33 (diff)
downloadthoughts-b6762c2dfc42b5444b148840670735a8acbf5140.tar.gz
thoughts-b6762c2dfc42b5444b148840670735a8acbf5140.tar.bz2
thoughts-b6762c2dfc42b5444b148840670735a8acbf5140.zip
Source Sans Pro => Open Sans
This goes back to Open Sans, which is what I was using previously. I really like Source Sans Pro. Unfortunately, the font rendered far too small relative to other sans-serif fonts, which caused an unpleasent experience for both slow page loads (e.g. over Tor or slower connections) and for users with web fonts disabled (e.g. via NoScript). Further, the font is huge: the WOFF is over 100KiB per font, and I was using regular and light versions. Open Sans, in contrast, is <20KiB per font, allowing me to use Regular, Light, and SemiBold and still be about half the size of the single Source Sans Pro Regular. As a bonus, users may also already have Open Sans installed on their system. I settled with WOFF instead of WOFF2 for browser support. The site now looks pretty close on fallback, which is good. For example, I use DejaVu Sans as my default font, and it even has a Light version that renders correctly. As with all resources on my site, I host this from my own domain rather than via Google's servers. That means that the font won't be cached for users when they first visit the site, but that's okay---privacy is more important. I should note that, since I use NoScript, I almost never load web fonts for other sites. But I still wanted to try to provide a consistent look across systems for those who do wish to load fonts.
Diffstat (limited to 'bootstrap')
-rwxr-xr-xbootstrap19
1 files changed, 10 insertions, 9 deletions
diff --git a/bootstrap b/bootstrap
index a41c9f8..3217021 100755
--- a/bootstrap
+++ b/bootstrap
@@ -22,11 +22,11 @@
set -euo pipefail
-# Source fonts and license (SIL Open Font License 1.1)
-declare -ra fonts=(
- https://github.com/adobe-fonts/source-sans-pro/raw/c7ea228c8cd66f65dac985bef98fda12c9cfa713/WOFF/OTF/SourceSansPro-Light.otf.woff
- https://github.com/adobe-fonts/source-sans-pro/raw/c7ea228c8cd66f65dac985bef98fda12c9cfa713/WOFF/OTF/SourceSansPro-Regular.otf.woff
- https://github.com/adobe-fonts/source-sans-pro/raw/c7ea228c8cd66f65dac985bef98fda12c9cfa713/LICENSE.txt
+# Source fonts (Apache 2.0)
+declare -rA fonts=(
+ [OpenSans-Regular.woff]=https://fonts.gstatic.com/s/opensans/v15/mem8YaGs126MiZpBA-UFVZ0d.woff
+ [OpenSans-Light.woff]=https://fonts.gstatic.com/s/opensans/v15/mem5YaGs126MiZpBA-UN_r8OUuhv.woff
+ [OpenSans-SemiBold.woff]=https://fonts.gstatic.com/s/opensans/v15/mem5YaGs126MiZpBA-UNirkOUuhv.woff
)
declare -r tpimagesdir=images/tp
@@ -48,14 +48,15 @@ get-images()
# Download and verify fonts and license.
get-fonts()
{
- local font dest
+ local font src dest
echo 'retrieving font files...'
- for font in "${fonts[@]}"; do
- dest="$fontdir/$( basename "$font" )"
+ for font in "${!fonts[@]}"; do
+ src=${fonts[$font]}
+ dest="$fontdir/$font"
test ! -f "$dest" || continue
- torify wget "$font" -O "$dest"
+ torify wget "$src" -O "$dest"
done
# Verify that we haven't been served bad files. This should only happen