Products Product Support Downloads Gallery About us
 


ASP Turbine
 
Features
 
Samples
 
Download
 
Purchase
 
Documentation

 
 
   
Samples Menu

Text Capabilities Sample
(Flash MX/5; PDF)
   

Turbine can format text in powerful ways - for example the following MML tags display the Arial font in different styles, as selected by the common HTML <b> and <i> tags:

<Text>
  <Font face="Arial" size="30">
    This is text in Arial, <b>this in Arial Bold and <i>this in Arial bold italic.</i></b>
  </Font>
</Text>
 

The above tags will display in Flash as:
 

And in PDF as:
(a new window will open)

 

Color

Color can be used with all flexibility:

<Text>
  <font face="Arial" size="30" color="#ff0000">
    This is text in red,
  </font>
  <br>
  <font color="#00ff00" size="30">
    this is green and
  </font>
  <br>
  <font color="#0000ff" size="30">
    this one is in blue
  </font>
</Text>
 

The above tags will display in Flash as:
 

And in PDF as:

 

Align

Turbine can align text on the usual alignment types, by using the <p> tag:

<Text>
  <font face="Times New Roman" size="24">
    <p align="left">
      This is left-aligned text,
    </p>

    <p align="right">
      this is right-aligned text,
    </p>

    <p align="center">
      this is centered text and
    </p>

    <p align="justify">
      here we have lots and lots and lots and still lots and still lots and lots and lots and lots and lots and lots and lots of justified text.
    </p>

  </font>
</Text>
 

The above tags will display in Flash as:
 

 
And in PDF as:

 

Text Flow

More than aligning text, Turbine can layout text in flow areas, to create sophisticated page layouts - for example the following MML tags:

<Text bounds="0,0,600,70;400,70,600,140;0,140,600,200">
  <font face="Times New Roman" size="20">
    <p align="justify">Here we have lots and lots and lots and still lots and lots and lots of justified text. Still, text continues and continues and continues to make its way on and on across the available space. Sooner or later, surely text will at some point terminate, which is certainly a change from the current state of things! Well, and here we have lots and lots and lots and still lots and lots and lots of justified text. Still, text continues...
    </p>
  </font>
</Text>
 

The above tags will display in Flash as:
 

 
And in PDF as:

 

Unicode Support

Turbine supports Unicode, which means that it can handle any characters from English, Latin, Cyrillic, Middle East or Far East languages. Unicode characters can be entered through the usual XML entities, or directly from UTF-8 and Unicode text files. For example:

<Text>
  <font face="Arial" size="30">
    &#xca; &#xf6; &#xf1; &#x20ac; &#x2122;
    &#x3A3; &#x221e; &#x3a9;
    &#x0414; &#x06af; &#x0642; &#x1e82;
  </font>
</Text>
 

The above will display in Flash as:
 

And in PDF as:

 

Advanced Formatting

The above capabilities as well as advanced options like line leading, character spacing, <PRE> support and many others can be combined for sophisticated text formatting. For example, the following tags:

<Text>
  <font face="Arial" size="17">
    <p spacing="-1">This text has spacing set to -1.</p><br/>
    <p spacing="3">This text has spacing set to +3 pixels.</p><br/>
    <p>The next text is displayed with a <pre> tag, which causes space characters to be respected:</p>
    <pre>Some text, spaces and then text again.</pre><br/>
    <p><font color="#FF00FF">T</font><font color="#FF00CC">h</font>
<font color="#FF0099">i</font><font color="#FF0066">s</font>
<font color="#FF0033">t</font><font color="#FF0000">e</font>
<font color="#FF3300">x</font><font color="#FF6600">t</font>
<font color="#FF9900">i</font><font color="#FFCC00">s</font>
<font color="#FFFF00">r</font><font color="#CCFF00">a</font>
<font color="#99FF00">i</font><font color="#66FF00">n</font>
<font color="#33FF00">b</font><font color="#00FF00">o</font>
<font color="#00FF33">w</font> <font color="#00FF66">c</font>
<font color="#00FF99">o</font><font color="#00FFCC">l</font>
<font color="#00FFFF">o</font><font color="#00CCFF">r</font>
<font color="#0099FF">e</font><font color="#0066FF">d</font>
    </p><br/>
  </font>
</Text>
 

Display in Flash as:
 

 
 
And in PDF as:

 

Text Fields

Dynamic text fields are also very easy in Turbine MML:

<Text>Text Area:</Text>

<TextField size="300,100" flags="multiline,border,wrap">This text is editable and is inside a multiline text field. Click here to edit!
</TextField>
 

The following Flash movie is generated:
 

 
And in PDF as:

 

Samples Menu
   

 
Home  |  Products  |  Support  |  Downloads  |  Gallery  |  Company

Questions or comments? info@blue-pacific.com
© 2005 Blue Pacific Software, all rights reserved.
All trademarks are the property of their respective owners.