CTTextTab Reference
| Derived from | CFType |
| Framework | ApplicationServices/CoreText |
| Declared in | CTTextTab.h |
Overview
The CTTextTab opaque type represents a tab in a paragraph style, storing an alignment type and location.
Core Text supports four alignment types: left, center, right, and decimal. These alignment types are absolute, not based on the line sweep direction of text. For example, tabbed text is always positioned to the left of a right-aligned tab, whether the line sweep direction is left to right or right to left. A tab's location, on the other hand, is relative to the back margin. A tab set at 1.5 inches, for example, is at 1.5 inches from the right in right-to-left text.
Functions by Task
Creating Text Tabs
Getting Text Tab Data
Getting the Type Identifier
Functions
CTTextTabCreate
Creates and initializes a new text tab object.
CTTextTabRef CTTextTabCreate( CTTextAlignment alignment, double location, CFDictionaryRef options );
Parameters
- alignment
The tab's alignment. This is used to determine the position of text inside the tab column. This parameter must be set to a valid
CTTextAlignmentvalue or this function returnsNULL.- location
The tab's ruler location, relative to the back margin.
- options
Options to pass in when the tab is created. Currently, the only option available is
kCTTabColumnTerminatorsAttributeName. This parameter is optional and can be set toNULLif not needed.
Return Value
A reference to a CTTextTab object if the call was successful; otherwise, NULL.
Availability
- Available in iOS 3.2 and later.
Declared In
CTTextTab.hCTTextTabGetAlignment
Returns the text alignment of the tab.
CTTextAlignment CTTextTabGetAlignment( CTTextTabRef tab );
Parameters
- tab
The tab whose text alignment is obtained.
Return Value
The tab's text alignment value.
Availability
- Available in iOS 3.2 and later.
Declared In
CTTextTab.hCTTextTabGetLocation
Returns the tab's ruler location.
double CTTextTabGetLocation( CTTextTabRef tab );
Parameters
- tab
The tab whose location is obtained.
Return Value
The tab's ruler location relative to the back margin.
Availability
- Available in iOS 3.2 and later.
Declared In
CTTextTab.hCTTextTabGetOptions
Returns the dictionary of attributes associated with the tab.
CFDictionaryRef CTTextTabGetOptions( CTTextTabRef tab );
Parameters
- tab
The tab whose attributes are obtained.
Return Value
The dictionary of attributes associated with the tab, or if no dictionary is present, NULL.
Availability
- Available in iOS 3.2 and later.
Declared In
CTTextTab.hCTTextTabGetTypeID
Returns the Core Foundation type identifier of the text tab object.
CFTypeID CTTextTabGetTypeID( void );
Availability
- Available in iOS 3.2 and later.
Declared In
CTTextTab.hData Types
CTTextTabRef
A reference to a text tab object.
typedef const struct __CTTextTab *CTTextTabRef;
Availability
- Available in iOS 3.2 and later.
Declared In
CTTextTab.hConstants
kCTTabColumnTerminatorsAttributeName
Specifies the terminating character for a tab column.
const CFStringRef kCTTabColumnTerminatorsAttributeName;
Constants
kCTTabColumnTerminatorsAttributeNameSpecifies the terminating character for a tab column.
Available in iOS 3.2 and later.
Declared in
CTTextTab.h.
Discussion
The value associated with this attribute is a CFCharacterSet object. The character set is used to determine the terminating character for a tab column. The tab and newline characters are implied even if they don't exist in the character set. This attribute can be used to implement decimal tabs, for instance. This attribute is optional.
Declared In
CTTextTab.h© 2010 Apple Inc. All Rights Reserved. (Last updated: 2010-02-25)