---
title: Introduction to Text Layout Programming Guide
framework: cocoa
role: article
path: apple-archive/documentation/Cocoa/Conceptual/TextLayout
---

# Introduction to Text Layout Programming Guide

Explains how the Cocoa text system lays out text on pages.

## Who Should Read This Document

You should read this document if you need to understand how the text system layout mechanism works and how to work directly with an `NSLayoutManager` object to accomplish the programming goals described in the articles.

To understand the information in this document, you should have read *[Cocoa Text Architecture Guide](../../../TextFonts/Conceptual/CocoaTextArchitecture/Introduction/Introduction.html#//apple_ref/doc/uid/TP40009459)*. You should also understand basic Cocoa programming conventions, such as delegation.

## Organization of This Document

This programming topic contains the following articles:

- [The Layout Manager](Concepts/LayoutManager.html#//apple_ref/doc/uid/20001805-BBCFEBHA) introduces the `NSLayoutManager` class, describing its features and explaining how it performs text layout. - [Typesetters](Concepts/Typesetters.html#//apple_ref/doc/uid/20001806-BBCFEBHA) describes the responsibilities of the typesetter object, instantiated from a concrete subclass of `NSTypesetter`, which generates the line fragments and glyph positions on behalf of the layout manager. - [Line Fragment Generation](Concepts/CalcTextLayout.html#//apple_ref/doc/uid/20000847-CJBBIAAF) explains how the typesetter and text container work together to create line fragment rectangles. - [Drawing Strings](Tasks/DrawingStrings.html#//apple_ref/doc/uid/20001808-CJBGBIBB) explains how to use the layout manager, rather than `NSString` convenience methods, to draw strings of text efficiently. - [Laying Out Text Along an Arbitrary Path](Tasks/ArbitraryTextPath.html#//apple_ref/doc/uid/20001807-CJBGBIBB) shows how to use the layout manager without a text view to lay out glyphs along a calculated path. - [Calculating Text Height](Tasks/StringHeight.html#//apple_ref/doc/uid/20001809-CJBGBIBB) shows how to determine the height of a block of text laid out in a fixed-width area. - [Counting Lines of Text](Tasks/CountLines.html#//apple_ref/doc/uid/20001810-CJBGBIBB) explains how you can programmatically count the number of lines in a string of text, whether the lines are defined by hard line-break characters or laid out in a text container. - [Using Text Tables](Articles/TextTables.html#//apple_ref/doc/uid/TP40001900-SW8) explains how you can add text table support to your application in OS X version 10.4 and later.

## See Also

For further reading, refer to the following documents:

- *[Text System Storage Layer Overview](../TextStorageLayer/TextStorageLayer.html#//apple_ref/doc/uid/10000087i)* discusses the facilities that the Cocoa text system uses to store the text and geometric shape information used for text layout. - *[Text Attribute Programming Topics](../TextAttributes/TextAttributes.html#//apple_ref/doc/uid/10000088i)* describes the text-related attributes maintained by the Cocoa text system, which provide the distinguishing characteristics of rich text and other formatting information for paragraphs and documents.

[Next](Concepts/LayoutManager.html)

Copyright © 2003, 2014 Apple Inc. All Rights Reserved. [Terms of Use](http://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](http://www.apple.com/privacy/) | Updated: 2014-02-11
