You are on page 1of 1

CHAPTER 2: Text Text containers 68

Solution

Implement a custom text-attribute extension pattern. To do this, provide an implementation of the


IAttrReport interface in a boss class. Further, if the attribute has some meaning for tagged text
import/export, provide an implementation of IAttrImportExport.

Sample code

See the BasicTextAdornment sample from the SDK for an example of using a custom text attribute to
control the behavior of a text adornment.

Text containers
Raw text content is presented to the user through a process known as composition. Raw text content is
defined as the Unicode text along with some idea how it is to be displayed. The process of composition
needs some notion of where to place the text. It works with containers, which are parcels into which the
text can be placed. Several types of containers are supported:

 Text frames, like those created using the “Type Tool.”

 Text on the path of a spline (text on a path), such as you could create using the “Type on a Path Tool.”

 Text in a footnote.

 Text within a table cell (this is covered in the tables chapter).

A story (that is, a discrete body of textual work) can be spread across multiple columns of a page element.
The story can have embedded tables and footnote references, and it can be spread across several page
elements (on different pages of the document).

This section presents use cases for interacting with text containers and controlling options that apply to
them.

For more information, see Adobe InDesign Programming Guide.

Creating a text frame


You can create a page item to hold text.

Solution

Use the kCreateMultiColumnItemCmdBoss command. To specify the characteristics of the new text item,
use the IMultiColumnData and ICreateFrameData interfaces.

Sample code

 SDKLayoutHelper::CreateTextFrame

 SnpCreateFrame::CreateTextFrame

You might also like