Text
media is used to store text data in QuickTime movies. It has a media
type of 'text'.
Text Sample Description
Text Sample Data
Hypertext and Wired Text
The text sample description contains information that defines how to interpret text media data. This sample description is based on the standard sample description header, as described in “Sample Description Atoms.”
The data format field in the sample description is always
set to 'text'.
The text media handler also adds some of its own fields to the sample description.
A 32-bit integer containing flags that describe how the text should be drawn. The following flags are defined.
Don’t auto scale
Controls text scaling. If this flag is set to 1, the text media handler reflows the text instead of scaling when the track is scaled. This flag’s value is 0x0002.
Use movie background color
Controls background color. If this flag is set to 1, the text media handler ignores the background color field in the text sample description and uses the movie’s background color instead. This flag’s value is 0x0008.
Scroll in
Controls text scrolling. If this flag is set to 1, the text media handler scrolls the text until the last of the text is in view. This flag’s value is 0x0020.
Scroll out
Controls text scrolling. If this flag is set to 1, the text media handler scrolls the text until the last of the text is gone. This flag’s value is 0x0040.
Horizontal scroll
Controls text scrolling. If this flag is set to 1, the text media handler scrolls the text horizontally; otherwise, it scrolls the text vertically. This flag’s value is 0x0080.
Reverse scroll
Controls text scrolling. If this flag is set to 1, the text media handler scrolls down (if scrolling vertically) or backward (if scrolling horizontally; note that horizontal scrolling also depends upon text justification). This flag’s value is 0x0100.
Continuous scroll
Controls text scrolling. If this flag is set to 1, the text media handler displays new samples by scrolling out the old ones. This flag’s value is 0x0200.
Drop shadow
Controls drop shadow. If this flag is set to 1, the text media handler displays the text with a drop shadow. This flag’s value is 0x1000.
Anti-alias
Controls anti-aliasing. If this flag is set to 1, the text media handler uses anti-aliasing when drawing text. This flag’s value is 0x2000.
Key text
Controls background color. If this flag is set to 1, the text media handler does not display the background color, so that the text overlay background tracks. This flag’s value is 0x4000.
A 32-bit integer that indicates how the text should be aligned. Set this field to 0 for left-justified text, to 1 for centered text, and to –1 for right-justified text.
A 48-bit RGB color that specifies the text’s background color.
A 64-bit rectangle that specifies an area to receive text (top, left, bottom, right). Typically this field is set to all zeros.
A 64-bit value that must be set to 0.
A 16-bit value that must be set to 0.
A 16-bit integer that indicates the font’s style. Set this field to 0 for normal text. You can enable other style options by using one or more of the following bit masks:
0x0001 Bold
0x0002 Italic
0x0004 Underline
0x0008 Outline
0x0010 Shadow
0x0020 Condense
0x0040 Extend
An 8-bit value that must be set to 0.
A 16-bit value that must be set to 0.
A 48-bit RGB color that specifies the text’s foreground color.
A Pascal string specifying the name of the font to use to display the text.
The format of the text data is a 16-bit length word followed by the actual text. The length word specifies the number of bytes of text, not including the length word itself. Following the text, there may be one or more atoms containing additional information for drawing and searching the text.
Table 3-8 lists the currently defined text sample extensions.
Text sample extension |
Description |
|---|---|
|
Style information for the text. Allows you to override the default style in the sample description or to define more than one style for a sample. The data is a TextEdit style scrap. |
|
Table of font names. Each table entry contains a font
number (stored in a 16-bit integer) and a font name (stored in a
Pascal string).This atom is required if the |
|
Highlight information. The atom data consists of two 32-bit integers. The first contains the starting offset for the highlighted text, and the second has the ending offset. A highlight sample can be in a key frame or in a differenced frame. When it’s used in a differenced frame, the sample should contain a zero-length piece of text. |
|
Highlight color. This atom specifies the 48-bit RGB color to use for highlighting. |
|
Drop shadow offset. When the display flags indicate drop shadow style, this atom can be used to override the default drop shadow placement. The data consists of two 16-bit integers. The first indicates the horizontal displacement of the drop shadow, in pixels; the second, the vertical displacement. |
|
Drop shadow transparency. The data is a 16-bit integer between 0 and 256 indicating the degree of transparency of the drop shadow. A value of 256 makes the drop shadow completely opaque. |
|
Image font data. This atom contains two more atoms. An |
|
Image font highlighting. This atom contains metric information that
governs highlighting when an |
Hypertext
is used as an action that takes you to a Web URL; like a Web URL,
it appears blue and underlined. Hypertext is stored in a text track
sample atom stream as type 'htxt'. The
same mechanism is used to store wired actions linked to text strings.
A text string can be wired to act as a hypertext link when clicked
or to perform any defined QuickTime wired action when clicked. For
details on wired actions, see “Wired Action Grammar.”
The data stored is a QTAtomContainer.
The root atom of hypertext in this container is a wired-text atom of
type 'wtxt'.
This is the parent for all individual hypertext objects.
For each hypertext item, the parent atom is of type 'htxt'.
This is the atom container atom type. Two children of this atom
that define the offset of the hypertext in the text stream are
kRangeStart strt // unsigned long |
kRangeEnd end // unsigned long |
Child atoms of the parent atom are the events of type kQTEventType and
the ID of the event type. The children of these event atoms follow
the same format as other wired events.
kQTEventType, (kQTEventMouseClick, kQTEventMouseClickEnd, |
kQTEventMouseClickEndTriggerButton, |
kQTEventMouseEnter, kQTEventMouseExit) |
... |
kTextWiredObjectsAtomType, 1 |
kHyperTextItemAtomType, 1..n |
kRangeStart, 1 |
long |
kRangeEnd, 1 |
long |
kAction // The known range of track movie sprite actions |
Last updated: 2007-09-04