Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

Next Page > Hide TOC

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
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
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
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
Declared In
CTTextTab.h

CTTextTabGetTypeID

Returns the Core Foundation type identifier of the text tab object.

CFTypeID CTTextTabGetTypeID( void );

Availability
Declared In
CTTextTab.h

Data Types

CTTextTabRef

A reference to a text tab object.

typedef const struct __CTTextTab *CTTextTabRef;

Availability
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 Mac OS X v10.5 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

Next Page > Hide TOC


Last updated: 2007-05-01




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice