By Josep Valls
http://josep.valls.name
Sometimes you want to use a custom font on a website heading or title, to do so, you must ensure that the visitor have the font registered on its system, if not, the default font will be displayed wich will be annoying. To solve that, you could either use an image or a Flash movie to achieve this purpose. In this article I'll expose how to create a Flash object which dinamically loads its text.
Below is a Flash object with a custom font embedded.
The problem is that you will need to create images or flash objects for each text on your website.
You could also have a Flash object with a custom font embedded on it, read the text to be displayed passed through a parameter.
To do so, create a new Flash document:
Note: While the Flash object is loading, the text won't be displayed, there is another trick to fix it:
This way, the text will be displayed using a system font until your custom font is loaded.
Note: Bear in mind that you may not be able to do many Flash specific transformation to the textfield which won't work with dynamic text like rotating or animating the text.
Your file is ready to insert on your website.
flash_text.swf?mytext=sample
Note: If you want to use special characters (non english characters like è, ô, ï...) or spaces and punctuation, you'll need to embed them and escape (formerly encode in URLStringEncoded) the value of the parameter.
flash_text.swf?mytext=escaped%20%BFtext%3F
You could use EscapeStrings to quickly and easily escape character strings.
flash_text.fla
flash_text.swf
Flash source and exported file used in the above examples
flash_text2.fla
flash_text2.swf
Flash source and exported file used in the above examples with loading improvements
EscapeStrings.exe
Small tool for escaping strings. Self extracting, no installation. Requires Internet Explorer 5.0.
Download all support files (EscapeStrings_flash_text.zip)
http://sourceforge.net/projects/escapestrings
SourceForge.net project page for Escape Strings
http://josep.valls.name
Visit my website and mail me your suggestions or comments