A concrete typesetter object that places glyphs during the text layout process.


@interface NSATSTypesetter : NSTypesetter


An NSATSTypesetter object creates line fragment rectangles, positions glyphs within the line fragments, determines line breaks by word wrapping and hyphenation, and handles tab positioning. This object encapsulates the advanced typesetting capabilities of Core Text. NSATSTypesetter provides line and character spacing accuracy and supports many languages, including bidirectional languages.


Getting the Shared Typesetter Object


Returns a shared instance of the typesetter.

Accessing the Layout Manager


The layout manager for the text being typeset.


A Boolean value controlling whether the typesetter uses the leading (or line gap) value specified in the font metric information.


The current typesetter behavior value.


The threshold controlling when hyphenation is attempted.


A Boolean value controlling whether the typesetter performs bidirectional text processing.

Getting the Text Container


The text container for the text being typeset.


The amount (in points) by which text is inset within line fragment rectangles.

Performing Font Substitution

- substituteFontForFont:

Returns a screen font suitable for use in place of the specified original font,.

Getting the Location of Text Tabs

- textTabForGlyphLocation:writingDirection:maxLocation:

Returns the text tab closest to the specified glyph location and not beyond a maximum position.

Accessing Paragraph Information


The backing store that contains the text on which this typesetter operates.

- setParagraphGlyphRange:separatorGlyphRange:

Sets the glyph range being processed and the paragraph separator glyph range (the range of the paragraph separator character or characters).


The current glyph range being processed.


The current paragraph separator range that contains the current glyph range and extends from one paragraph separator character to the next.

Laying Out a Paragraph

- layoutParagraphAtPoint:

Lays out glyphs in the current glyph range until the next paragraph separator is reached.

Getting Spacing Information

- lineSpacingAfterGlyphAtIndex:withProposedLineFragmentRect:

Returns the line spacing in effect following the specified glyph.

- paragraphSpacingAfterGlyphAtIndex:withProposedLineFragmentRect:

Returns the number of points of space added following a paragraph, in effect after the specified glyph.

- paragraphSpacingBeforeGlyphAtIndex:withProposedLineFragmentRect:

Returns the number of points of space added before a paragraph, which is in effect before the specified glyph.

Laying Out Glyphs

- boundingBoxForControlGlyphAtIndex:forTextContainer:proposedLineFragment:glyphPosition:characterIndex:

Returns the bounding rectangle for a control glyph, at the specified glyph position and character index in the text container.

- getLineFragmentRect:usedRect:forParagraphSeparatorGlyphRange:atProposedOrigin:

Calculates the line fragment rectangle and the portion of the rectangle that contains marks.

- hyphenCharacterForGlyphAtIndex:

Returns the hyphen character to be inserted after the specified glyph when hyphenation is enabled in the layout manager.

- hyphenationFactorForGlyphAtIndex:

Returns the hyphenation factor in effect at the specified glyph index.

- shouldBreakLineByHyphenatingBeforeCharacterAtIndex:

Breaks a line by hyphenating before the character at the specified index.

- shouldBreakLineByWordBeforeCharacterAtIndex:

Breaks a line by word-wrapping before the character at the specified index.

- willSetLineFragmentRect:forGlyphRange:usedRect:baselineOffset:

Notifies subclasses that the typesetter is about to set a new line fragment.

- setHardInvalidation:forGlyphRange:

Sets a Boolean value that determines whether the layout manager invalidates the specified portion of the glyph cache.


- getGlyphsInRange:glyphs:characterIndexes:glyphInscriptions:elasticBits:

Extracts the information needed to lay out the glyphs in the given glyph buffer from the given glyph range.



Inherits From

See Also



An object that coordinates the layout and display of text characters.


A set of optional methods implemented by delegates of layout manager objects.


A region where text is laid out.


These constants describe the progression of text on a page. The typesetter decides which way text is supposed to flow and passes these values as arguments to the text container, which uses them to calculate the next line rectangle.


The direction in which a line moves.


An abstract class that performs various type layout tasks.


A set of methods that define the orientation of text for an object.