various subpixl bullshit; fix really obvious offset bug

This commit is contained in:
Chris Forbes
2010-02-25 21:34:14 +13:00
parent a33e36a174
commit 8271c4159a

View File

@@ -44,7 +44,11 @@ namespace OpenRa.Graphics
} }
var g = glyphs[s]; var g = glyphs[s];
r.DrawSprite(g.Sprite, p + g.Offset, "chrome"); r.DrawSprite(g.Sprite,
new float2(
(int)Math.Round(p.X + g.Offset.X, 0),
p.Y + g.Offset.Y),
"chrome");
p.X += g.Advance; p.X += g.Advance;
} }
@@ -72,8 +76,8 @@ namespace OpenRa.Graphics
var g = new GlyphInfo var g = new GlyphInfo
{ {
Sprite = s, Sprite = s,
Advance = _glyph.metrics.horiAdvance >> 6, Advance = _glyph.metrics.horiAdvance / 64f,
Offset = { X = -_glyph.bitmap_left, Y = -_glyph.bitmap_top } Offset = { X = _glyph.bitmap_left, Y = -_glyph.bitmap_top }
}; };
unsafe unsafe