public BitmapFontAssetInfo readFontAsset( BMFontDefinition fontAsset ) { this.fontAsset = fontAsset; // Create context ctx = MovieClipPlayer.getRuntimeContent( "BMUserFonts"); ctx.resourceLoader = MovieClip.rootResourceLoader; // Create dyn font fontInfo = BitmapTextField.createBitmapFont( fontAsset.fontName, ctx ); fontInfo.name = fontAsset.fontName; fontInfo.size = fontAsset.size; fontInfo.color = Color.white; #if !UNITY_WP8 // Convert to xml XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml( fontAsset.fontAsset.text ); foreach (XmlNode node in xmlDoc) { if( node.Name == "font" ) { HandleFontTag( node ); } } #endif return fontInfo; }
public static void registerFonts( BMFontDefinition[] bmFonts ) { for( int i=0;i<bmFonts.Length;i++ ) { if( bmFonts[i] == null ) { continue; } BMFontReader reader = new BMFontReader(); reader.readFontAsset( bmFonts[i] ); } }