AS3字体SWF示例

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了AS3字体SWF示例相关的知识,希望对你有一定的参考价值。

This font SWF was created using the handy tool FontSwffer (http://blog.madebypi.co.uk/2011/02/28/fontswffer-1-1/)
  1. package {
  2.  
  3. import flash.display.Sprite;
  4.  
  5. public class FontSWF extends Sprite {
  6.  
  7. [Embed(source = "arial.ttf",
  8. fontName = "ArialRegular",
  9. fontStyle = "normal",
  10. fontWeight = "normal",
  11. unicodeRange = "U+0020-003C,U+003E-007E,U+00A0,U+00A3,U+00A9,U+00AC,U+00AE,U+00BA,U+2013,U+2018-2019,U+201C-201D,U+20AC",
  12. mimeType = "application/x-font",
  13. advancedAntiAliasing = true
  14. ,embedAsCFF=false)]
  15. public static var ArialRegular_normal_normal:Class;
  16.  
  17. [Embed(source = "arialbd.ttf",
  18. fontName = "ArialBold",
  19. fontStyle = "normal",
  20. fontWeight = "bold",
  21. unicodeRange = "U+0020-003C,U+003E-007E,U+00A0,U+00A3,U+00A9,U+00AC,U+00AE,U+00BA,U+2013,U+2018-2019,U+201C-201D,U+20AC",
  22. mimeType = "application/x-font",
  23. advancedAntiAliasing = true
  24. ,embedAsCFF=false)]
  25. public static var ArialBold_bold_normal:Class;
  26.  
  27. }
  28. }
  29.  
  30. // Handy URLs ...
  31. // http://blog.madebypi.co.uk/2011/02/28/fontswffer-1-1/
  32. // http://nochump.com/blog/archives/20
  33. // http://www.tillschneidereit.de/unicode_range_tool.html
  34. // http://yourpalmark.com/2009/04/05/embedding-fonts-using-external-swf-files/
  35. // http://blog.flexexamples.com/2007/10/25/embedding-fonts-from-a-flash-swf-file-into-a-flex-application/
  36.  
  37. // If you want to point to a relative folder you can do something like this ...
  38. // [Embed(source = "../assets/fonts/arial.ttf", fontName = "ArialRegular", fontWeight = "normal", mimeType = "application/x-font-truetype")]
  39. // private static var ARIAL_REGULAR_FONT:String;

以上是关于AS3字体SWF示例的主要内容,如果未能解决你的问题,请参考以下文章

AS3:如何在外部 swf 上的文本字段中使用 Android 默认字体?

AS3在运行时加载和访问外部SWF中的字体

ActionScript 3 AS3在运行时加载和访问外部SWF中的字体

AS3在Flex中嵌入系统字体

AS3 Loader 不断重新加载相同的 swf

as3 从网络外部加载 swf 以控制从网络外部加载的 swf