September 4, 2009
Anirudh Sasikumar of the Adobe Flex Evangelism team created an amazing app called “Readefine” that demonstrates the power of the Text Layout Framework. Readefine imports any HTML, RSS feed, or plain text data and displays it as organized multi-column TLF text adjusted for readability.
URL here: http://readefine.anirudhsasikumar.net
Be sure to check it out. Great work, Anirudh!
September 3, 2009
Introduction
The goal of this post is to give some information on TLF Markup. There is no DTD or other schema available at this time.
TLF Markup is converted to and from TextFlows using the TextConverter class. See the examples.
The attributes for TLF Markup are documented online and in the TextLayoutFormat class page bundled with the Flex 4 documentation. Get the documentation appropriate to the build you downloaded gumbo from here. Select the download from the “Language Reference Download” column.
Elements
The elements in TLF markup are all in the flashx.textLayout.elements package. This table maps elements to TLF classes and lists their allowed children.
| XML Tag |
AS3 Class |
Allowed Children Elements/Notes |
| TextFlow |
TextFlow |
div, p, tcy, a, img, span, br, tab, format, linkNormalFormat, linkHoverFormat, linkActiveFormat, and raw text |
| div |
DivElement |
div, p, tcy, a, img, span, br, tab, linkNormalFormat, linkHoverFormat, linkActiveFormat, and raw text |
| p |
ParagraphElement |
tcy, a, img, span, br, tab, linkNormalFormat, linkHoverFormat, linkActiveFormat, and raw text |
| a |
LinkElement |
tcy, img, span, br, tab, linkNormalFormat, linkHoverFormat, linkActiveFormat, and raw text |
| linkNormalFormat |
TextLayoutFormat |
attributes overrides for link in normal state. |
| linkActiveFormat |
TextLayoutFormat |
attributes overrides for link in active state. |
| linkHoverFormat |
TextLayoutFormat |
attributes overrides for link in hover state. |
| tcy |
TCYElement |
a, img, span, br, tab, linkNormalFormat, linkHoverFormat, linkActiveFormat, and raw text |
| img |
InlineGraphicElement |
none allowed. see docs for additional attributes |
| span |
SpanElement |
br, tab and raw text |
| br |
BreakElement |
none allowed. Is normalized into a newline character by importer. |
| tab |
TabElement |
none allowed. Is normalized into a tab character by importer. |