Flex application & new fonts
June 30, 2009 at 5:21 PM | In Flex / AS, Internet, Programming | Leave a CommentTags: dynamic font, embed, flex, font, recompile, swf
A typical requirement was to provide some means so that anyone can upload / add new font(s) and the same can be used by Flex application. The Flex project should not require recompilation process.
Font, as a TTF or FON file cannot be used unless embedded, but that requires recompilation.
Searching around net gave me a way to solve this gave me a reasonable good solution.
Instead of specifying external styles such as <mx:Style source=”assets/styles/fonts.css”/> I used StyleManager.
Any change in fonts.css requires project recompilation to get the change in effect.
So, I compiled fonts.css using mxmlc fonts.css . This compiled CSS to SWF.
Then I loaded fonts at runtime using StyleManager.loadStyleDeclarations(“fonts.swf”, true, true);
And that’s it….! The font(s) inside fonts.swf can be used and that gives the same effect as embedded.
No Comments Yet »
RSS feed for comments on this post. TrackBack URI
Leave a comment
Navigate
-
Recent Posts
-
Top Posts
- Ad Hoc Wireless Networking with Ubuntu
- 3 ways to get control in Flex over user input through Keyboard
- RIA in a new avtar with Flash Builder 4
- Simple solution to a complex problem - customized Rich Text Editor
- Font transcoding error - specify font style
- Online Forms : Wufoo v/s Google Forms
- alpha & rotation issue for textArea with htmlText
- Screen Magnifying Software
- 11 days vacation
Blogroll
Gujarati
RSS
Visitors
Archieves
Tags
actionscript adobe ahmedabad bihar bsnl bug Camera celebration code css digital eclipse email firefox flex flex 3 flex 4 flex sdk font fwd Google gujarat harit kothari home icici image India Internet ip IT jain jharkhand magazine Management mozilla network Photography Programming sdk Security sms Story twitter university VacationCategory Cloud
-
Recent Comments
‘Post’ Calendar
-
Blog Stats
- 11,542 hits
Current Visitor Count

Tweets
- @abhishekdesai if it is so, they will pay cost.... in fact from day before yesterday it's slowly started! written 1 month ago
- @abhishekdesai i have little respect for the company so dont want to show naked thief in open! written 1 month ago
- ahmedabad's 'biggest' IT company breaches contract (with employee)! #alert #IT #ahmedabad #fail written 1 month ago
- experiencing gmail very slow with standard view! :( written 2 months ago
- wishing all netizen friends a very happy diwali! :) written 2 months ago
Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.
