Skip to content

Commit

Permalink
attempt at fixing names for Windows, re issue #519
Browse files Browse the repository at this point in the history
  • Loading branch information
rsms committed Jun 8, 2023
1 parent 036a037 commit 6e73e79
Show file tree
Hide file tree
Showing 8 changed files with 457 additions and 255 deletions.
366 changes: 183 additions & 183 deletions Makefile

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions misc/dist/inter.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,21 @@
@font-face { font-family: "Inter"; font-style: italic; font-weight: 780; font-display: swap; src: url("Inter-ExtraBoldItalic.woff2?v=3.19") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 900; font-display: swap; src: url("Inter-Black.woff2?v=3.19") format("woff2"); }
@font-face { font-family: "Inter"; font-style: italic; font-weight: 900; font-display: swap; src: url("Inter-BlackItalic.woff2?v=3.19") format("woff2"); }
@font-face { font-family: "InterDisplay"; font-style: normal; font-weight: 100; font-display: swap; src: url("Inter-DisplayThin.woff2?v=3.19") format("woff2"); }
@font-face { font-family: "InterDisplay"; font-style: italic; font-weight: 100; font-display: swap; src: url("Inter-DisplayThinItalic.woff2?v=3.19") format("woff2"); }
@font-face { font-family: "InterDisplay"; font-style: normal; font-weight: 200; font-display: swap; src: url("Inter-DisplayExtraLight.woff2?v=3.19") format("woff2"); }
@font-face { font-family: "InterDisplay"; font-style: italic; font-weight: 200; font-display: swap; src: url("Inter-DisplayExtraLightItalic.woff2?v=3.19") format("woff2"); }
@font-face { font-family: "InterDisplay"; font-style: normal; font-weight: 300; font-display: swap; src: url("Inter-DisplayLight.woff2?v=3.19") format("woff2"); }
@font-face { font-family: "InterDisplay"; font-style: italic; font-weight: 300; font-display: swap; src: url("Inter-DisplayLightItalic.woff2?v=3.19") format("woff2"); }
@font-face { font-family: "InterDisplay"; font-style: normal; font-weight: 400; font-display: swap; src: url("Inter-DisplayRegular.woff2?v=3.19") format("woff2"); }
@font-face { font-family: "InterDisplay"; font-style: italic; font-weight: 400; font-display: swap; src: url("Inter-DisplayItalic.woff2?v=3.19") format("woff2"); }
@font-face { font-family: "InterDisplay"; font-style: normal; font-weight: 500; font-display: swap; src: url("Inter-DisplayMedium.woff2?v=3.19") format("woff2"); }
@font-face { font-family: "InterDisplay"; font-style: italic; font-weight: 500; font-display: swap; src: url("Inter-DisplayMediumItalic.woff2?v=3.19") format("woff2"); }
@font-face { font-family: "InterDisplay"; font-style: normal; font-weight: 580; font-display: swap; src: url("Inter-DisplaySemiBold.woff2?v=3.19") format("woff2"); }
@font-face { font-family: "InterDisplay"; font-style: italic; font-weight: 580; font-display: swap; src: url("Inter-DisplaySemiBoldItalic.woff2?v=3.19") format("woff2"); }
@font-face { font-family: "InterDisplay"; font-style: normal; font-weight: 660; font-display: swap; src: url("Inter-DisplayBold.woff2?v=3.19") format("woff2"); }
@font-face { font-family: "InterDisplay"; font-style: italic; font-weight: 660; font-display: swap; src: url("Inter-DisplayBoldItalic.woff2?v=3.19") format("woff2"); }
@font-face { font-family: "InterDisplay"; font-style: normal; font-weight: 780; font-display: swap; src: url("Inter-DisplayExtraBold.woff2?v=3.19") format("woff2"); }
@font-face { font-family: "InterDisplay"; font-style: italic; font-weight: 780; font-display: swap; src: url("Inter-DisplayExtraBoldItalic.woff2?v=3.19") format("woff2"); }
@font-face { font-family: "InterDisplay"; font-style: normal; font-weight: 900; font-display: swap; src: url("Inter-DisplayBlack.woff2?v=3.19") format("woff2"); }
@font-face { font-family: "InterDisplay"; font-style: italic; font-weight: 900; font-display: swap; src: url("Inter-DisplayBlackItalic.woff2?v=3.19") format("woff2"); }
@font-face { font-family: "InterDisplay"; font-style: normal; font-weight: 100; font-display: swap; src: url("InterDisplay-Thin.woff2?v=3.19") format("woff2"); }
@font-face { font-family: "InterDisplay"; font-style: italic; font-weight: 100; font-display: swap; src: url("InterDisplay-ThinItalic.woff2?v=3.19") format("woff2"); }
@font-face { font-family: "InterDisplay"; font-style: normal; font-weight: 200; font-display: swap; src: url("InterDisplay-ExtraLight.woff2?v=3.19") format("woff2"); }
@font-face { font-family: "InterDisplay"; font-style: italic; font-weight: 200; font-display: swap; src: url("InterDisplay-ExtraLightItalic.woff2?v=3.19") format("woff2"); }
@font-face { font-family: "InterDisplay"; font-style: normal; font-weight: 300; font-display: swap; src: url("InterDisplay-Light.woff2?v=3.19") format("woff2"); }
@font-face { font-family: "InterDisplay"; font-style: italic; font-weight: 300; font-display: swap; src: url("InterDisplay-LightItalic.woff2?v=3.19") format("woff2"); }
@font-face { font-family: "InterDisplay"; font-style: normal; font-weight: 400; font-display: swap; src: url("InterDisplay-Regular.woff2?v=3.19") format("woff2"); }
@font-face { font-family: "InterDisplay"; font-style: italic; font-weight: 400; font-display: swap; src: url("InterDisplay-Italic.woff2?v=3.19") format("woff2"); }
@font-face { font-family: "InterDisplay"; font-style: normal; font-weight: 500; font-display: swap; src: url("InterDisplay-Medium.woff2?v=3.19") format("woff2"); }
@font-face { font-family: "InterDisplay"; font-style: italic; font-weight: 500; font-display: swap; src: url("InterDisplay-MediumItalic.woff2?v=3.19") format("woff2"); }
@font-face { font-family: "InterDisplay"; font-style: normal; font-weight: 580; font-display: swap; src: url("InterDisplay-SemiBold.woff2?v=3.19") format("woff2"); }
@font-face { font-family: "InterDisplay"; font-style: italic; font-weight: 580; font-display: swap; src: url("InterDisplay-SemiBoldItalic.woff2?v=3.19") format("woff2"); }
@font-face { font-family: "InterDisplay"; font-style: normal; font-weight: 660; font-display: swap; src: url("InterDisplay-Bold.woff2?v=3.19") format("woff2"); }
@font-face { font-family: "InterDisplay"; font-style: italic; font-weight: 660; font-display: swap; src: url("InterDisplay-BoldItalic.woff2?v=3.19") format("woff2"); }
@font-face { font-family: "InterDisplay"; font-style: normal; font-weight: 780; font-display: swap; src: url("InterDisplay-ExtraBold.woff2?v=3.19") format("woff2"); }
@font-face { font-family: "InterDisplay"; font-style: italic; font-weight: 780; font-display: swap; src: url("InterDisplay-ExtraBoldItalic.woff2?v=3.19") format("woff2"); }
@font-face { font-family: "InterDisplay"; font-style: normal; font-weight: 900; font-display: swap; src: url("InterDisplay-Black.woff2?v=3.19") format("woff2"); }
@font-face { font-family: "InterDisplay"; font-style: italic; font-weight: 900; font-display: swap; src: url("InterDisplay-BlackItalic.woff2?v=3.19") format("woff2"); }
8 changes: 4 additions & 4 deletions misc/makezip2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ cp misc/dist/help.txt "$ZIPDIR/help.txt"
cp build/fonts/static-hinted/Inter.ttc "$ZIPDIR/Inter.ttc"
cp build/fonts/var/Inter-Variable.ttf "$ZIPDIR/Inter-Variable.ttf"
cp build/fonts/var/Inter-Variable-Italic.ttf "$ZIPDIR/Inter-Variable-Italic.ttf"
cp build/fonts/static/Inter-*.woff2 "$ZIPDIR/web/" &
cp build/fonts/static/Inter*.woff2 "$ZIPDIR/web/" &
cp build/fonts/var/Inter-Variable.woff2 "$ZIPDIR/web/InterVariable.woff2"
cp build/fonts/var/Inter-Variable-Italic.woff2 "$ZIPDIR/web/InterVariable-Italic.woff2"
cp misc/dist/inter.css "$ZIPDIR/web/"
Expand All @@ -67,9 +67,9 @@ mkdir -p "$ZIPDIR/extras/otf" \
"$ZIPDIR/extras/ttf" \
"$ZIPDIR/extras/woff-hinted"

