Your Ad Here

Posted By

adrianparr on 07/13/11


Tagged

css embed MIMEtype font as3 fonts fontName systemFont fontFamily fontWeight


Versions (?)

AS3 Embed font example metadata


 / Published in: ActionScript 3
 

  1. // Embed a font that is alreay installed on your system like this ...
  2. [Embed(systemFont = 'Arial', fontName = "ArialRegular", fontWeight = "normal", mimeType = "application/x-font-truetype")]
  3. private static var ARIAL_REGULAR_FONT:String;
  4.  
  5. [Embed(systemFont='Arial', fontName = "ArialBold", fontWeight="bold", mimeType = "application/x-font-truetype")]
  6. private static var ARIAL_BOLD_FONT:String;
  7.  
  8. // Embed a font using it's file like this ...
  9. [Embed(source='../assets/fonts/arial.ttf', fontFamily = "ArialRegular", fontWeight="normal", mimeType="application/x-font-truetype")]
  10. private static var ARIAL_REGULAR_FONT:String;
  11.  
  12. [Embed(source = '../assets/fonts/arialbd.ttf', fontFamily = "ArialBold", fontWeight="bold", mimeType = "application/x-font-truetype")]
  13. private static var ARIAL_BOLD_FONT:String;
  14.  
  15. // You could then use these embedded fonts in your CSS like so ...
  16. .title {
  17. font-family: ArialBold;
  18. font-size: 16px;
  19. color: #000000;
  20. text-align: center;
  21. }
  22.  
  23. .body {
  24. font-family: ArialRegular;
  25. font-size: 12px;
  26. color: #000000;
  27. text-align: left;
  28. }

Report this snippet  

You need to login to post a comment.