get rid of Kanji= flag; just push the baseline up a little
This commit is contained in:
@@ -171,17 +171,10 @@ 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 */
|
||||||
float vshift = float(g.fp->vshift);
|
v[0].p = RageVector3( iX+g.hshift, iY+g.fp->vshift, 0 ); // top left
|
||||||
|
v[1].p = RageVector3( iX+g.hshift, iY+g.fp->vshift+g.height, 0 ); // bottom left
|
||||||
/* If either the font or the glyph is kanji, align the character
|
v[2].p = RageVector3( iX+g.hshift+g.width, iY+g.fp->vshift+g.height, 0 ); // bottom right
|
||||||
* centers. (Otherwise, leave it aligned at the baseline.) */
|
v[3].p = RageVector3( iX+g.hshift+g.width, iY+g.fp->vshift, 0 ); // top right
|
||||||
if(m_pFont->IsKanjiFont() || g.fp->kanji)
|
|
||||||
vshift += g.fp->GetCenter() - m_pFont->GetCenter();
|
|
||||||
|
|
||||||
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;
|
||||||
|
|||||||
@@ -39,8 +39,6 @@ void FontPage::Load( const FontPageSettings &cfg )
|
|||||||
m_pTexture = TEXTUREMAN->LoadTexture( m_sTexturePath );
|
m_pTexture = TEXTUREMAN->LoadTexture( m_sTexturePath );
|
||||||
ASSERT( m_pTexture != NULL );
|
ASSERT( m_pTexture != NULL );
|
||||||
|
|
||||||
kanji = cfg.Kanji;
|
|
||||||
|
|
||||||
// load character widths
|
// load character widths
|
||||||
vector<int> FrameWidths;
|
vector<int> FrameWidths;
|
||||||
int i;
|
int i;
|
||||||
@@ -99,7 +97,7 @@ void FontPage::Load( const FontPageSettings &cfg )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Shift the character up so the top will be rendered at the baseline. */
|
/* Shift the character up so the top will be rendered at the baseline. */
|
||||||
vshift = -baseline;
|
vshift = (float) -baseline;
|
||||||
|
|
||||||
SetTextureCoords(FrameWidths);
|
SetTextureCoords(FrameWidths);
|
||||||
SetExtraPixels(cfg.DrawExtraPixelsLeft, cfg.DrawExtraPixelsRight);
|
SetExtraPixels(cfg.DrawExtraPixelsLeft, cfg.DrawExtraPixelsRight);
|
||||||
@@ -440,7 +438,6 @@ void Font::LoadFontPageSettings(FontPageSettings &cfg, IniFile &ini, const CStri
|
|||||||
ini.GetValueI( PageName, "LineSpacing", cfg.LineSpacing );
|
ini.GetValueI( PageName, "LineSpacing", cfg.LineSpacing );
|
||||||
ini.GetValueI( PageName, "Top", cfg.Top );
|
ini.GetValueI( PageName, "Top", cfg.Top );
|
||||||
ini.GetValueI( PageName, "Baseline", cfg.Baseline );
|
ini.GetValueI( PageName, "Baseline", cfg.Baseline );
|
||||||
ini.GetValueB( PageName, "Kanji", cfg.Kanji );
|
|
||||||
|
|
||||||
/* Iterate over all keys. */
|
/* Iterate over all keys. */
|
||||||
const IniFile::key *k = ini.GetKey(PageName);
|
const IniFile::key *k = ini.GetKey(PageName);
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ struct FontPageSettings
|
|||||||
Top,
|
Top,
|
||||||
Baseline;
|
Baseline;
|
||||||
float ScaleAllWidthsBy;
|
float ScaleAllWidthsBy;
|
||||||
bool Kanji;
|
|
||||||
|
|
||||||
map<longchar,int> CharToGlyphNo;
|
map<longchar,int> CharToGlyphNo;
|
||||||
/* If a value is missing, the width of the texture frame is used. */
|
/* If a value is missing, the width of the texture frame is used. */
|
||||||
@@ -57,8 +56,7 @@ struct FontPageSettings
|
|||||||
LineSpacing(-1),
|
LineSpacing(-1),
|
||||||
ScaleAllWidthsBy(1),
|
ScaleAllWidthsBy(1),
|
||||||
Top(-1),
|
Top(-1),
|
||||||
Baseline(-1),
|
Baseline(-1)
|
||||||
Kanji(false)
|
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -81,8 +79,8 @@ public:
|
|||||||
|
|
||||||
/* Page-global properties. */
|
/* Page-global properties. */
|
||||||
int height;
|
int height;
|
||||||
bool kanji;
|
int LineSpacing;
|
||||||
int LineSpacing, vshift;
|
float vshift;
|
||||||
int GetCenter() const { return height/2; }
|
int GetCenter() const { return height/2; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -120,7 +118,6 @@ public:
|
|||||||
void CapsOnly();
|
void CapsOnly();
|
||||||
|
|
||||||
int GetHeight() const { return def->height; }
|
int GetHeight() const { return def->height; }
|
||||||
bool IsKanjiFont() const { return def->kanji; }
|
|
||||||
int GetCenter() const { return def->GetCenter(); }
|
int GetCenter() const { return def->GetCenter(); }
|
||||||
int GetLineSpacing() const { return def->LineSpacing; }
|
int GetLineSpacing() const { return def->LineSpacing; }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user