Skip to content

Instantly share code, notes, and snippets.

@konsumer
Created June 15, 2021 16:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save konsumer/39d6eba6e0ef14b2d00c593006edcabc to your computer and use it in GitHub Desktop.
Save konsumer/39d6eba6e0ef14b2d00c593006edcabc to your computer and use it in GitHub Desktop.
This will install Apple SF & NY fonts on Linux. Tested on Pop!OS (similar to Ubuntu) 20.10.
#!/bin/bash
# Install Apple fonts on Linux
# requires p7zip-full installed
getFont() {
NAME=$1
APPLENAME=$2
DIR=$3
DIR=${DIR:="/tmp"}
if [ ! -f "${DIR}/${NAME}.dmg" ];then
wget "https://devimages-cdn.apple.com/design/resources/download/${NAME}.dmg" -O "${DIR}/${NAME}.dmg"
fi
cd "${DIR}"
7z x -ao "${NAME}.dmg"
cd "${APPLENAME}"
7z x -ao *.pkg
7z x -ao Payload~
cp Library/Fonts/*.otf Library/Fonts/*.ttf ~/.local/share/fonts
}
mkdir -p ~/.local/share/fonts
getFont SF-Pro SanFranciscoPro
getFont SF-Compact SanFranciscoCompact
getFont SF-Mono SFMonoFonts
getFont SF-Arabic SFArabicFonts
getFont NY NYFonts
fc-cache -f -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment