Class

NSStringDrawingContext

An object that manages metrics used when drawing attributed strings.

Declaration

@interface NSStringDrawingContext : NSObject

Overview

Prior to drawing, you can create an instance of this class and use it to specify the minimum scale factor and tracking adjustments for a string. After drawing, you can retrieve the actual values that were used during drawing.

To use this class, allocate and initialize a new instance, set the minimum values, and pass your object to one of the corresponding NSAttributedString methods that take the context object as a parameter. Upon completion of drawing, you can use the actual drawing values to make adjustments or record where the string was actually drawn.

Topics

Accessing the Tracking Adjustments

minimumTrackingAdjustment

The smallest amount of space (in points) to maintain between characters.

Deprecated
actualTrackingAdjustment

The actual tracking value that was applied during drawing.

Deprecated

Accessing the Scale Factors

minimumScaleFactor

The scale factor that determines the smallest font size to use during drawing.

actualScaleFactor

The actual scale factor that was applied to the font during drawing.

Getting the Drawing Bounds

totalBounds

The bounding rectangle that was last used when drawing the string.

Relationships

Inherits From

See Also

Strings

NSStringDrawingOptions

Constants for the rendering options for a string when it is drawn.

UIBaselineAdjustment

Vertical adjustment options.

UILineBreakMode

Options for wrapping and truncating text.

Deprecated
UITextAlignment

Options for aligning text horizontally.

Deprecated
UITextAttributeFont

Key to the font in a text attributes dictionary.

Deprecated
UITextAttributeTextColor

Key to the text color in a text attributes dictionary.

Deprecated
UITextAttributeTextShadowColor

Key to the text shadow color in a text attributes dictionary.

Deprecated
UITextAttributeTextShadowOffset

Key to the offset used for the text shadow in a text attributes dictionary.

Deprecated