MCPcopy
hub / github.com/microsoft/cascadia-code / step_merge_glyphs_from_ufo

Function step_merge_glyphs_from_ufo

build.py:53–64  ·  view source on GitHub ↗
(path: Path, instance: ufoLib2.Font)

Source from the content-addressed store, hash-verified

51
52
53def 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
67def step_set_feature_file(path: Path, name: str, instance: ufoLib2.Font) -> None:

Callers 1

prepare_fontsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected