Issue:
- Unable to use subscript or superscript in dynamic and input text field.
- Unable to display subscript or superscript for external loaded text.
- Unable to use <sub> & <sup> tags in dynamic or input text field.
- To create subscript or superscript text without Text Layout Framework (TLF).
Reason:
<sub> & <sup> tags are not supported by Flash.
TechNote: Subscript and superscript fail in dynamic and input text fields
LiveDocs: Supported HTML tags
Solution:
- Download & install GG Subscript & GG Superscript TrueType fonts. You will need to restart Flash software after installed fonts.
- Create a dynamic text field with Arial font embeded. Set the HTML property to true.
- Create a dynamic text field with GG Subscript font embeded.
- Create a dynamic text field with GG Superscript font embeded.
- Use HTML tag to set text to subscript or superscript like below:
Adobe<font face="GG Superscript">TM</font>
If you are using ActionScript to test the htmlText, use script like below:
my_txt.text = "Adobe<font face="GG Superscript">TM</font>";
Demo:
Download:
superscript.fla
superscript.swf
Updated: (2008-09-21)
A new set of superscript & subscript fonts includes both sans & serif type, with more complete & improved glyphs, standard scale & shift, is now available to be downloaded (free) from here.
Updated: (2010-10-23)
Another set of fonts for displaying square root (SQRT), cube root, nth root, and other roots formula in dynamic and input text field is now available here.
Related:
For creating subscript & superscript text with Text Layout Framework in AS3 or Flex project, refer to here