DrawKit
Vector and illustration framework for Mac OS X
Instance Methods | Class Methods | List of all members
DKTextAdornment Class Reference

This renderer allows text to be an attribute of any object. More...

Inheritance diagram for DKTextAdornment:
Inheritance graph
[legend]

Instance Methods

(NSTextAlignment) - alignment
 
(BOOL- allowsTextToExtendHorizontally
 
(BOOL- allTextWasFitted
 
(CGFloat- angle
 
(CGFloat- angleInDegrees
 
(BOOL- appliesObjectAngle
 
(BOOL- attributeIsHomogeneous:
 
(NSColor *) - backgroundColour
 
(CGFloat- baseline
 
(CGFloat- baselineOffset
 
(CGFloat- baselineOffsetForTextHeight:
 
(DKTextCapitalization) - capitalization
 
(void) - changeAttributes:
 
(void) - changeFont:
 
(NSColor *) - colour
 
(NSDictionary *) - defaultTextAttributes
 
(void) - drawInRect:
 
(CGFloat- flowedTextPathInset
 
(NSFont *) - font
 
(CGFloat- fontSize
 
(DKGreeking) - greeking
 
(NSString *) - identifier
 
(void) - invalidateCache
 
(BOOL- isHomogeneous
 
(CGFloat- kerning
 
(NSAttributedString *) - label
 
(DKTextLayoutMode) - layoutMode
 
(void) - loosenKerning
 
(void) - lowerBaseline
 
(NSColor *) - outlineColour
 
(CGFloat- outlineWidth
 
(NSParagraphStyle *) - paragraphStyle
 
(NSString *) - placeholderString
 
(void) - raiseBaseline
 
(void) - scaleTextBy:
 
(void) - setAlignment:
 
(void) - setAllowsTextToExtendHorizontally:
 
(void) - setAngle:
 
(void) - setAngleInDegrees:
 
(void) - setAppliesObjectAngle:
 
(void) - setBackgroundColour:
 
(void) - setBaseline:
 
(void) - setCapitalization:
 
(void) - setColour:
 
(void) - setFlowedTextPathInset:
 
(void) - setFont:
 
(void) - setFontSize:
 
(void) - setGreeking:
 
(void) - setIdentifier:
 
(void) - setKerning:
 
(void) - setLabel:
 
(void) - setLayoutMode:
 
(void) - setOutlineColour:
 
(void) - setOutlineWidth:
 
(void) - setParagraphStyle:
 
(void) - setPlaceholderString:
 
(void) - setSuperscriptAttribute:
 
(void) - setTextAttributes:
 
(void) - setTextKnockoutColour:
 
(void) - setTextKnockoutDistance:
 
(void) - setTextKnockoutStrokeColour:
 
(void) - setTextKnockoutStrokeWidth:
 
(void) - setTextRect:
 
(void) - setTextSubstitutor:
 
(void) - setUnderlines:
 
(void) - setVerticalAlignment:
 
(void) - setVerticalAlignmentProportion:
 
(void) - setWrapsLines:
 
(NSString *) - string
 
(DKStyle *) - styleFromTextAttributes
 
(void) - subscript
 
(void) - superscript
 
(NSInteger- superscriptAttribute
 
(NSBezierPath *) - textAsPathForObject:
 
(NSDictionary *) - textAttributes
 
(NSTextStorage *) - textForEditing
 
(NSColor *) - textKnockoutColour
 
(CGFloat- textKnockoutDistance
 
(NSColor *) - textKnockoutStrokeColour
 
(CGFloat- textKnockoutStrokeWidth
 
(NSRect- textLayoutRectForObject:
 
(NSArray *) - textPathsForObject:usedSize:
 
(NSRect- textRect
 
(DKTextSubstitutor *) - textSubstitutor
 
(NSTextStorage *) - textToDraw:
 
(void) - tightenKerning
 
(void) - turnOffKerning
 
(NSInteger- underlines
 
(void) - unscript
 
(void) - useStandardKerning
 
(DKVerticalTextAlignment) - verticalAlignment
 
(CGFloat- verticalAlignmentProportion
 
(CGFloat- verticalTextOffsetForObject:
 
(BOOL- wrapsLines
 
- Instance Methods inherited from DKRasterizer
(DKClippingOption) - clipping
 Whether the rasterizer's effect is clipped to the path or not, and if so, which side. More...
 
(DKRastGroup *) - container
 Returns the immediate container of this object, if owned by a group. More...
 
(BOOL- copyToPasteboard:
 
(BOOL- enabled
 
(BOOL- isValid
 
(NSString *) - name
 
(NSBezierPath *) - renderingPathForObject:
 Returns the path to render given the object doing the rendering. More...
 
(void) - setClipping:
 
(void) - setClippingWithoutNotifying:
 
(void) - setContainer:
 Sets the immediate container of this object. More...
 
(void) - setEnabled:
 
(void) - setName:
 
(NSString *) - styleScript
 
- Instance Methods inherited from GCObservableObject
(NSString *) - actionNameForKeyPath:
 
(NSString *) - actionNameForKeyPath:changeKind:
 
(NSArray *) - oldArrayValueForKeyPath:
 
(void) - registerActionNames
 
(void) - sendInitialValuesForAllPropertiesToObserver:context:
 
(void) - setActionName:forKeyPath:
 
(BOOL- setUpKVOForObserver:
 
(void) - setUpObservables:forObserver:
 
(BOOL- tearDownKVOForObserver:
 
(void) - tearDownObservables:forObserver:
 
- Instance Methods inherited from NSObject
(NSString *) - address
 
(DKStyleRegistry *) - applicationWillReturnStyleRegistry
 
(BOOL- canBeUsedWithSelectionTool
 
(id- categoryManager:shouldReplaceObject:withObject:
 
(Class- classForCoder
 
(NSColor *) - colorValue
 
(NSColor *) - colourValue
 
(id- copy
 
(void) - dealloc
 
(id- deepCopy
 
(NSDictionary *) - dimensionValuesForArrowStroke:
 
(CGFloat- drawing:convertDistanceToExternalCoordinates:
 
(NSPoint) - drawing:convertLocationToExternalCoordinates:
 
(void) - drawing:didDrawRect:inView:
 
(void) - drawing:willDrawRect:inView:
 
(NSString *) - drawing:willReturnAbbreviationForUnit:
 
(NSString *) - drawing:willReturnFormattedCoordinateForDistance:
 
(CGFloat- drawingWillReturnUnitToPointsConversonFactor:
 
(void) - finalize
 
(NSString *) - hexString
 
(void) - hotspot:didEndTrackingWithEvent:inView:
 
(void) - hotspot:isTrackingWithEvent:inView:
 
(void) - hotspot:willBeginTrackingWithEvent:inView:
 
(NSData *) - imageData
 
(NSImage *) - imageResourceNamed:
 
(id- init
 
(id- initWithExpression:
 
(id- instantiateObjectWithShortName:parameters:
 
(BOOL- isLiteralValue
 
(void) - layoutManager:willPlaceGlyphAtIndex:atLocation:pathAngle:yOffset:
 
(void) - menuItem:wasAddedForObject:inCategory:
 
(BOOL- moveObjectTo:position:slope:userInfo:
 
(id- mutableCopy
 
(void) - oneShotComplete
 
(void) - oneShotHasReached:
 
(void) - oneShotWillBegin
 
(void) - path:elementIndex:type:points:subPathIndex:subPathClosed:contextInfo:
 
(id- placeLinkFromPoint:toPoint:onPath:linkNumber:userInfo:
 
(id- placeObjectAtPoint:onPath:position:slope:userInfo:
 
(NSPoint) - point
 
(NSPoint) - pointForTextLayout
 
(DKStyle *) - registry:shouldReplaceStyle:withStyle:
 
(NSBezierPath *) - renderer:willRenderPath:
 
(void) - routeFinder:progressHasReached:
 
(void) - setValue:forNumericParameter:
 
(NSString *) - stringValue
 
(CGFloat- taperFactorAtDistance:onPath:ofLength:
 
(void) - toolDidPerformUndoableAction:
 
(void) - toolWillPerformUndoableAction:
 
(NSURL *) - url
 
- Instance Methods inherited from <NSObject>
(NSString *) - description
 
(NSUInteger- hash
 
(BOOL- isEqual:
 
- Instance Methods inherited from <NSKeyValueBindingCreation>
(void) - bind:toObject:withKeyPath:options:
 
(NSArray *) - exposedBindings
 
(NSDictionary *) - infoForBinding:
 
(NSArray *) - optionDescriptionsForBinding:
 
(void) - unbind:
 
(Class- valueClassForBinding:
 
- Instance Methods inherited from <DKRasterizer>
(NSSize) - extraSpaceNeeded
 
(BOOL- isFill
 
(void) - render:
 
(void) - renderPath:
 
- Instance Methods inherited from <NSCoding>
(void) - encodeWithCoder:
 
(id- initWithCoder:
 
- Instance Methods inherited from <NSCopying>
(id- copyWithZone:
 

Class Methods

(NSString *) + defaultLabel
 
(CGFloat+ defaultMaximumVerticalOffset
 
(NSDictionary *) + defaultTextAttributes
 
(void) + setDefaultMaximumVerticalOffset:
 
(DKTextAdornment *) + textAdornmentWithText:
 
- Class Methods inherited from DKRasterizer
(DKRasterizer *) + rasterizerFromPasteboard:
 
- Class Methods inherited from GCObservableObject
(NSString *) + actionNameForKeyPath:objClass:
 
(NSArray *) + observableKeyPaths
 
(void) + registerActionName:forKeyPath:objClass:
 
- Class Methods inherited from NSObject
(id+ alloc
 
(Class+ class
 
(void) + initialize
 
(void) + load
 
(id+ new
 
- Class Methods inherited from <NSKeyValueBindingCreation>
(void) + exposeBinding:
 

Detailed Description

This renderer allows text to be an attribute of any object.

This renderer allows text to be an attribute of any object.

This renderer also implements text-on-a-path. To do this, set the layoutMode to kDKTextLayoutAlongPath. Some attributes are ignored in this mode such as angle and vertical alignment. However all textual attributes are honoured.

Text adornments extensively cache information internally to speed drawing by avoiding recalculation of various things. The cache is a dictionary which can store many different cached items. The cache is invalidated by changes arising in the client object and in the state of internal data, and in addition the same cache is passed to text-on-path and other lower level methods which they use to avoid similar lengthy recalculations. The caching is transparent to client objects but may need to be taken into account if subclassing or using alternative helper objects, etc.

The text content is stored and suplied by DKTextSubstitutor which is able to build strings by reading an object's metadata and combining it with other fixed content. See that class for details.

Method Documentation

- (NSTextAlignment) alignment
- (BOOL) allowsTextToExtendHorizontally
- (BOOL) allTextWasFitted
- (CGFloat) angle
- (CGFloat) angleInDegrees
- (BOOL) appliesObjectAngle
- (BOOL) attributeIsHomogeneous: (NSString *)  attributeName
- (NSColor*) backgroundColour
- (CGFloat) baseline
- (CGFloat) baselineOffset
- (CGFloat) baselineOffsetForTextHeight: (CGFloat height
- (DKTextCapitalization) capitalization
- (void) changeAttributes: (id sender
- (void) changeFont: (id sender
- (NSColor*) colour
+ (NSString*) defaultLabel
+ (CGFloat) defaultMaximumVerticalOffset
+ (NSDictionary*) defaultTextAttributes
- (NSDictionary*) defaultTextAttributes
- (void) drawInRect: (NSRect aRect
- (CGFloat) flowedTextPathInset
- (NSFont*) font
- (CGFloat) fontSize
- (DKGreeking) greeking
- (NSString*) identifier

Provided by category DKTextAdornment(Deprecated).

- (void) invalidateCache
- (BOOL) isHomogeneous
- (CGFloat) kerning
- (NSAttributedString*) label

Implements DKRasterizer.

- (DKTextLayoutMode) layoutMode
- (void) loosenKerning
- (void) lowerBaseline
- (NSColor*) outlineColour
- (CGFloat) outlineWidth
- (NSParagraphStyle*) paragraphStyle
- (NSString*) placeholderString
- (void) raiseBaseline
- (void) scaleTextBy: (CGFloat factor
- (void) setAlignment: (NSTextAlignment)  align
- (void) setAllowsTextToExtendHorizontally: (BOOL extend
- (void) setAngle: (CGFloat angle
- (void) setAngleInDegrees: (CGFloat degrees
- (void) setAppliesObjectAngle: (BOOL aa
- (void) setBackgroundColour: (NSColor *)  colour
- (void) setBaseline: (CGFloat baseLine
- (void) setCapitalization: (DKTextCapitalization)  cap
- (void) setColour: (NSColor *)  colour
+ (void) setDefaultMaximumVerticalOffset: (CGFloat mvo
- (void) setFlowedTextPathInset: (CGFloat inset
- (void) setFont: (NSFont *)  font
- (void) setFontSize: (CGFloat fontSize
- (void) setGreeking: (DKGreeking)  greeking
- (void) setIdentifier: (NSString *)  ident

Provided by category DKTextAdornment(Deprecated).

- (void) setKerning: (CGFloat kernValue
- (void) setLabel: (id anySortOfText
- (void) setLayoutMode: (DKTextLayoutMode)  mode
- (void) setOutlineColour: (NSColor *)  aColour
- (void) setOutlineWidth: (CGFloat aWidth
- (void) setParagraphStyle: (NSParagraphStyle *)  style
- (void) setPlaceholderString: (NSString *)  str
- (void) setSuperscriptAttribute: (NSInteger amount
- (void) setTextAttributes: (NSDictionary *)  attrs
- (void) setTextKnockoutColour: (NSColor *)  colour
- (void) setTextKnockoutDistance: (CGFloat distance
- (void) setTextKnockoutStrokeColour: (NSColor *)  colour
- (void) setTextKnockoutStrokeWidth: (CGFloat width
- (void) setTextRect: (NSRect rect
- (void) setTextSubstitutor: (DKTextSubstitutor *)  subs
- (void) setUnderlines: (NSInteger under
- (void) setVerticalAlignment: (DKVerticalTextAlignment)  placement
- (void) setVerticalAlignmentProportion: (CGFloat prop
- (void) setWrapsLines: (BOOL wraps
- (NSString*) string
- (DKStyle*) styleFromTextAttributes
- (void) subscript
- (void) superscript
- (NSInteger) superscriptAttribute
+ (DKTextAdornment*) textAdornmentWithText: (id anySortOfText
- (NSBezierPath*) textAsPathForObject: (id object
- (NSDictionary*) textAttributes
- (NSTextStorage*) textForEditing
- (NSColor*) textKnockoutColour
- (CGFloat) textKnockoutDistance
- (NSColor*) textKnockoutStrokeColour
- (CGFloat) textKnockoutStrokeWidth
- (NSRect) textLayoutRectForObject: (id< DKRenderable >)  object
- (NSArray*) textPathsForObject: (id object
usedSize: (NSSize *)  aSize 
- (NSRect) textRect
- (DKTextSubstitutor*) textSubstitutor
- (NSTextStorage*) textToDraw: (id object
- (void) tightenKerning
- (void) turnOffKerning
- (NSInteger) underlines
- (void) unscript
- (void) useStandardKerning
- (DKVerticalTextAlignment) verticalAlignment
- (CGFloat) verticalAlignmentProportion
- (CGFloat) verticalTextOffsetForObject: (id< DKRenderable >)  object
- (BOOL) wrapsLines