use font alignment
This commit is contained in:
@@ -153,10 +153,19 @@ void BitmapText::BuildChars()
|
|||||||
const glyph &g = m_pFont->GetGlyph(szLine[j]);
|
const glyph &g = m_pFont->GetGlyph(szLine[j]);
|
||||||
|
|
||||||
/* set vertex positions */
|
/* set vertex positions */
|
||||||
v[0].p = RageVector3( iX+g.hshift, iY+g.vshift, 0 ); // top left
|
float vshift = g.vshift;
|
||||||
v[1].p = RageVector3( iX+g.hshift, iY+g.vshift+g.height, 0 ); // bottom left
|
|
||||||
v[2].p = RageVector3( iX+g.hshift+g.width, iY+g.vshift+g.height, 0 ); // bottom right
|
/* Align the glyph with the font. If either the font or the glyph is
|
||||||
v[3].p = RageVector3( iX+g.hshift+g.width, iY+g.vshift, 0 ); // top right
|
* kanji, align the centers; otherwise align the baselines. */
|
||||||
|
if(m_pFont->IsKanjiFont() || g.fp->kanji)
|
||||||
|
vshift += m_pFont->GetCenter() - g.fp->center;
|
||||||
|
else
|
||||||
|
vshift += m_pFont->GetBaseline() - g.fp->baseline;
|
||||||
|
|
||||||
|
v[0].p = RageVector3( iX+g.hshift, iY+vshift, 0 ); // top left
|
||||||
|
v[1].p = RageVector3( iX+g.hshift, iY+vshift+g.height, 0 );// bottom left
|
||||||
|
v[2].p = RageVector3( iX+g.hshift+g.width, iY+vshift+g.height, 0 );// bottom right
|
||||||
|
v[3].p = RageVector3( iX+g.hshift+g.width, iY+vshift, 0 ); // top right
|
||||||
|
|
||||||
/* Advance the cursor. */
|
/* Advance the cursor. */
|
||||||
iX += g.hadvance;
|
iX += g.hadvance;
|
||||||
|
|||||||
Reference in New Issue
Block a user