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.

Leave a comment

About this Entry

This page contains a single entry by Richard Dermer published on September 3, 2009 4:05 PM.

The Text Layout Framework is now Open Source! was the previous entry in this blog.

TLF Showcase: Readefine is the next entry in this blog.

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