DrawKit
Vector and illustration framework for Mac OS X
Instance Methods | List of all members
NSAttributedString(DKAdditions) Category Reference

These category methods perform high-level text layout. More...

Instance Methods

(NSSize) - accurateSize
 
(BOOL- attributeIsHomogeneous:
 
(BOOL- attributesAreHomogeneous:
 
(void) - drawInRect:withLayoutPath:atAngle:
 Lays out the receiver then draws it to the destination. More...
 
(void) - drawInRect:withLayoutPath:atAngle:verticalPositioning:verticalOffset:
 
(void) - drawInRect:withLayoutSize:atAngle:
 Lays out the receiver then draws it to the destination. More...
 
(BOOL- isHomogeneous
 

Detailed Description

These category methods perform high-level text layout.

Author
Contributions from the community; see CONTRIBUTORS.md
Date
2005-2015

These category methods perform high-level text layout.

In the first case, the text is laid out in the layoutRect which dictates the line wrapping and number lines by its width or height (this rect is the text container in other words). The resulting text is then rotated to the given angle and mapped into <destRect>, which applies any visual scaling and translation, and drawn into the current context.

The second method is similar except that text is flowed into the layoutPath.

Method Documentation

- (NSSize) accurateSize
- (BOOL) attributeIsHomogeneous: (NSString *)  attrName
- (BOOL) attributesAreHomogeneous: (NSDictionary *)  attrs
- (void) drawInRect: (NSRect destRect
withLayoutPath: (NSBezierPath *)  layoutPath
atAngle: (CGFloat radians 

Lays out the receiver then draws it to the destination.

This method is intended to be utilised by high-level text objects such as DKTextShape and DKTextAdornment. It both lays out and renders text in many different ways according to its parameters (and the string's attributes themselves).

Parameters
destRectthe final destination of the text. The text is scaled and translated to draw in this rect
layoutPatha path describing the text layout container. Text is laid out to fit into this path.
radiansan angle to which the text is rotated before being drawn to <destRect>
- (void) drawInRect: (NSRect destRect
withLayoutPath: (NSBezierPath *)  layoutPath
atAngle: (CGFloat radians
verticalPositioning: (DKVerticalTextAlignment)  vAlign
verticalOffset: (CGFloat vPos 
- (void) drawInRect: (NSRect destRect
withLayoutSize: (NSSize)  layoutSize
atAngle: (CGFloat radians 

Lays out the receiver then draws it to the destination.

This method is intended to be utilised by high-level text objects such as DKTextShape and DKTextAdornment. It both lays out and renders text in many different ways according to its parameters (and the string's attributes themselves).

Parameters
destRectthe final destination of the text. The text is scaled and translated to draw in this rect
layoutSizea size describing the text layout container. Text is laid out to fit into this size.
radiansan angle to which the text is rotated before being drawn to <destRect>Lays out the receiver then draws it to the destination

This method is intended to be utilised by high-level text objects such as DKTextShape and DKTextAdornment. It both lays out and renders text in many different ways according to its parameters (and the string's attributes themselves).

Parameters
destRectthe final destination of the text. The text is scaled and translated to draw in this rect
layoutPatha path describing the text layout container. Text is laid out to fit into this path.
radiansan angle to which the text is rotated before being drawn to <destRect>
vAlignwhether the text is positioned at top, centre, bottom or at some value
vPosproportion of srcRect given by interval 0..1 when vAlign is proportional
- (BOOL) isHomogeneous