(dstdir, font, permutations)
| 65 | yield(int(float(i)/bitmap_max*100), opts) |
| 66 | |
| 67 | def _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 | |
| 98 | def build(dstdir, font): |
| 99 | _build(dstdir, font, permutations()) |
no outgoing calls
no test coverage detected