Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Text /
Chapter 2 - TextEdit / TextEdit Reference
Data Structures


The Style Table

The style table contains one entry for each distinct set of character attributes used in the text of an edit record. Each entry is defined in a style element record. The size of the table is given by the nStyles field of the style record. There is no duplication; each set of character attributes appears exactly once in the table. A reference count tells how many times each set of attributes is used in the table. The TEStyleTable data type defines the style table. The STElement data type defines the style element record.

TYPE  STElement = 
      RECORD
         stCount:    Integer;    {number of runs in this style}
         stHeight:   Integer;    {line height}
         stAscent:   Integer;    {font ascent}
         stFont:     Integer;    {font family ID}
         stFace:     Style;      {character style}
         stSize:     Integer;    {size in points}
         stColor:    RGBColor;   {absolute RGB color}
      END;

STHandle = ^STPtr;
STPtr    = ^TEStyleTable;

TEStyleTable = ARRAY [0..1776] OF STElement;
Field Description
stCount
A reference count of character runs using this set of character attributes.
stHeight
The line height for this run, in points.
stAscent
The font ascent for this run, in points.
stFont
The font family ID.
stFace
The character style (bold, italic, and so forth). This field consists of two bytes. The low-order byte contains the character style. TextEdit uses the high bit (bit 15) of the high-order byte to store the style run direction: it uses 0 for left-to-right text, and 1 for right-to-left text.
stSize
The text size, in points.
stColor
The RGB (red, green, blue) color.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996