Script code for Offset curve


Does anyone know what script I could use to Offset path my curve instead of doing it by The filter (+20k complex Chinese glyphs, the software crashes :frowning: )

Thanks a lot!

Does this code help:

OffsetCurve = objc.lookUpClass("GlyphsFilterOffsetCurve")
from AppKit import NSButtLineCapStyle

offset = (20, 10)
makeStroke = True
position = 0.5
OffsetCurve.offsetLayer_offsetX_offsetY_makeStroke_autoStroke_position_error_shadow_capStyle_(Layer, offset[0], offset[1], makeStroke, False, position, None, None, NSButtLineCapStyle)

This no longer works as of 3.0.3:

AttributeError: No attribute offsetLayer_offsetX_offsetY_makeStroke_autoStroke_position_error_shadow_capStyle_


offsetCurve = objc.lookUpClass("GlyphsFilterOffsetCurve")
print([x for x in dir(offsetCurve) if "offset" in x])


['offsetXField', 'offsetYField']
+ (NSArray *)offsetPath:(GSPath *)currPath offsetX:(CGFloat)OffsetX offsetY:(CGFloat)OffsetY makeStroke:(BOOL)MakeStroke position:(float)Position objects:(NSMutableArray *)returnObjects capStyleStart:(GSLineCapStyle)capStyleStart capStyleEnd:(GSLineCapStyle)capStyleEnd