From dfe6b939c719410b73aa965016173b50b5b55995 Mon Sep 17 00:00:00 2001 From: Rasmus Andersson Date: Mon, 7 Jan 2019 09:15:58 -0800 Subject: upgrade ufo2ft that includes fixed fonttools. This means we can also drop our temporary fonttools patch. Related to https://github.com/fonttools/fonttools/pull/1430 and https://github.com/googlei18n/ufo2ft/issues/306 --- init.sh | 10 --------- misc/fonttools-3.34.2-psCharStrings.patch | 37 ------------------------------- requirements.txt | 2 +- 3 files changed, 1 insertion(+), 48 deletions(-) delete mode 100644 misc/fonttools-3.34.2-psCharStrings.patch diff --git a/init.sh b/init.sh index 18dbd0143..aec63a02d 100755 --- a/init.sh +++ b/init.sh @@ -130,16 +130,6 @@ else date '+%s' > "$UPDATE_TIMESTAMP_FILE" fi - # patch fonttools [BUG #110] - P1_FILE="$VENV_DIR/lib/python/site-packages/fontTools/misc/psCharStrings.py" - P1_BACKUP="$P1_FILE.orig" - if [[ ! -f "$P1_BACKUP" ]]; then - echo "Patching $P1_FILE (backup at $P1_BACKUP)" - mv "$P1_FILE" "$P1_BACKUP" - patch "$P1_BACKUP" -o "$P1_FILE" -u -i \ - misc/fonttools-3.34.2-psCharStrings.patch - fi - # —————————————————————————————————————————————————————————————————— # activate env (for rest of this script) diff --git a/misc/fonttools-3.34.2-psCharStrings.patch b/misc/fonttools-3.34.2-psCharStrings.patch deleted file mode 100644 index 7be387201..000000000 --- a/misc/fonttools-3.34.2-psCharStrings.patch +++ /dev/null @@ -1,37 +0,0 @@ ---- a/fontTools/misc/psCharStrings.py -+++ b/fontTools/misc/psCharStrings.py -@@ -223,9 +223,16 @@ - else: - return b"\xff" + pack(">l", value) # encode the entire fixed point value - -+ -+realZeroBytes = bytechr(30) + bytechr(0xf) -+ - def encodeFloat(f): - # For CFF only, used in cffLib -- s = str(f).upper() -+ if f == 0.0: # 0.0 == +0.0 == -0.0 -+ return realZeroBytes -+ # Note: 14 decimal digits seems to be the limitation for CFF real numbers -+ # in macOS. However, we use 8 here to match the implementation of AFDKO. -+ s = "%.8G" % f - if s[:2] == "0.": - s = s[1:] - elif s[:3] == "-0.": -@@ -234,9 +241,13 @@ - while s: - c = s[0] - s = s[1:] -- if c == "E" and s[:1] == "-": -- s = s[1:] -- c = "E-" -+ if c == "E": -+ c2 = s[:1] -+ if c2 == "-": -+ s = s[1:] -+ c = "E-" -+ elif c2 == "+": -+ s = s[1:] - nibbles.append(realNibblesDict[c]) - nibbles.append(0xf) - if len(nibbles) % 2: diff --git a/requirements.txt b/requirements.txt index 605b3659e..4dec1e50f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ glyphsLib==3.1.4 skia-pathops==0.2.0.post2 -fonttools[ufo,lxml,unicode]==3.34.2 +ufo2ft==2.6.0 fontmake==1.8.0 fs==2.2.0 -- cgit v1.2.3