Way in the backlog (unless someone feels inspired), I'd like to allow
users to set custom fonts in a similar fashion to Akkoma. We could store
that sanitised preference in a user's row in the DB (would require
schema migration) and use it in templates when constructing pages: the
schema could default to "Atkinson Hyperlegible", and when the template
sees that, we include the CSS necessary for loading the font. When the
template sees something else, we omit Atkinson Hyperlegible's CSS and
just set font-family
to whatever the user entered in the field.
That preference should have a description (or a link to the docs website
once we have one) explaining that it's for local fonts the user already
has installed and include tips on how to identify the font's name in a
way the browser will recognise. On Linux, that might be telling the user
to run the snippet below, replacing {word in font name}
with a portion
of what they think the font's name is.
fc-list | awk -F: '{print $2}' | sed 's/^\s*//;s/\s*$//' | sort -u | grep "{word in font name}"
For example, running that with Inter
on my machine produces:
$ fc-list | awk -F: '{print $2}' | sed 's/^\s*//;s/\s*$//' | sort -u | grep "Inter"
Inter
Inter,Inter Black
Inter,Inter Extra Bold
Inter,Inter Extra Light
Inter,Inter Light
Inter,Inter Medium
Inter,Inter Semi Bold
Inter,Inter Thin