summaryrefslogtreecommitdiff
path: root/scripts/build-v2.py
diff options
context:
space:
mode:
authorJames Godfrey-Kittle <jamesgk@google.com>2015-02-21 15:53:31 -0800
committerJames Godfrey-Kittle <jamesgk@google.com>2015-04-16 12:16:30 -0700
commit042986cb67b530d2f55df82cab8872a4cb737615 (patch)
treec172bb96b9e962528933cdcf88e99abfa506e3d6 /scripts/build-v2.py
parentb3b20da46450ae0f09194513e35537a4f60e0ec0 (diff)
Separate sans and condensed build scripts.
Currently the condensed fonts are not building correctly in the default script. This is probably not an ideal solution since the sans and condensed fonts share the same source files.
Diffstat (limited to 'scripts/build-v2.py')
-rw-r--r--scripts/build-v2.py55
1 files changed, 2 insertions, 53 deletions
diff --git a/scripts/build-v2.py b/scripts/build-v2.py
index c232ad3..c5b2171 100644
--- a/scripts/build-v2.py
+++ b/scripts/build-v2.py
@@ -2,11 +2,9 @@ import sys
sys.path.insert(0,"%s/scripts/lib"%BASEDIR)
-from robofab.objects.objectsRF import RFont, RPoint
-from fontTools.misc.transform import Transform
-from fontbuild.Build import FontProject,swapGlyphs,transformGlyphMembers
+from robofab.objects.objectsRF import RPoint
+from fontbuild.Build import FontProject
from fontbuild.mix import Mix,Master
-from fontbuild.italics import condenseGlyph, transformFLGlyphMembers
# Masters
@@ -14,43 +12,6 @@ rg = Master("%s/src/v2/Roboto_Regular.ufo"%BASEDIR)
bd = Master("%s/src/v2/Roboto_Bold.ufo"%BASEDIR)
th = Master("%s/src/v2/Roboto_Thin.ufo"%BASEDIR)
-# build condensed masters
-
-lessCondensed = "plusminus \
-bracketleft bracketright dieresis \
-macron percent \
-multiply degree at i j zero one two \
-three four five six seven eight nine braceright braceleft".split()
-uncondensed = "tonos breve acute grave quotesingle quotedbl asterisk \
-period currency registered copyright bullet ring degree dieresis comma bar brokenbar dotaccent \
-dotbelow colon semicolon uniFFFC uniFFFD uni0488 uni0489 ringbelow estimated".split()
-moreCondensed = "z Z M W A V".split()
-
-
-def condenseFont(f, scale=.8, stemWidth=185):
- xscale = scale
- CAPS = "A B C.cn D.cn E F G.cn H I J K L M N O.cn P Q.cn R S T U.cn V W X Y Z one two three four five six seven eight nine zero".split()
- LC = "a.cn b.cn c.cn d.cn e.cn f g.cn h i j k l m n o.cn p.cn q.cn r s t u v w x y z".split()
- # for g in [f[name] for name in LC]:
- for g in f:
- if (len(g) > 0):
- # print g.name
- if g.name in lessCondensed:
- scale = xscale * 1.1
- if g.name in uncondensed:
- continue
- if g.name in moreCondensed:
- scale = xscale * .90
- # g2 = condenseGlyph(g, xscale)
- # g.clear()
- # g2.drawPoints(g.getPointPen())
- m = Transform(xscale, 0, 0, 1, 20, 0)
- g.transform(m)
- transformFLGlyphMembers(g,m,transformAnchors=False)
- g.width += 40
- return f
-
-
proj = FontProject(rg.font, BASEDIR, "res/roboto.cfg", th.ffont)
#proj.incrementBuildNumber()
@@ -78,16 +39,4 @@ proj.generateFont(Mix([rg,bd], 0.35),"%s/Medium Italic/Bold Italic/Lt"%FAMILYNAM
proj.generateFont(Mix([rg,bd], RPoint(0.73, 0.73)),"%s/Bold Italic/Bold Italic/Rg"%FAMILYNAME, italic=True, stemWidth=290)
proj.generateFont(Mix([rg,bd], RPoint(1.125, 1.0)),"%s/Black Italic/Bold Italic/Bk"%FAMILYNAME, italic=True, stemWidth=290)
-thcn1 = Master(condenseFont(th.font, .84, 40))
-cn1 = Master( rg.ffont.addDiff(thcn1.ffont, th.ffont))
-bdcn1 = Master( bd.ffont.addDiff(thcn1.ffont, th.ffont))
-
-proj.generateFont(Mix([thcn1,cn1], RPoint(0.45, 0.47)), "%s Condensed/Light/Regular/Lt"%FAMILYNAME, swapSuffixes=[".cn"])
-proj.generateFont(Mix([thcn1,cn1], RPoint(0.9, 0.92)), "%s Condensed/Regular/Regular/Rg"%FAMILYNAME, swapSuffixes=[".cn"])
-proj.generateFont(Mix([cn1,bdcn1], RPoint(0.75, 0.75)), "%s Condensed/Bold/Bold/Rg"%FAMILYNAME, swapSuffixes=[".cn"])
-
-proj.generateFont(Mix([thcn1,cn1], RPoint(0.45, 0.47)), "%s Condensed/Light Italic/Italic/Lt"%FAMILYNAME, italic=True, swapSuffixes=[".cn"], stemWidth=120)
-proj.generateFont(Mix([thcn1,cn1], RPoint(0.9, 0.92)), "%s Condensed/Italic/Italic/Rg"%FAMILYNAME, italic=True, swapSuffixes=[".cn"], stemWidth=185)
-proj.generateFont(Mix([cn1,bdcn1], RPoint(0.75, 0.75)), "%s Condensed/Bold Italic/Bold Italic/Rg"%FAMILYNAME, italic=True, swapSuffixes=[".cn"], stemWidth=240)
-
sys.exit(0)