MCPcopy
hub / github.com/larsenwork/monoid / Swap

Function Swap

Scripts/fontbuilder.py:126–133  ·  view source on GitHub ↗

Swaps the places of two glyphs

(glyph1, glyph2)

Source from the content-addressed store, hash-verified

124 return bearing_op
125
126def Swap(glyph1, glyph2):
127 """Swaps the places of two glyphs"""
128 def swap_op(fnt):
129 # Unlike selections, glyph layer data is returned as a copy
130 swp = fnt[glyph1].foreground
131 fnt[glyph1].foreground = fnt[glyph2].foreground
132 fnt[glyph2].foreground = swp
133 return swap_op
134
135def SwapLookup(lookup):
136 """Swaps the places of glyphs based on an OpenType lookup table"""

Callers 1

build.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected