CTTextTab Reference

Derived from
CFType
Framework
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 CTTextAlignment value or this function returns NULL.

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 to NULL if 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.h

CTTextTabGetAlignment

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.h

CTTextTabGetLocation

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.h

CTTextTabGetOptions

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.h

CTTextTabGetTypeID

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.h

Data 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.h

Constants

kCTTabColumnTerminatorsAttributeName

Specifies the terminating character for a tab column.

const CFStringRef kCTTabColumnTerminatorsAttributeName;
Constants
kCTTabColumnTerminatorsAttributeName

Specifies 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