cp build/fonts/static/Inter-*.otf "$ZIPDIR/extras/otf/" &
cp build/fonts/static-hinted/Inter-*.ttf "$ZIPDIR/extras/ttf/" &
cp build/fonts/static-hinted/Inter-*.woff2 "$ZIPDIR/extras/woff-hinted/" &
cp build/fonts/static/Inter*.otf "$ZIPDIR/extras/otf/" &
cp build/fonts/static-hinted/Inter*.ttf "$ZIPDIR/extras/ttf/" &
cp build/fonts/static-hinted/Inter*.woff2 "$ZIPDIR/extras/woff-hinted/" &



Expand Down
26 changes: 18 additions & 8 deletions misc/tools/gen-instance-ufo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,32 @@ INSTANCE_SemiBold="Inter SemiBold"
INSTANCE_Bold="Inter Bold"
INSTANCE_ExtraBold="Inter ExtraBold"

INSTANCE_DisplayLight="Inter Display Light"
INSTANCE_DisplayExtraLight="Inter Display ExtraLight"
INSTANCE_DisplayMedium="Inter Display Medium"
INSTANCE_DisplaySemiBold="Inter Display SemiBold"
INSTANCE_DisplayBold="Inter Display Bold"
INSTANCE_DisplayExtraBold="Inter Display ExtraBold"

