def doOffset(self, Layer, hoffset, voffset): try: offsetCurveFilter = NSClassFromString("GlyphsFilterOffsetCurve") offsetCurveFilter.offsetLayer_offsetX_offsetY_makeStroke_autoStroke_position_error_shadow_( Layer, hoffset, voffset, False, False, 0.5, None, None) except Exception as e: print("offset failed")
def offsetLayer(thisLayer, offset, makeStroke=False, position=0.5, autoStroke=False): offsetFilter = NSClassFromString("GlyphsFilterOffsetCurve") try: # GLYPHS 3: offsetFilter.offsetLayer_offsetX_offsetY_makeStroke_autoStroke_position_metrics_error_shadow_capStyleStart_capStyleEnd_keepCompatibleOutlines_( thisLayer, offset, offset, # horizontal and vertical offset makeStroke, # if True, creates a stroke autoStroke, # if True, distorts resulting shape to vertical metrics position, # stroke distribution to the left and right, 0.5 = middle None, None, None, 0, 0, False) except: # GLYPHS 2: offsetFilter.offsetLayer_offsetX_offsetY_makeStroke_autoStroke_position_error_shadow_( thisLayer, offset, offset, # horizontal and vertical offset makeStroke, # if True, creates a stroke autoStroke, # if True, distorts resulting shape to vertical metrics position, # stroke distribution to the left and right, 0.5 = middle None, None)