Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/liberationfonts/liberation-fonts.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorParag A Nemade <pnemade@fedoraproject.org>2016-10-07 09:13:23 +0300
committerParag A Nemade <pnemade@fedoraproject.org>2016-10-07 09:13:23 +0300
commit3e9226d275050a2ac2f080c8dbe54bc5bb034801 (patch)
tree4a7d5b765e64bc78a45be78fd72fcc3ba324b85e
parent1f1234e0f153532aca67cdd34774c243b7ae8567 (diff)
port Makefile and script to python3 usage
Signed-off-by: Parag A Nemade <pnemade@fedoraproject.org>
-rw-r--r--Makefile2
-rw-r--r--scripts/setisFixedPitch-fonttools.py31
2 files changed, 16 insertions, 17 deletions
diff --git a/Makefile b/Makefile
index 372a93a..d101d92 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@
# 4web: dtto for TTF, WOFF, SVG, and EOT
FONTFORGE = fontforge
-PYTHON = python
+PYTHON = python3
FONTLINT = fontlint
# TTF->EOT converters in fallback order
diff --git a/scripts/setisFixedPitch-fonttools.py b/scripts/setisFixedPitch-fonttools.py
index 7f462af..d4e9adc 100644
--- a/scripts/setisFixedPitch-fonttools.py
+++ b/scripts/setisFixedPitch-fonttools.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
#
# setisFixedPitch-fonttools.py
#
@@ -24,28 +24,27 @@
# Usage:
#
# $ ./setisFixedPitch-fonttools.py FontIn.ttf
-# "fontname"-fixed.ttf will be created with fixed isFixedPitch bit.
+# input font will be overwriten and backup will be created for input font
# Import our system library and fontTools ttLib
-import os, sys
+import sys
from fontTools import ttLib
-from fontTools.ttLib.tables import ttProgram
for i in range(1, len(sys.argv)):
# Open the font file supplied as the first argument on the command line
- fontfile = sys.argv[i]
- print fontfile
- font = ttLib.TTFont(fontfile)
+ fontfile = sys.argv[i]
+ print(fontfile)
+ font = ttLib.TTFont(fontfile)
# Print the Post table
- if font.has_key('post'):
- if font["post"].isFixedPitch == 0:
- font["post"].isFixedPitch = 1
- print "isFixedPitch is now: ", font["post"].isFixedPitch
- else:
- print "Post table not found"
+ if 'post' in font:
+ if font["post"].isFixedPitch == 0:
+ font["post"].isFixedPitch = 1
+ print("isFixedPitch is now: ", font["post"].isFixedPitch)
+ else:
+ print("Post table not found")
# Save the new file with the name of the input file
- newfont = fontfile[0:-4] + '-fixed' + fontfile[-4:]
- font.save(newfont)
- print newfont, "saved."
+ newfont = fontfile[0:-4] + '-fixed' + fontfile[-4:]
+ font.save(newfont)
+ print(newfont, "saved.")