txtattr Specification Sheet


Portable Object Compiler (c) 1997,98. All Rights Reserved.

TextAttribute

Inherits from: Object

Maturity Index: Experimental

Class Description

Abstract superclass for Text Attributes, as used by the Text and the RunArray classes.

Typically, an application will subclass TextAttribute and use its own subclass with the Text instance method addAttribute:.

Method types

Text Emphasis

Accessing

String Offsets

Comparison

Coalescing

Printing

Methods

normal

+normal
A Text Attribute instance with emphasiscode set to 0.

new

+new
A Text Attribute instance with emphasiscode set to 0.

bold

+bold
Creates a Textattribute with emphasiscode set to 1.

emphasiscode:

+emphasiscode:(unsigned)n
A Text Attribute instance with emphasiscode set to n. This value may suffice for simple applications, but normally a subclass of TextAttribute would be used to associate more sophisticated values to a Text Attribute (such as URL of a hypertext link, or such as a Color value, or an X-Windows font etc.).

emphasiscode

- (unsigned)emphasiscode

emphasiscode:

-emphasiscode:(unsigned)c

size

- (unsigned)size

position

- (unsigned)position

isEqual:

- (BOOL)isEqual:attrib
The equality test for TextAttributes does NOT compare the run length (and start position). This is because isEqual: is used by RunArray's coalesce method to merge adjacent TextAttribute instances.

dominates:

- (BOOL)dominates:attrib
Should return YES if the receiver dominates attrib. This implies that, when the receiver is added to a list of Text Attributes, attributes that are dominated by the receiver will be removed.

The default returns NO, unless both objects are members of the same class and equal to each other (in which case they don't need to be added more than once to the attribute list).

reset

-reset

set

- (BOOL)set

printOn:

-printOn:(IOD)aFile