Exemple #1
0
from hellbox import Hellbox
from hellbox.jobs.dsig import InsertDummyDsig
from hellbox.jobs.fontmake import GenerateOtf, GenerateTtf

from lib.autohint import Autohint
from lib.woff import GenerateWoff
from lib.woff2 import GenerateWoff2

PostProduction = Hellbox.compose(InsertDummyDsig(), Autohint())

Hellbox.default = "build"

with Hellbox("build") as task:
    task.describe("Builds font files from source")

    source = task.read("source/*.ufo")
    otf = source >> GenerateOtf() >> PostProduction()
    ttf = source >> GenerateTtf() >> PostProduction()
    woff = ttf >> GenerateWoff()
    woff2 = ttf >> GenerateWoff2()

    otf >> task.write("build/otf")
    ttf >> task.write("build/ttf")
    woff >> task.write("build/woff")
    woff2 >> task.write("build/woff2")
Exemple #2
0
 def test_init(self):
     h = Hellbox("foo")
     assert hasattr(h, "task")
     assert type(h.task) is Task
Exemple #3
0
 def test_with(self):
     with Hellbox("foo") as task:
         assert task
         assert type(task) is Task
     assert Hellbox.find_task_by_name("foo")
Exemple #4
0
"""
Example hellfile.py

To run with development version of Hellbox, from this directory run:
> hell init (This will fail because pip doesn't know about hellbox yet)
> cd .. && ./example/.hellbox/bin/python setup.py install
> cd example && hell freeze && hell inspect
"""

from hellbox import Hellbox
from packages.test import TestUFO
from packages.generate_otf import GenerateOTF
from packages.extension import BuildRoboFontExtension

MakeOTF = Hellbox.compose(TestUFO(), GenerateOTF())

MakeExt = Hellbox.compose(BuildRoboFontExtension(info_format="yaml"))

with Hellbox("font") as task:
    task.describe("Does a little generation dance.")
    task.read("*.ufo", "src/*") >> MakeOTF() >> task.write("otf")

with Hellbox("extension") as task:
    task.describe("Builds a robofont extension in place.")
    task.requires("font")
    task.read("src") >> MakeExt() >> task.write(".")

Hellbox.default = "font"