package classes.matuto.utils {
	
	
	import flash.text.TextFormat;
	
	/**
	* ...
	* @author Default
	*/
	final public class FontManager {
		
		
		private static var fonts	:Object = new Object();
		
		/**
		 *
		 * @param	font Deve ser do tipo 'Font' ou 'String'
		 * @param	id Identificador
		 */
		public static function registerFont( font :*, id :String ) :void
		{
			
			fonts[id] = font;
			
		}
		
		
		public static function getFontName( id :String ) :String
		{
			
			try{
				return fonts[id].fontName;
			}catch( e :Error ){
			}
			
			return  "";
			
		}
		
		
		public static function getTextFormat( id :String ) :TextFormat
		{
			
			var format :TextFormat = new TextFormat();
			
			try{
				format.font = fonts[id].fontName;
			}catch( e :Error ){
			}
			
			return format;
			
		}
		
		
		
		public function getFonts() :Array
		{
			
			var arr :Array = new Array();
			
			for (var i :String in arr)
			{
				
				arr.push( arr[i] );
				
			}
			
			
			return arr;
			
		}
		
		
	}
	
}