Writes out the report text file from the report dictionary to the given *path*. *path* is a `string` of the path to write to
(path)
| 87 | |
| 88 | |
| 89 | def writeReport(path): |
| 90 | """ |
| 91 | Writes out the report text file from the report dictionary to |
| 92 | the given *path*. |
| 93 | |
| 94 | *path* is a `string` of the path to write to |
| 95 | """ |
| 96 | |
| 97 | seperator = "\n_________________________" |
| 98 | |
| 99 | final_report = [seperator, "Cleared guidelines in:"] |
| 100 | if report["Clear Guidelines"]: |
| 101 | for font, glyphs in report["Clear Guidelines"]: |
| 102 | final_report.append(f"\t{font}") |
| 103 | if glyphs: |
| 104 | final_report.append(f"\t\tAnd these glyphs: {' '.join(glyphs)}") |
| 105 | else: |
| 106 | final_report.append("None! No guidelines to remove") |
| 107 | |
| 108 | final_report.append(seperator) |
| 109 | final_report.append("Decomposed and removed these non-exporting glyphs:") |
| 110 | if report["Non-exporting glyphs"]: |
| 111 | for font, glyphs in report["Non-exporting glyphs"]: |
| 112 | final_report.append(f"\t{font}") |
| 113 | final_report.append(f"\t\t{', '.join(glyphs)}") |
| 114 | else: |
| 115 | final_report.append("None! No glyphs to remove") |
| 116 | |
| 117 | final_report.append(seperator) |
| 118 | final_report.append("Removed these glyphs that were not common to all sources:") |
| 119 | if report["Removed Glyphs"]: |
| 120 | for font, glyphs in report["Removed Glyphs"]: |
| 121 | final_report.append(f"\t{font}") |
| 122 | final_report.append(f"\t\t{', '.join(glyphs)}") |
| 123 | else: |
| 124 | final_report.append("None! No glyphs to remove") |
| 125 | |
| 126 | final_report.append(seperator) |
| 127 | final_report.append("Removed these non-compatible glyphs:") |
| 128 | if report["Removed non-compatible glyphs"]: |
| 129 | for glyph, reason in report["Removed non-compatible glyphs"]: |
| 130 | final_report.append(f"\t{glyph} because:") |
| 131 | final_report.append(f"\t\t{reason}") |
| 132 | else: |
| 133 | final_report.append("None! No glyphs to remove") |
| 134 | |
| 135 | final_report.append(seperator) |
| 136 | final_report.append("Added blank kerning to these fonts:") |
| 137 | if report["Added blank kerning"]: |
| 138 | for font in report["Added blank kerning"]: |
| 139 | final_report.append(f"\t{font}") |
| 140 | else: |
| 141 | final_report.append("None! All fonts had kerning.") |
| 142 | |
| 143 | final_report.append(seperator) |
| 144 | final_report.append("Reported designspace problems from DesignspaceProblems:") |
| 145 | if report["Designspace check"]: |
| 146 | for problem in report["Designspace check"]: |