MCPcopy
hub / github.com/larsenwork/monoid / _build

Function _build

Scripts/fontbuilder.py:67–96  ·  view source on GitHub ↗
(dstdir, font, permutations)

Source from the content-addressed store, hash-verified

65 yield(int(float(i)/bitmap_max*100), opts)
66
67def _build(dstdir, font, permutations):
68 # Ensure that the destination directory exists
69 try:
70 mkdir(dstdir)
71 except OSError:
72 pass
73
74 for prcnt, opts in permutations:
75 # Open the original font
76 fnt = fontforge.open(font)
77
78 # Get the base name for the font
79 name = join(dstdir, fnt.fontname)
80
81 for opt in opts:
82 # Append this option to the font name
83 name += '-' + str(opt)
84 # Run all the operations for this option
85 for oper in option.operations[opt]:
86 oper(fnt)
87
88 # Add the extension
89 name += ".ttf"
90
91 # Output the file and cleanup
92 fnt.generate(name)
93 fnt.close()
94
95 # Log progress to prevent timeoout
96 print(str(prcnt) + '%.. ' + name)
97
98def build(dstdir, font):
99 _build(dstdir, font, permutations())

Callers 2

buildFunction · 0.85
build_batchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected