GoodBoyDigital/pixi.js — pull request #106 by krzysztof-o (2013-05-06 17:27:54+00:00)
Title: Bitmap fonts

I finished bitmap fonts support. In the example I used Desyrel font from [Starling](https://github.com/PrimaryFeather/Starling-Framework/tree/master/samples/demo/assets/fonts/2x).
Setting font color is currently not supported because of lack of tint.

```javascript
var loader = new PIXI.AssetLoader(["desyrel.fnt"]);
loader.onComplete = onAssetsLoaded;
loader.load();

function onAssetsLoaded()
{
var bitmapFontText = new PIXI.BitmapText("bitmap fonts are\n now supported!", {font: "35px Desyrel", align: "right"});
stage.addChild(bitmapFontText);
}
```

Btw. During refactoring loader classes I noticed that it could be problematic if you want to use built-in loaders to load some JSON or XML files. PIXI treats JSONs as spritesheets and XMLs as bitmap font files. I'd vote for changing it but I will require changing API to something like:

```javascript
var loader = new PIXI.AssetLoader({
font: ["desyrel.fnt"],
image: ["1.png", "2.png"],
spritesheet: ["mc.json"],
json: ["config.json"],
xml: ["data.xml"]
});
```