Checks all glyphs in *fonts* for compatibility. Removes any glyphs that aren't compatible from all of the fonts. *fonts* is a `list` of font objects (Defcon or FontParts).
(fonts)
| 492 | |
| 493 | |
| 494 | def makeCompatible(fonts): |
| 495 | """ |
| 496 | Checks all glyphs in *fonts* for compatibility. Removes any glyphs that |
| 497 | aren't compatible from all of the fonts. |
| 498 | |
| 499 | *fonts* is a `list` of font objects (Defcon or FontParts). |
| 500 | """ |
| 501 | |
| 502 | local_report = report.get("Removed non-compatible glyphs", []) |
| 503 | nonCompatible = [] |
| 504 | |
| 505 | for glyph in fonts[0]: |
| 506 | for font in fonts[1:]: |
| 507 | if glyph.name in font.keys(): |
| 508 | compatibility = glyph.isCompatible(font[glyph.name]) |
| 509 | if not compatibility[0]: |
| 510 | nonCompatible.append((glyph.name, str(compatibility))) |
| 511 | else: |
| 512 | nonCompatible.append((glyph.name, "Missing in font")) |
| 513 | |
| 514 | for font in fonts: |
| 515 | removeGlyphs(font, [name for name, _ in nonCompatible]) |
| 516 | |
| 517 | if nonCompatible != []: |
| 518 | local_report.append(nonCompatible) |
| 519 | |
| 520 | report["Removed non-compatible glyphs"] = local_report |
| 521 | |
| 522 | |
| 523 | def prep(designspacePath, version): |