forked from sprang/Inkpad
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWDTextPath.h
More file actions
65 lines (50 loc) · 1.89 KB
/
WDTextPath.h
File metadata and controls
65 lines (50 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//
// WDTextPath.h
// Inkpad
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// Copyright (c) 2011-2013 Steve Sprang
//
#import "WDPath.h"
#import "WDTextRenderer.h"
typedef enum {
kWDTextPathAlignmentBaseline,
kWDTextPathAlignmentCentered, // currently unsupported
kWDTextPathAlignmentVertical // currently unsupported
} WDTextPathAlignment;
@interface WDTextPath : WDPath <NSCoding, NSCopying, WDTextRenderer> {
NSString *text_;
NSString *fontName_;
float fontSize_;
WDTextPathAlignment alignment_;
float startOffset_;
CGAffineTransform transform_;
CTFontRef fontRef_;
BOOL needsLayout_;
NSMutableArray *glyphs_;
BOOL overflow_;
CGRect styleBounds_;
NSString *cachedText_;
NSNumber *cachedStartOffset_;
}
@property (nonatomic, strong) NSString *text;
@property (nonatomic, strong) NSString *fontName;
@property (nonatomic, assign) float fontSize;
@property (nonatomic, readonly) CTFontRef fontRef;
@property (nonatomic, assign) WDTextPathAlignment alignment;
@property (nonatomic, assign) float startOffset;
@property (nonatomic, readonly) NSAttributedString *attributedString;
@property (nonatomic, strong) NSNumber *cachedStartOffset;
+ (WDTextPath *) textPathWithPath:(WDPath *)path;
- (void) setFontName:(NSString *)fontName;
- (void) setFontSize:(float)fontSize;
- (void) moveStartKnobToNearestPoint:(CGPoint)pt;
- (void) cacheOriginalText;
- (void) registerUndoWithCachedText;
- (void) cacheOriginalStartOffset;
- (void) registerUndoWithCachedStartOffset;
- (void) resetTransform;
@end