Skip to content

Instantly share code, notes, and snippets.

@chrissimpkins
Last active November 14, 2023 06:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save chrissimpkins/f39e85f5f157d839e46168de1b61a174 to your computer and use it in GitHub Desktop.
Save chrissimpkins/f39e85f5f157d839e46168de1b61a174 to your computer and use it in GitHub Desktop.
linespace.sh
#!/bin/sh
# //////////////////////////////////////////////////////////////////////
#
# linespace.sh
# A shell script that modifies all .otf and .ttf fonts in the
# working directory to $PERCENT_UPM% UPM line spacing
# Copyright 2018 Christopher Simpkins
# MIT License
#
# Dependency: font-line (https://github.com/source-foundry/font-line)
# install project from PyPI with: `pip install font-line`
#
# Usage: Modify PERCENT_UPM to the desired value, save, then:
# $ chmod +x linespace.sh
# $ ./linespace.sh
#
# //////////////////////////////////////////////////////////////////////
# Define the percent UPM value for the line spacing modification below
PERCENT_UPM=15
#############################
# Do not edit below this line
#############################
# confirm font-line install, if not present install it
if which font-line; then
echo "font-line executable detected"
else
pip install font-line
fi
# modify all .ttf and .otf files in working directory with defined % UPM line spacing
font-line percent $PERCENT_UPM *.ttf *.otf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment