Set unicode range in embedded font using flex sdk - as3
I just noticed that setting the unicode range of an embedded font with the “systemFont” parameter doesn’t seem to work.
The only way to embed a font properly while specifying a character range is to use the “source” parameter and point to the file you want to embed.
To point to your desired font, you can either use an absolute or a relative path:
- absolute : “c:\windows\fonts\font.tff”
- relative : “/directory/font.ttf”
Then, simply use the “unicodeRange” parameter as follow :
Embed(source="font_file_name", fontName="font_name", mimeType="application/x-font-truetype", unicodeRange="U+0030-U+0039,U+002E")]
To get a complete list of all the unicode ranges available in flash since Flash MX 2004, just check the “flash-unicode-table.xml” file located in your “flex_sdk_directory\frameworks”.
Some of the commonly used ranges:
- Uppercase : U+0020,U+0041-U+005A
- Lowercase : U+0020,U+0061-U+007A
- Numerals : U+0030-U+0039,U+002E
- Punctuation : U+0020-U+002F,U+003A-U+0040,U+005B-U+0060,U+007B-U+007E
- Basic Latin : U+0020-U+002F, U+0030-U+0039, U+003A-U+0040, U+0041-U+005A, U+005B-U+0060, U+0061-U+007A, U+007B-U+007E
And don’t forget to set the “embedFonts” parameter of your TextField at “true“, otherwise your text simply won’t show.









Thank you for this article.
Common ranges it’s what I’d been looking for!
it does work… http://gotoandlearn.com/play?id=102
Leave your response!
Recent Posts
Categories
links
Meta