I've just pushed some code to support drawing text with fonts. The font loading is done in JS, with the help of a new ByteArray.toSurface method to directly convert bytes. It's fast! The new API has also gained ByteArray.toString, which functions as CreateByteArrayFromString.

The JS for the Font class is very simple:
function Font(path) {
this.file = new _sphere.fs.File(path);
var signature = this.file.read(4).toString();
var version = int16val(this.file.read(2));
var num_glyphs = int16val(this.file.read(2));
this.file.read(248); // reserved.
this.glyphs = [];
for (var i = 0; i < num_glyphs; i++) {
var width = int16val(this.file.read(2));
var height = int16val(this.file.read(2));
this.file.read(28); // reserved.
if (version != 2) {
_sphere.engine.abort("Expected version 2 rfn");
}
else {
var bytes = width * height * 4;
this.glyphs.push({
width: width,
height: height,
surface: this.file.read(bytes).toSurface(width, height)
});
}
}
}
Font.prototype.drawText = function(x, y, string) {
for (var i = 0; i < string.length; i++) {
var chr = string.charCodeAt(i);
screen.blitSurface(this.glyphs[chr].surface, x, y);
x += this.glyphs[chr].width;
}
};
I'm trying to keep it as flexible as possible, but I haven't really tested it. If using it more than once works, it's not supposed to yet.
Also, this thing leaks memory like a sieve right now.