Return to Snippet

Revision: 49355
at July 23, 2011 05:29 by adrianparr


Updated Code
package {
	
	import flash.display.Sprite;
	
	public class FontSWF extends Sprite {
		
		[Embed(source = "arial.ttf",
		fontName = "ArialRegular",
		fontStyle = "normal",
		fontWeight = "normal",
		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",
		mimeType = "application/x-font",
		advancedAntiAliasing = true
		,embedAsCFF=false)]
		public static var ArialRegular_normal_normal:Class;
		
		[Embed(source = "arialbd.ttf",
		fontName = "ArialBold",
		fontStyle = "normal",
		fontWeight = "bold",
		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",
		mimeType = "application/x-font",
		advancedAntiAliasing = true
		,embedAsCFF=false)]
		public static var ArialBold_bold_normal:Class;
		
	}
}

// Handy URLs ...
// http://blog.madebypi.co.uk/2011/02/28/fontswffer-1-1/
// http://nochump.com/blog/archives/20
// http://www.tillschneidereit.de/unicode_range_tool.html
// http://yourpalmark.com/2009/04/05/embedding-fonts-using-external-swf-files/
// http://blog.flexexamples.com/2007/10/25/embedding-fonts-from-a-flash-swf-file-into-a-flex-application/

// If you want to point to a relative folder you can do something like this ...
// [Embed(source = "../assets/fonts/arial.ttf", fontName = "ArialRegular", fontWeight = "normal", mimeType = "application/x-font-truetype")]
// private static var ARIAL_REGULAR_FONT:String;

Revision: 49354
at July 20, 2011 20:50 by adrianparr


Updated Code
package {
	
	import flash.display.Sprite;
	
	public class FontSWF extends Sprite {
		
		[Embed(source = "arial.ttf",
		fontName = "ArialRegular",
		fontStyle = "normal",
		fontWeight = "normal",
		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",
		mimeType = "application/x-font",
		advancedAntiAliasing = true
		,embedAsCFF=false)]
		public static var ArialRegular_normal_normal:Class;
		
		[Embed(source = "arialbd.ttf",
		fontName = "ArialBold",
		fontStyle = "normal",
		fontWeight = "bold",
		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",
		mimeType = "application/x-font",
		advancedAntiAliasing = true
		,embedAsCFF=false)]
		public static var ArialBold_bold_normal:Class;
		
	}
}

// Handy URLs ...
// http://blog.madebypi.co.uk/2011/02/28/fontswffer-1-1/
// http://nochump.com/blog/archives/20
// http://www.tillschneidereit.de/unicode_range_tool.html
// http://yourpalmark.com/2009/04/05/embedding-fonts-using-external-swf-files/
// http://blog.flexexamples.com/2007/10/25/embedding-fonts-from-a-flash-swf-file-into-a-flex-application/

Revision: 49353
at July 20, 2011 19:43 by adrianparr


Initial Code
package {
	
	import flash.display.Sprite;
	
	public class FontSWF extends Sprite {
		
		[Embed(source = "arial.ttf",
		fontName = "ArialRegular",
		fontStyle = "normal",
		fontWeight = "normal",
		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",
		mimeType = "application/x-font",
		advancedAntiAliasing = true
		,embedAsCFF=false)]
		public static var ArialRegular_normal_normal:Class;
		
		[Embed(source = "arialbd.ttf",
		fontName = "ArialBold",
		fontStyle = "normal",
		fontWeight = "bold",
		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",
		mimeType = "application/x-font",
		advancedAntiAliasing = true
		,embedAsCFF=false)]
		public static var ArialBold_bold_normal:Class;
		
	}
}

// Handy URLs ...
// http://blog.madebypi.co.uk/2011/02/28/fontswffer-1-1/
// http://www.tillschneidereit.de/unicode_range_tool.html
// http://yourpalmark.com/2009/04/05/embedding-fonts-using-external-swf-files/
// http://blog.flexexamples.com/2007/10/25/embedding-fonts-from-a-flash-swf-file-into-a-flex-application/

Initial URL

                                

Initial Description
This font SWF was created using the handy tool FontSwffer (http://blog.madebypi.co.uk/2011/02/28/fontswffer-1-1/)

Initial Title
AS3 Example Font SWF

Initial Tags
load

Initial Language
ActionScript 3