INSTANCE_LightItalic="Inter Light Italic"
INSTANCE_ExtraLightItalic="Inter ExtraLight Italic"
INSTANCE_MediumItalic="Inter Medium Italic"
INSTANCE_SemiBoldItalic="Inter SemiBold Italic"
INSTANCE_BoldItalic="Inter Bold Italic"
INSTANCE_ExtraBoldItalic="Inter ExtraBold Italic"

INSTANCE_DisplayThin="Inter Display Thin"
INSTANCE_DisplayLight="Inter Display Light"
INSTANCE_DisplayExtraLight="Inter Display ExtraLight"
INSTANCE_DisplayRegular="Inter Display Regular"
INSTANCE_DisplayMedium="Inter Display Medium"
INSTANCE_DisplaySemiBold="Inter Display SemiBold"
INSTANCE_DisplayBold="Inter Display Bold"
INSTANCE_DisplayExtraBold="Inter Display ExtraBold"
INSTANCE_DisplayBlack="Inter Display Black"

INSTANCE_DisplayThinItalic="Inter Display Thin Italic"
INSTANCE_DisplayLightItalic="Inter Display Light Italic"
INSTANCE_DisplayExtraLightItalic="Inter Display ExtraLight Italic"
INSTANCE_DisplayItalic="Inter Display Italic"
INSTANCE_DisplayMediumItalic="Inter Display Medium Italic"
INSTANCE_DisplaySemiBoldItalic="Inter Display SemiBold Italic"
INSTANCE_DisplayBoldItalic="Inter Display Bold Italic"
INSTANCE_DisplayExtraBoldItalic="Inter Display ExtraBold Italic"
INSTANCE_DisplayBlackItalic="Inter Display Black Italic"

