XML/SWF Charts| CSS/XML Timeline Eons(New)| Timeline Eons| SlickBoard

 < previousnext > 

 

embed

 

<embed url='string' timeout='number' retry='number'>
     <font>string</font>
   [ <font>string</font> ]
</embed>
            


Description

embed imports a flash file containing fonts to use in addition to the default Arial font.

This feature requires Actionscript 3 and some Flash knowledge not covered by this tool. For technical information related to Flash, please refer to the Flash manual.

The embed attributes are:

  • url: The URL of a swf file that contains library fonts.

  • timeout: The number of seconds to wait before loading the file times out. The default is 30 seconds.

  • retry: The number of times to try loading the file before displaying a loading error message. The default is 2 (try twice).

The embed tags enclose the list of library fonts found inside the swf file.

 


Embedded & Non-Embedded Fonts

XML/SWF Charts comes with the font Arial bold embedded in it. This font can be used by setting the font attribute to arial in functions that display text. Examples:

<draw>
    <text font='arial'>Hello World!</text>   
</draw>

<axis_category font='arial' />

 

You may use any other non-embedded font too. If the local machine doesn't have the exact font, Flash uses whatever font most closely resembles it.

<draw>
    <text font='century'>Hello World!</text>   
</draw>

 

The differences are:

  Embedded Font Non-Embedded Font
Special Characters Displays only English characters. Displays special characters and any language.
Consistency Looks the same on all machines. May look different on different machines.
Transparency Can be transparent. Always opaque.
Rotation Can be rotated. Always horizontal.
Sharpness Best with large text. More legible with small text.

 

The main disadvantage of embedded fonts is that they increase the size of the flash file, the reason why the tool comes with only one embedded font (the gallery uses only the embedded Arial font).

 


Embedding New Fonts

To embed new fonts:

1. Create a new Flash Actionscript 3.0 file.
2. Open the library panel.
3. Select New Font from the options menu in the upper right corner of the Library panel.
4. In the Font Symbol Properties dialog box, enter any name in the Name text box. This is a case-sensitive font name that will be used in the chart.
5. Select a font from the Font menu.

6. Click OK.
7. While the new library font is highlighted, select Linkage from the options menu in the upper right corner of the Library panel.
8. Under Linkage, select Export for ActionScript.
9. Select Export in first frame.

10. Click OK. If Flash gives a warning message, click OK again.

 

To embed more than one font, repeat the above steps, giving each font a unique name. Then, save and publish the flash file to create a .swf file.

To import the new fonts and use them in a chart, add the embed function to the XML Source. Example:


<embed url='http://your_server/fonts.swf' > <!-- the url of the swf file containing the library fonts -->   
   <font>cracked</font> <!-- font name created in step 4 above -->  
   <font>curlz</font> <!-- font name created in step 4 above -->  
</embed>

 

To display the new fonts, use the names created in step 4 above:

<draw>
    <text font='cracked'>Hello World!</text>   
</draw>

<axis_category font='curlz' />

 

 

Example


<chart>
   <embed url='images/fonts.swf' > 
      <font>cracked</font>
   </embed>

   <axis_category font='cracked' size='20' />

   <draw>
      <text font='cracked' x='90' y='75' size='65' color='FF4400' alpha='75'>My new Font!</text>   
   </draw>

</chart>

 

 < previousnext > 


Copyright © 2003-2017, maani.us