Skip to content

Instantly share code, notes, and snippets.

@xinhaoyuan
Created October 16, 2017 17:33
Show Gist options
  • Save xinhaoyuan/2acc46b0b4c7b08246fdedf4d247846c to your computer and use it in GitHub Desktop.
Save xinhaoyuan/2acc46b0b4c7b08246fdedf4d247846c to your computer and use it in GitHub Desktop.
#!/bin/sh
# Consolas family has been rendered weirdly on Linux.
# Use fontforge to modify vertical metric fix the issue,
# but I am not complete sure since it's my first time to do it.
# It requires fontforge to be installed.
for ttf in consola*; do
fontforge -lang=ff -script <<EOF
Open("$ttf")
SetOS2Value("HHeadAscent", 1621)
SetOS2Value("HHeadDescent", -427)
# SetOS2Value("TypoAscent", 1621) # Do we need these? Ignoring them looks fine ...
# SetOS2Value("TypoDescent", -427)
Generate("$ttf")
EOF
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment