Browse Source

fixed letter spacing (already have one pixel by default)

ncannasse 11 years ago
parent
commit
abbc4283a1
1 changed files with 2 additions and 1 deletions
  1. 2 1
      hxd/res/BitmapFont.hx

+ 2 - 1
hxd/res/BitmapFont.hx

@@ -24,6 +24,7 @@ class BitmapFont extends Resource {
 		case 0x6D783F3C: // <?xm : XML file
 			var xml = Xml.parse(entry.getBytes().toString());
 			// support only the FontBuilder/Divo format
+			// export with FontBuilder https://github.com/andryblack/fontbuilder/downloads
 			var xml = new haxe.xml.Fast(xml.firstElement());
 			size = Std.parseInt(xml.att.size);
 			lineHeight = Std.parseInt(xml.att.height);
@@ -32,7 +33,7 @@ class BitmapFont extends Resource {
 				var r = c.att.rect.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 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 )
 					fc.addKerning(k.att.id.charCodeAt(0), Std.parseInt(k.att.advance));
 				glyphs.set(c.att.code.charCodeAt(0), fc);