MCPcopy
hub / github.com/arrowtype/recursive / makeWOFF

Function makeWOFF

mastering/utils.py:69–93  ·  view source on GitHub ↗

Makes WOFF2 files from list of paths. *files* is a `list` of file paths as `string` *destination* is a `string` of the destination to save the WOFF files.

(files, destination)

Source from the content-addressed store, hash-verified

67
68
69def makeWOFF(files, destination):
70 """
71 Makes WOFF2 files from list of paths.
72
73 *files* is a `list` of file paths as `string`
74 *destination* is a `string` of the destination to save the WOFF files.
75 """
76 from fontTools.ttLib import woff2
77 from fontTools.ttx import makeOutputFileName
78
79 if not os.path.exists(destination):
80 os.mkdir(destination)
81
82 print("🏗 Making WOFF2")
83 printProgressBar(0, len(files), prefix=' ', suffix='Complete', length=50)
84 for i, file in enumerate(files):
85 outfilename = makeOutputFileName(file,
86 outputDir=destination,
87 extension='.woff2')
88 if os.path.exists(outfilename):
89 os.remove(outfilename)
90
91 woff2.compress(file, outfilename)
92 printProgressBar(i + 1, len(files), prefix=' ',
93 suffix='Complete', length=50)
94
95
96def batchCheckOutlines(root):

Callers 2

build.pyFile · 0.90
utils.pyFile · 0.85

Calls 1

printProgressBarFunction · 0.85

Tested by

no test coverage detected