Core Plot (iOS and tvOS)
Cocoa plotting framework for macOS, iOS, and tvOS
CPTTextStyle.h
Go to the documentation of this file.
1 #import "CPTDefinitions.h"
4 
5 @class CPTColor;
6 @class CPTTextStyle;
7 
12 
17 
19 
20 // font would override fontName/fontSize if not nil
21 @property (readonly, strong, nonatomic, nullable) CPTNativeFont *font;
22 @property (readonly, copy, nonatomic, nullable) NSString *fontName;
23 @property (readonly, nonatomic) CGFloat fontSize;
24 @property (readonly, copy, nonatomic, nullable) CPTColor *color;
25 @property (readonly, nonatomic) CPTTextAlignment textAlignment;
26 @property (readonly, assign, nonatomic) NSLineBreakMode lineBreakMode;
27 
30 +(nonnull instancetype)textStyle;
31 +(nonnull instancetype)textStyleWithStyle:(nullable CPTTextStyle *)textStyle;
33 
34 @end
35 
36 #pragma mark -
37 
42 
43 @property (readonly, nonatomic, nonnull) CPTDictionary *attributes;
44 
47 +(nonnull instancetype)textStyleWithAttributes:(nullable CPTDictionary *)attributes;
49 
50 @end
51 
52 #pragma mark -
53 
58 
61 -(CGSize)sizeWithTextStyle:(nullable CPTTextStyle *)style;
63 
66 -(void)drawInRect:(CGRect)rect withTextStyle:(nullable CPTTextStyle *)style inContext:(nonnull CGContextRef)context;
68 
69 @end
CPTTextStyleArray
NSArray< CPTTextStyle * > CPTTextStyleArray
An array of text styles.
Definition: CPTTextStyle.h:6
CPTTextStyle::fontName
NSString * fontName
The font name. Default is Helvetica. Ignored if font is not nil.
Definition: CPTTextStyle.h:22
NSMutableArray
CPTTextStyle::textAlignment
CPTTextAlignment textAlignment
The paragraph alignment for multi-line text. Default is CPTTextAlignmentLeft.
Definition: CPTTextStyle.h:25
CPTTextStyle(CPTPlatformSpecificTextStyleExtensions)
Platform-specific extensions to CPTTextStyle.
Definition: CPTTextStyle.h:41
CPTTextStyle::lineBreakMode
NSLineBreakMode lineBreakMode
The line break mode used when laying out the text. Default is NSLineBreakByWordWrapping .
Definition: CPTTextStyle.h:26
CPTTextAlignment
CPTTextAlignment
Enumeration of paragraph alignments.
Definition: CPTTextStylePlatformSpecific.h:6
CPTTextStyle
Immutable wrapper for various text style properties.
Definition: CPTTextStyle.h:18
CPTTextStyle(CPTPlatformSpecificTextStyleExtensions)::attributes
CPTDictionary * attributes
A dictionary of standard text attributes suitable for formatting an NSAttributedString.
Definition: CPTTextStyle.h:43
CPTColor
An immutable color.
Definition: CPTColor.h:3
CPTPlatformSpecificDefines.h
CPTTextStylePlatformSpecific.h
-[NSObject copy]
id copy
CPTTextStyle::color
CPTColor * color
The current text color. Default is solid black.
Definition: CPTTextStyle.h:24
CPTTextStyle::fontSize
CGFloat fontSize
The font size. Default is 12.0. Ignored if font is not nil.
Definition: CPTTextStyle.h:23
CGContextRef
typedef CGContextRef
CPTMutableTextStyleArray
NSMutableArray< CPTTextStyle * > CPTMutableTextStyleArray
A mutable array of text styles.
Definition: CPTTextStyle.h:16
CPTDefinitions.h
CGSize
typedef CGSize
CPTTextStyle::font
CPTNativeFont * font
The font. Default is nil.
Definition: CPTTextStyle.h:21
NSArray
NSString
+[CPTTextStyle textStyle]
nonnull instancetype textStyle()
Creates and returns a new CPTTextStyle instance.
Definition: CPTTextStyle.m:69
CPTNativeFont
UIFont CPTNativeFont
Platform-native font.
Definition: CPTPlatformSpecificDefines.h:6
CGRect
typedef CGRect
NSString(CPTTextStyleExtensions)
NSString extensions for drawing styled text.
Definition: CPTTextStyle.h:57
NSSecureCoding-p