MASTER_Thin=1
MASTER_Regular=1
Expand All @@ -49,7 +55,10 @@ _err() { echo "$PROG: $@" >&2; exit 1; }

# build/ufo/Inter-DisplayExtraBold.ufo -> DisplayExtraBold
UFO_NAME=$(basename "$UFO" .ufo)
case "$UFO_NAME" in Inter-*) UFO_NAME=${UFO_NAME:6} ;; esac
case "$UFO_NAME" in
Inter-*) UFO_NAME=${UFO_NAME:6} ;;
InterDisplay-*) UFO_NAME=Display${UFO_NAME:13} ;;
esac

# DisplayExtraBold -> "Inter Display ExtraBold"
INSTANCE=INSTANCE_${UFO_NAME} ; INSTANCE=${!INSTANCE}
Expand All @@ -59,6 +68,7 @@ INSTANCE=INSTANCE_${UFO_NAME} ; INSTANCE=${!INSTANCE}
if [ -z "$INSTANCE" ]; then
MASTER=MASTER_${UFO_NAME}
[ -n "${!MASTER}" ] || _err "Failed to map UFO name \"$UFO_NAME\" to instance"
[ -d "$UFO" ] || _err "Cannot find master UFO: $UFO"
echo "touch $UFO"
touch "$UFO"
exit
Expand Down
15 changes: 14 additions & 1 deletion misc/tools/postprocess-designspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), 'tools')))
from common import getGitHash, getVersion
from postprocess_instance_ufo import ufo_set_wws


OPT_EDITABLE = False # --editable
Expand Down Expand Up @@ -45,6 +44,20 @@ def update_version(ufo):
ufo.info.openTypeHeadCreated = now.strftime("%Y/%m/%d %H:%M:%S")


def ufo_set_wws(ufo):
# Fix missing WWS entries for Display fonts:
# See https://github.com/googlefonts/glyphsLib/issues/820
subfamily = ufo.info.styleName
if subfamily.find("Display") == -1:
return
subfamily = subfamily[len("Display"):].strip()
if subfamily == "":
# "Display" -> "Regular"
subfamily = "Regular"
ufo.info.openTypeNameWWSFamilyName = "Inter Display"
ufo.info.openTypeNameWWSSubfamilyName = subfamily


def fix_opsz_range(designspace):
opsz_min = 1000000
opsz_max = 0
Expand Down
23 changes: 0 additions & 23 deletions misc/tools/postprocess_instance_ufo.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
import sys
import defcon

def ufo_set_wws(ufo):
# Fix missing WWS entries for Display fonts:
# See https://github.com/googlefonts/glyphsLib/issues/820
subfamily = ufo.info.styleName
if subfamily.find("Display") == -1:
return
subfamily = subfamily[len("Display"):].strip()
if subfamily == "":
# "Display" -> "Regular"
subfamily = "Regular"
ufo.info.openTypeNameWWSFamilyName = "Inter Display"
ufo.info.openTypeNameWWSSubfamilyName = subfamily


# See https://github.com/rsms/inter/issues/508
# TODO: Remove when https://github.com/googlefonts/glyphsLib/issues/821 is fixed
Expand All @@ -30,18 +17,8 @@ def fix_fractional_advance_width(ufo):

def main(argv):
ufo_file = argv[1]

# TODO: Uncomment when https://github.com/googlefonts/glyphsLib/issues/821 is fixed
# if ufo_file.find("Display") == -1:
# return # skip fonts of "default" family

ufo = defcon.Font(ufo_file)

if ufo_file.find("Display") != -1:
ufo_set_wws(ufo)

fix_fractional_advance_width(ufo)

ufo.save(ufo_file)


Expand Down
Loading

0 comments on commit 6e73e79

Please sign in to comment.