Core Plot (iOS and tvOS)
Cocoa plotting framework for macOS, iOS, and tvOS
CPTTextStyle Class Reference

Immutable wrapper for various text style properties. More...

#import <CPTTextStyle.h>

+ Inheritance diagram for CPTTextStyle:
+ Collaboration diagram for CPTTextStyle:

Public Class Methods

Factory Methods
(nonnull instancetype) + textStyle
 Creates and returns a new CPTTextStyle instance. More...
 
(nonnull instancetype) + textStyleWithStyle:
 Creates and returns a new text style instance initialized from an existing text style. More...
 
(nonnull instancetype) + textStyleWithAttributes:
 Creates and returns a new CPTTextStyle instance initialized from a dictionary of text attributes. More...
 
- Public Class Methods inherited from NSObject
(id) + alloc
 
(Class) + class
 
(void) + initialize
 
(void) + load
 
(id) + new
 
- Public Class Methods inherited from <NSSecureCoding>
(BOOL) + supportsSecureCoding:
 

Public Instance Methods

Initialization
(nonnull instancetype) - init [implementation]
 Initializes a newly allocated CPTTextStyle object. More...
 
- Public Instance Methods inherited from NSObject
(Class) - classForCoder
 
(id) - copy
 
(void) - dealloc
 
(void) - finalize
 
(id) - init
 
(id) - mutableCopy
 
- Public Instance Methods inherited from <NSObject>
(NSString *) - description
 
(NSUInteger) - hash
 
(BOOL) - isEqual:
 
- Public Instance Methods inherited from <NSCopying>
(id) - copyWithZone:
 
- Public Instance Methods inherited from <NSMutableCopying>
(id) - mutableCopyWithZone:
 
- Public Instance Methods inherited from <NSCoding>
(id) - initWithCoder:
 
(void) - encodeWithCoder:
 

Properties

CPTNativeFont * font
 The font. Default is nil. More...
 
NSString * fontName
 The font name. Default is Helvetica. Ignored if font is not nil. More...
 
CGFloat fontSize
 The font size. Default is 12.0. Ignored if font is not nil. More...
 
CPTColor * color
 The current text color. Default is solid black. More...
 
CPTTextAlignment textAlignment
 The paragraph alignment for multi-line text. Default is CPTTextAlignmentLeft. More...
 
NSLineBreakMode lineBreakMode
 The line break mode used when laying out the text. Default is NSLineBreakByWordWrapping . More...
 
CPTDictionary * attributes
 A dictionary of standard text attributes suitable for formatting an NSAttributedString. More...
 

Detailed Description

Immutable wrapper for various text style properties.

If you need to customize properties, you should create a CPTMutableTextStyle.

Method Documentation

◆ init

- (nonnull instancetype) init
implementation

Initializes a newly allocated CPTTextStyle object.

The initialized object will have the following properties:

Returns
The initialized object.

◆ textStyle

+ (nonnull instancetype) textStyle

Creates and returns a new CPTTextStyle instance.

Returns
A new CPTTextStyle instance.

◆ textStyleWithAttributes:

+ (nonnull instancetype) textStyleWithAttributes: (nullable CPTDictionary *)  attributes

Creates and returns a new CPTTextStyle instance initialized from a dictionary of text attributes.

The text style will be initalized with values associated with the following keys:

Properties associated with missing keys will be inialized to their default values.

Parameters
attributesA dictionary of standard text attributes.
Returns
A new CPTTextStyle instance.

Reimplemented in CPTMutableTextStyle.

Provided by category CPTTextStyle(CPTPlatformSpecificTextStyleExtensions).

◆ textStyleWithStyle:

+ (nonnull instancetype) textStyleWithStyle: (nullable CPTTextStyle *)  textStyle

Creates and returns a new text style instance initialized from an existing text style.

The text style will be initalized with values from the given textStyle.

Parameters
textStyleAn existing CPTTextStyle.
Returns
A new text style instance.

Property Documentation

◆ attributes

- (nonnull CPTDictionary *) attributes
readnonatomicassign

A dictionary of standard text attributes suitable for formatting an NSAttributedString.

The dictionary will contain values for the following keys that represent the receiver's text style:

Provided by category CPTTextStyle(CPTPlatformSpecificTextStyleExtensions).

◆ color

- (nullable CPTColor *) color
readnonatomiccopy

The current text color. Default is solid black.

◆ font

- (CPTNativeFont *) font
readnonatomicstrong

The font. Default is nil.

Font will override fontName and fontSize if not nil.

◆ fontName

- (nullable NSString *) fontName
readnonatomiccopy

The font name. Default is Helvetica. Ignored if font is not nil.

◆ fontSize

- (CGFloat) fontSize
readnonatomicassign

The font size. Default is 12.0. Ignored if font is not nil.

◆ lineBreakMode

- (NSLineBreakMode) lineBreakMode
readnonatomicassign

The line break mode used when laying out the text. Default is NSLineBreakByWordWrapping .

◆ textAlignment

- (CPTTextAlignment) textAlignment
readnonatomicassign

The paragraph alignment for multi-line text. Default is CPTTextAlignmentLeft.


The documentation for this class was generated from the following files: