AS3 Embed a system font in Flex


/ Published in: ActionScript 3
Save to your folder(s)



Copy this code and paste it in your HTML
  1. package {
  2. import flash.display.Sprite;
  3. import flash.text.Font;
  4.  
  5. [SWF(width='600', height='400', frameRate='30', backgroundColor='#000000')]
  6.  
  7. public class App extends Sprite {
  8. [Embed(systemFont='Arial',fontName='Arial',mimeType='application/x-font')]
  9. private var arialFont:Class;
  10.  
  11. public function App() {
  12. init();
  13. }
  14.  
  15. private function init():void {
  16. Font.registerFont( arialFont );
  17. }
  18. }
  19. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.