Friday, December 24, 2010

Dynamic Text --- Look and Feel !

Dynamic texts are a high necessity today in many of the flash applications. But do we realize, that because such fields generate texts at run time, there could be issues with their clarity. It is always recommended and suggested to embed the characters explicitly for dynamic text fields. Input text fields too behave in the same way as the dynamic text fields, hence character embedding applies for them as well.


The following screenshots have 2 text fields, first one with character embedding and below that without character embedding. The first one, where the characters are embedded is sharper, consistent in color and texture, and brighter than the second text field.




Such a difference is because without embedding the characters in any text field, the font in use is the system font. Hence smoothing is not applied to it. But once, character embedding is done to it, the font becomes a part of the swf file, and we see a prominent difference in the text rendering.

For embedding the characters, we need to know what all characters to embed, like the alphabets, numerals, or punctuations. Click on the properties panel. Check for the "Character Embedding..." option. Select all options which need to be added. There are a few special characters that we can explicitly add in the "Auto fill" area. Below is the screenshot to explain the same.





It should be noted, that embedding the characters in the text field increase the size of the file. So only those characters should be embedded, which are a necessity for the text field. Unnecessary character embedding serves no good, but only increases the file size.


Sometimes, it is noticed that even you embed the characters, still some junk data is shown in the text field, mostly that of a small rectangle box. This is mainly due to the fact, that the font being used in the text field, doesn't support that character. But how to check whether its actually correct?


The best way to find this out is, (if you are windows user) run 'charmap' command. Go the the font that you are using. Check whether that particular character is present in the character list of that font or not. Like for instance, we are using the font "LCD", and the text is something like "75%", if we would observe the character map of this font, as shown below, the "%" character is missing from it.





So, even if you embed the punctuations to your text field, "%" sign will not appear. It will only appear if you would add the symbol explicitly to this character mapping. Each symbol is mapped to a Unicode, which remains same for all the fonts. Hence, it is necessary to add the symbol at the correct Unicode position, else it will not be reflected in the text field. In our example, the Unicode for "%" symbol is U+0025.



No comments:

Post a Comment