Runs all of the checks and corrections and generates the report. Uses https://github.com/LettError/DesignspaceProblems to check and report on issues with the design space. *designspacePath* is a `string` of the path to the designspace file *version* is a `string` that is the v
(designspacePath, version)
| 521 | |
| 522 | |
| 523 | def prep(designspacePath, version): |
| 524 | """ |
| 525 | Runs all of the checks and corrections and generates the report. |
| 526 | |
| 527 | Uses https://github.com/LettError/DesignspaceProblems to check and |
| 528 | report on issues with the design space. |
| 529 | |
| 530 | *designspacePath* is a `string` of the path to the designspace file |
| 531 | *version* is a `string` that is the version to set the font to |
| 532 | """ |
| 533 | |
| 534 | # Checking to see if there are any large issues with the designspace |
| 535 | # file before doing anything |
| 536 | dsc = DesignSpaceChecker(designspacePath) |
| 537 | assert not dsc.hasStructuralProblems() |
| 538 | |
| 539 | ds = DesignSpaceDocument.fromfile(designspacePath) |
| 540 | sources = [source.path for source in ds.sources] |
| 541 | |
| 542 | print("🏗 Opening sources") |
| 543 | fonts = [Font(path) for path in sources] |
| 544 | |
| 545 | print("🏗 Checking family name") |
| 546 | assert checkFamilyName(fonts) |
| 547 | |
| 548 | print("🏗 Removing non-exporting glyphs") |
| 549 | decomposeNonExportingGlyphs(fonts) |
| 550 | |
| 551 | print("🏗 Decomposing scaled, flipped, and nested components") |
| 552 | decomposeScaledNested(fonts) |
| 553 | |
| 554 | print("🏗 Clearing guides") |
| 555 | for font in fonts: |
| 556 | clearGuides(font) |
| 557 | |
| 558 | print("🏗 Removing glyphs that aren't in every font") |
| 559 | makeSourceFontsGlyphCompatible(fonts) |
| 560 | |
| 561 | print("🏗 Removing non-compatible glyphs") |
| 562 | makeCompatible(fonts) |
| 563 | |
| 564 | print("🏗 Making kerning compatible") |
| 565 | kerningCompatibility(fonts) |
| 566 | |
| 567 | print("🏗 Sorting glyph order to be common") |
| 568 | sortGlyphOrder(fonts) |
| 569 | |
| 570 | print("🏗 Setting production names") |
| 571 | setProductionNames(fonts) |
| 572 | |
| 573 | print("🏗 Setting version") |
| 574 | if version: |
| 575 | setVersion(fonts, version) |
| 576 | |
| 577 | print("🏗 Closing and saving sources") |
| 578 | for font in fonts: |
| 579 | font.close(save=True) |
| 580 |
no test coverage detected