|
@@ -24,6 +24,7 @@ class BitmapFont extends Resource {
|
|
case 0x6D783F3C: // <?xm : XML file
|
|
case 0x6D783F3C: // <?xm : XML file
|
|
var xml = Xml.parse(entry.getBytes().toString());
|
|
var xml = Xml.parse(entry.getBytes().toString());
|
|
// support only the FontBuilder/Divo format
|
|
// support only the FontBuilder/Divo format
|
|
|
|
+ // export with FontBuilder https://github.com/andryblack/fontbuilder/downloads
|
|
var xml = new haxe.xml.Fast(xml.firstElement());
|
|
var xml = new haxe.xml.Fast(xml.firstElement());
|
|
size = Std.parseInt(xml.att.size);
|
|
size = Std.parseInt(xml.att.size);
|
|
lineHeight = Std.parseInt(xml.att.height);
|
|
lineHeight = Std.parseInt(xml.att.height);
|
|
@@ -32,7 +33,7 @@ class BitmapFont extends Resource {
|
|
var r = c.att.rect.split(" ");
|
|
var r = c.att.rect.split(" ");
|
|
var o = c.att.offset.split(" ");
|
|
var o = c.att.offset.split(" ");
|
|
var t = tile.sub(Std.parseInt(r[0]), Std.parseInt(r[1]), Std.parseInt(r[2]), Std.parseInt(r[3]), Std.parseInt(o[0]), Std.parseInt(o[1]));
|
|
var t = tile.sub(Std.parseInt(r[0]), Std.parseInt(r[1]), Std.parseInt(r[2]), Std.parseInt(r[3]), Std.parseInt(o[0]), Std.parseInt(o[1]));
|
|
- var fc = new h2d.Font.FontChar(t, Std.parseInt(c.att.width));
|
|
|
|
|
|
+ var fc = new h2d.Font.FontChar(t, Std.parseInt(c.att.width) - 1);
|
|
for( k in c.elements )
|
|
for( k in c.elements )
|
|
fc.addKerning(k.att.id.charCodeAt(0), Std.parseInt(k.att.advance));
|
|
fc.addKerning(k.att.id.charCodeAt(0), Std.parseInt(k.att.advance));
|
|
glyphs.set(c.att.code.charCodeAt(0), fc);
|
|
glyphs.set(c.att.code.charCodeAt(0), fc);
|