summaryrefslogtreecommitdiff
path: root/third_party
diff options
context:
space:
mode:
authorRoozbeh Pournader <roozbeh@google.com>2014-07-26 11:21:37 -0700
committerRoozbeh Pournader <roozbeh@google.com>2014-07-26 11:21:37 -0700
commit68da4c8664d2a242a39723b90651f22812cb73e7 (patch)
tree17f7323ed6d13a1cf66815177e7dad2a448f29b0 /third_party
parent0f1bd27678fb542f8601bbaf493baa1c22732fe2 (diff)
Get fontcrunch to run in the Roboto setup.
Diffstat (limited to 'third_party')
-rw-r--r--third_party/fontcrunch/Makefile2
-rw-r--r--third_party/fontcrunch/fontcrunch.py13
2 files changed, 10 insertions, 5 deletions
diff --git a/third_party/fontcrunch/Makefile b/third_party/fontcrunch/Makefile
index e73ca38..a682f73 100644
--- a/third_party/fontcrunch/Makefile
+++ b/third_party/fontcrunch/Makefile
@@ -20,7 +20,7 @@ OPT = $(patsubst %.bz, %.bzopt, $(SRC))
dummy: $(OPT)
quadopt: quadopt.cc
- $(CXX) $< -O3 -o $@
+ $(CXX) $< -std=c++11 -O3 -o $@
%.bzopt: %.bz quadopt
./quadopt $< $@
diff --git a/third_party/fontcrunch/fontcrunch.py b/third_party/fontcrunch/fontcrunch.py
index d129452..68f68e4 100644
--- a/third_party/fontcrunch/fontcrunch.py
+++ b/third_party/fontcrunch/fontcrunch.py
@@ -14,6 +14,11 @@
#
# Contributor: Raph Levien
+import os
+import sys
+sys.path.append(
+ os.path.join(os.path.dirname(__file__), os.pardir, 'spiro', 'curves'))
+
from fontTools import ttLib
from fontTools.ttLib.tables import _g_l_y_f
import fromcubic
@@ -22,8 +27,6 @@ import pcorn
import math
import md5
-import sys
-import os
def lerppt(t, p0, p1):
return (p0[0] + t * (p1[0] - p0[0]), p0[1] + t * (p1[1] - p0[1]))
@@ -339,7 +342,8 @@ def gen_segs(glyph):
def generate(fn):
f = ttLib.TTFont(fn)
glyf = f['glyf']
- for name, g in glyf.glyphs.iteritems():
+ for name in glyf.keys():
+ g = glyf[name]
print 'generating', name
gen_segs(g)
@@ -397,7 +401,8 @@ def repack_glyph(glyph):
def repack(fn, newfn):
f = ttLib.TTFont(fn)
glyf = f['glyf']
- for name, g in glyf.glyphs.iteritems():
+ for name in glyf.keys():
+ g = glyf[name]
if not g.isComposite():
repack_glyph(g)
if newfn: