From 6f32679e61c8ade83240251560ed8a0190779355 Mon Sep 17 00:00:00 2001 From: Dario Gjorgjevski Date: Sun, 7 Feb 2021 19:20:40 +0100 Subject: [PATCH] Make build scripts compatible with Python 3 --- Scripts/features.py | 4 +++- Scripts/fontbuilder.py | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Scripts/features.py b/Scripts/features.py index 265ecf9..88233ac 100644 --- a/Scripts/features.py +++ b/Scripts/features.py @@ -2,6 +2,8 @@ # # Adapted from https://github.com/tonsky/FiraCode/blob/master/gen_calt.clj +from __future__ import unicode_literals + from textwrap import dedent from collections import defaultdict import tempfile @@ -33,7 +35,7 @@ def update_features(font): # Add the dummy "LIG" glyph lig = font.createChar(-1, 'LIG') lig.width = font['space'].width - with tempfile.NamedTemporaryFile(suffix='.fea') as f: + with tempfile.NamedTemporaryFile(mode='w', suffix='.fea') as f: f.write(fea_code) f.seek(0) font.mergeFeature(f.name) diff --git a/Scripts/fontbuilder.py b/Scripts/fontbuilder.py index 61b5eff..5194894 100644 --- a/Scripts/fontbuilder.py +++ b/Scripts/fontbuilder.py @@ -3,6 +3,8 @@ # LICENSE: MIT # vim: sts=4 sw=4 ts=4 et +from past.builtins import xrange + import fontforge from itertools import compress import os