From dee86b504c021bd465e124360a035d72e7abaa6d Mon Sep 17 00:00:00 2001 From: Rasmus Andersson Date: Sat, 5 Jan 2019 11:41:37 -0800 Subject: patches ufo2ft and drops python 2 env for OTF compilation --- misc/fontbuild | 11 ++++++++++- misc/fontbuild2 | 6 ------ misc/ufo2ft-2.5.0-outlineCompiler.patch | 18 ++++++++++++++++++ 3 files changed, 28 insertions(+), 7 deletions(-) delete mode 100755 misc/fontbuild2 create mode 100644 misc/ufo2ft-2.5.0-outlineCompiler.patch (limited to 'misc') diff --git a/misc/fontbuild b/misc/fontbuild index cf5d21f68..8b3e924fd 100755 --- a/misc/fontbuild +++ b/misc/fontbuild @@ -197,7 +197,16 @@ def setFontInfo(font, weight): # family = font.info.familyName # i.e. "Inter UI" style = font.info.styleName # e.g. "Medium Italic" - isitalic = font.info.italicAngle != 0 + + # Patch italicAngle to be either positive zero or single-decimal precision + # floating-point number. + # This value can go wrong since we are using floating-point numbers. + isitalic = False + if font.info.italicAngle != 0: + isitalic = True + font.info.italicAngle = round(font.info.italicAngle, 1) + else: + font.info.italicAngle = 0 # weight font.info.openTypeOS2WeightClass = weight diff --git a/misc/fontbuild2 b/misc/fontbuild2 deleted file mode 100755 index bece1063c..000000000 --- a/misc/fontbuild2 +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -pushd "$(dirname "$0")/.." >/dev/null -SRCDIR=$(PWD) -popd >/dev/null - -"$SRCDIR/build/venv2/bin/python" misc/fontbuild "$@" diff --git a/misc/ufo2ft-2.5.0-outlineCompiler.patch b/misc/ufo2ft-2.5.0-outlineCompiler.patch new file mode 100644 index 000000000..dd500992c --- /dev/null +++ b/misc/ufo2ft-2.5.0-outlineCompiler.patch @@ -0,0 +1,18 @@ +--- a/ufo2ft/outlineCompiler.py ++++ b/ufo2ft/outlineCompiler.py +@@ -983,7 +983,14 @@ + topDict.UnderlineThickness = otRound(underlineThickness) + # populate font matrix + unitsPerEm = otRound(getAttrWithFallback(info, "unitsPerEm")) +- topDict.FontMatrix = [1.0 / unitsPerEm, 0, 0, 1.0 / unitsPerEm, 0, 0] ++ topDict.FontMatrix = [ ++ round(1.0 / unitsPerEm, 14), ++ 0, ++ 0, ++ round(1.0 / unitsPerEm, 14), ++ 0, ++ 0 ++ ] + # populate the width values + if not any(hasattr(info, attr) and getattr(info, attr) is not None + for attr in ("postscriptDefaultWidthX", -- cgit v1.2.3