| 51 | |
| 52 | |
| 53 | def step_merge_glyphs_from_ufo(path: Path, instance: ufoLib2.Font) -> None: |
| 54 | unicodes = [] |
| 55 | for glyph in instance: |
| 56 | unicodes.append(glyph.unicode) |
| 57 | ufo = ufoLib2.Font.open(path) |
| 58 | for glyph in ufo: |
| 59 | if glyph.unicode: |
| 60 | if glyph.unicode not in unicodes: |
| 61 | newName = str(hex(glyph.unicode)).upper().replace("0X","uni") |
| 62 | instance.layers.defaultLayer.insertGlyph(ufo[glyph.name],newName, overwrite=False, copy=False) |
| 63 | else: |
| 64 | instance.addGlyph(ufo[glyph.name]) |
| 65 | |
| 66 | |
| 67 | def step_set_feature_file(path: Path, name: str, instance: ufoLib2.Font) -> None: |