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)
| 67 | |
| 68 | |
| 69 | def 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 | |
| 96 | def batchCheckOutlines(root): |
no test coverage detected