Mac Developer Library

Developer

ApplicationServices Framework Reference CTTextTab Reference

Options
Deployment Target:

On This Page
Language:

CTTextTab Reference

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


Swift

import CoreText

Objective-C

@import CoreText;

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

  • Creates and initializes a new text tab object.

    Declaration

    Swift

    func CTTextTabCreate(_ alignment: CTTextAlignment, _ location: Double, _ options: CFDictionary!) -> CTTextTab!

    Objective-C

    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.

    Import Statement

    Objective-C

    @import CoreText;

    Swift

    import CoreText

    Availability

    Available in OS X v10.5 and later.

  • Returns the text alignment of the tab.

    Declaration

    Swift

    func CTTextTabGetAlignment(_ tab: CTTextTab!) -> CTTextAlignment

    Objective-C

    CTTextAlignment CTTextTabGetAlignment ( CTTextTabRef tab );

    Parameters

    tab

    The tab whose text alignment is obtained.

    Return Value

    The tab's text alignment value.

    Import Statement

    Objective-C

    @import CoreText;

    Swift

    import CoreText

    Availability

    Available in OS X v10.5 and later.

  • Returns the tab's ruler location.

    Declaration

    Swift

    func CTTextTabGetLocation(_ tab: CTTextTab!) -> Double

    Objective-C

    double CTTextTabGetLocation ( CTTextTabRef tab );

    Parameters

    tab

    The tab whose location is obtained.

    Return Value

    The tab's ruler location relative to the back margin.

    Import Statement

    Objective-C

    @import CoreText;

    Swift

    import CoreText

    Availability

    Available in OS X v10.5 and later.

  • Returns the dictionary of attributes associated with the tab.

    Declaration

    Swift

    func CTTextTabGetOptions(_ tab: CTTextTab!) -> CFDictionary!

    Objective-C

    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.

    Import Statement

    Objective-C

    @import CoreText;

    Swift

    import CoreText

    Availability

    Available in OS X v10.5 and later.

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

    Declaration

    Swift

    func CTTextTabGetTypeID() -> CFTypeID

    Objective-C

    CFTypeID CTTextTabGetTypeID ( void );

    Import Statement

    Objective-C

    @import CoreText;

    Swift

    import CoreText

    Availability

    Available in OS X v10.5 and later.

Data Types

  • A reference to a text tab object.

    Declaration

    Swift

    typealias CTTextTabRef = CTTextTab

    Objective-C

    typedef const struct __CTTextTab *CTTextTabRef;

    Availability

    Available in OS X v10.5 and later.

Constants

  • Specifies the terminating character for a tab column.

    Declaration

    Swift

    let kCTTabColumnTerminatorsAttributeName: CFString!

    Objective-C

    const CFStringRef kCTTabColumnTerminatorsAttributeName;

    Constants

    • kCTTabColumnTerminatorsAttributeName

      kCTTabColumnTerminatorsAttributeName

      Specifies the terminating character for a tab column.

      Available in OS X v10.5 and later.

    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.