//
//  GSDrawPath.h
//  GlyphsCore
//
//  Created by Florian Pircher on 2024-11-05.
//  Copyright © 2024 schriftgestaltung.de. All rights reserved.
//

#import <GlyphsCore/GSPenProtocol.h>
#import <GlyphsCore/GSPathSegment.h>

@protocol GSDrawPath <NSCopying>

/// Whether the path is closed.
@property (nonatomic, readonly) BOOL closed NS_SWIFT_NAME(isClosed);

/// For open paths, returns the first on-curve position of the path, otherwise `GSPointNull`.
@property (nonatomic, readonly) CGPoint startPosition;

/// For open paths, returns the last on-curve position of the path, otherwise `GSPointNull`.
@property (nonatomic, readonly) CGPoint endPosition;

/// An array of pens of the same pen type representing the same overall path as the receiver but split by move-to instructions into subpaths.
- (NSArray *)subpaths;

- (NSArray<GSPathSegment *> *)segments;

@property (nonatomic, readonly) NSUInteger countOfAttributes;

@end
