|
|
Text Layout Framework MarkupText Layout Framework Markup provides the highest fidelity representation of text in a TextFlow because the markup language provides not only tags for each of the TextFlow hierarchy’s basic elements, but also attributes for all formatting properties available in the TextLayoutFormat class. The following table contains the tags that can be used in Text Layout Framework Markup.
The formatting properties, which can be found in the TextLayoutFormat class, can be assigned directly to an element tag as an XML attribute. For example, in the following Text Layout Framework Markup the fontSize of the entire TextFlow is 14 and the color of the second paragraph is blue except for the last SpanElement, which is red because the color attribute in the last SpanElement overrides the color attribute of its parent in the hierarchy. <flow:TextFlow xmlns:flow="http://ns.adobe.com/textLayout/2008" fontSize="14">
<flow:p>This is an example of Text Layout Framework Markup.</flow:p>
<flow:p color="#0000ff">
<flow:span>This is the first span of the second paragraph.</flow:span>
<flow:span color="#ff0000">This is the second span of the second paragraph.</flow:span>
</flow:p>
</flow:TextFlow>;
You can also use the format tag to create a named set of formatting properties, which behaves like an instance of the TextLayoutFormat class. In the following example, a named set of properties called “english” is applied to a span of text. <TextFlow xmlns="http://ns.adobe.com/textLayout/2008" fontSize="14">
<format id="english" locale="en" fontFamily="Minion Pro"/>
<p paragraphSpaceAfter="15"><span>This is supposed to use the default font</span></p>
<p paragraphSpaceAfter="15"><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>
If a property is set using both a named set and direct assignment to an element tag, the direct assignment value will apply. |