TLF Showcase: Readefine

| No Comments

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!

TLF Markup Overview

| No Comments

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 best documented on 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 TagAS3 ClassAllowed Children Elements/Notes
TextFlowTextFlowdiv, p, tcy, a, img, span, br, tab, format, linkNormalFormat, linkHoverFormat, linkActiveFormat, and raw text
divDivElementdiv, p, tcy, a, img, span, br, tab, linkNormalFormat, linkHoverFormat, linkActiveFormat, and raw text
pParagraphElementtcy, a, img, span, br, tab, linkNormalFormat, linkHoverFormat, linkActiveFormat, and raw text
aLinkElementtcy, img, span, br, tab, linkNormalFormat, linkHoverFormat, linkActiveFormat, and raw text
linkNormalFormatTextLayoutFormatattributes overrides for link in normal state.
linkActiveFormatTextLayoutFormatattributes overrides for link in active state.
linkHoverFormatTextLayoutFormatattributes overrides for link in hover state.
tcyTCYElementa, img, span, br, tab, linkNormalFormat, linkHoverFormat, linkActiveFormat, and raw text
imgInlineGraphicElementnone allowed. see docs for additional attributes
spanSpanElementbr, tab and raw text
brBreakElementnone allowed. Is normalized into a newline character by importer.
tabTabElementnone allowed. Is normalized into a tab character by importer.
formatTextLayoutFormatnone allowed. See additional note.

Format Element
The format element allows the markup to specify a format that can be referenced by other elements. For example:

<TextFlow xmlns="http://ns.adobe.com/textLayout/2008">
    <format id="english" fontFamily="Minion Pro"/>
    <p><span>This is supposed to use the default font</span></p>
    <p><span format="english">This is supposed to be in Minion Pro via a named format</span></p>
    <p><span fontFamily="Minion Pro">This is supposed to be in Minion Pro via a fontFamily attribute</span></p>
</TextFlow>

NOTE: The attribute id in the format element is going to be changed to name. Check the ReleaseNotes posted with each TLF build.

Today we're making the announcement that the Text Layout Framework is being released as open source technology. We're very excited about opening our hard work to the world and can't wait to see your feedback and contributions!

We're releasing the source code and accepting new code as part of the Flex bugbase with a specific TLF tag. More information on the Flex bugbase and contributing to TLF can be found on our new open source web page at: http://opensource.adobe.com/wiki/display/tlf/Text+Layout+Framework

Find out more on the announcement from the following sources:

Tom Barclay wrote on the Flash Platform blog about TLF and Open Source Media Framework announcement, including highlighting some of the excellent technology already powered by TLF:
http://blogs.adobe.com/flashplatform/

Dave McAllister describes the Open@Adobe strategy: http://www.youtube.com/watch?v=eNzrn8-JFSE

An excellent tutorial on how to use the Text Layout Framwork with MXML tags was written by Elad Elrom on InsideRIA. This is great info for anyone looking to use TLF in Flex! Check it out here:

Utilizing Flash Text Layout Framework using MXML tags

Adobe just released a preview of Acrobat.com Presentations, a new online service that lets people easily create and collaborate on presentations. The Text Layout Framework is used for all the text objects in the slides. Here is what Norman Stratton of the Presentations team had to say about his experience with TLF:

"The Text Layout Framework saved me a boat load of time and allowed for features I wouldn’t have had time to write using the older text technology. I started writing the text objects using regular TextArea and switched to the Text Layout Framework as soon as it was stable enough, and I could get consensus to switch to Player 10. Switching to the Text Layout Framework let me get rid of over half my old code and made text support much more stable. I can only imagine what I would have had to do to get the same functionality the old way (and I try not to think of it)."

Be sure to check out the preview on Adobe Labs: http://labs.adobe.com/technologies/presentations

Recent Comments

  • Daniel Perujo: Hi! I'm trying to build my own font SWF to read more
  • Brian Thomas: Hi Rafique, I'm sorry to say that I don't have read more
  • Rafique Gilani: Hi Brian, Any update on "wrapping text around InlineGraphicElement" feature. read more
  • Brian Thomas: Lindsey - Yes, we are referring to Flash Pro 11, read more
  • vi: now what?? are we stuck on using crappy html support read more
  • Lindsey Thomas Martin: Can we take it that 'future versions' means 11 or read more
  • Michael Prescott: That would be great! I've been trying to work with read more
  • Brian Thomas: Michael, The source for TLF is not available. This is read more
  • Michael Prescott: Is the source for the text layout framework available? read more
  • Daniel Perujo: I'm trying to create the subset font pack by myself. read more

Find recent content on the main index or look in the archives to find all content.