SimpleTextDrawer: Fix Faux-Bold
This commit is contained in:
parent
e512302305
commit
84e5ea0023
|
|
@ -318,6 +318,10 @@ namespace Nz
|
||||||
glyph.color = m_color;
|
glyph.color = m_color;
|
||||||
glyph.flipped = fontGlyph.flipped;
|
glyph.flipped = fontGlyph.flipped;
|
||||||
|
|
||||||
|
glyph.bounds.Set(fontGlyph.aabb);
|
||||||
|
glyph.bounds.x += m_drawPos.x;
|
||||||
|
glyph.bounds.y += m_drawPos.y;
|
||||||
|
|
||||||
if (fontGlyph.requireFauxBold)
|
if (fontGlyph.requireFauxBold)
|
||||||
{
|
{
|
||||||
// Let's simulate bold by enlarging the glyph (not a neat idea, but should work)
|
// Let's simulate bold by enlarging the glyph (not a neat idea, but should work)
|
||||||
|
|
@ -329,16 +333,13 @@ namespace Nz
|
||||||
|
|
||||||
// Replace it at the correct height
|
// Replace it at the correct height
|
||||||
Vector2f offset(glyph.bounds.GetCenter() - center);
|
Vector2f offset(glyph.bounds.GetCenter() - center);
|
||||||
|
glyph.bounds.x -= offset.x;
|
||||||
glyph.bounds.y -= offset.y;
|
glyph.bounds.y -= offset.y;
|
||||||
|
|
||||||
// Adjust advance (+10%)
|
// Adjust advance (+10%)
|
||||||
advance += advance / 10;
|
advance += advance / 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
glyph.bounds.Set(fontGlyph.aabb);
|
|
||||||
glyph.bounds.x += m_drawPos.x;
|
|
||||||
glyph.bounds.y += m_drawPos.y;
|
|
||||||
|
|
||||||
// We "lean" the glyph to simulate italics style
|
// We "lean" the glyph to simulate italics style
|
||||||
float italic = (fontGlyph.requireFauxItalic) ? 0.208f : 0.f;
|
float italic = (fontGlyph.requireFauxItalic) ? 0.208f : 0.f;
|
||||||
float italicTop = italic * glyph.bounds.y;
|
float italicTop = italic * glyph.bounds.y;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue