Swaps the places of two glyphs
(glyph1, glyph2)
| 124 | return bearing_op |
| 125 | |
| 126 | def 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 | |
| 135 | def SwapLookup(lookup): |
| 136 | """Swaps the places of glyphs based on an OpenType lookup table""" |