diff --git a/src/BitmapText.cpp b/src/BitmapText.cpp index 1cf3a8419b..701a817381 100644 --- a/src/BitmapText.cpp +++ b/src/BitmapText.cpp @@ -414,6 +414,10 @@ void BitmapText::DrawChars( bool bUseStrokeTexture ) m_aVertices[i+j].c.a = (unsigned char)( m_aVertices[i+j].c.a * fAlpha ); } } + + bool bDistanceField = m_pFont->IsDistanceField(); + if( bDistanceField ) + DISPLAY->SetEffectMode( EffectMode_DistanceField ); for( int start = iStartGlyph; start < iEndGlyph; ) { @@ -443,6 +447,8 @@ void BitmapText::DrawChars( bool bUseStrokeTexture ) start = end; } + if( bDistanceField ) + DISPLAY->SetEffectMode( EffectMode_Normal ); } /* sText is UTF-8. If not all of the characters in sText are available in the diff --git a/src/Font.cpp b/src/Font.cpp index 99610d8c4d..243d63773a 100644 --- a/src/Font.cpp +++ b/src/Font.cpp @@ -272,7 +272,7 @@ int Font::GetGlyphsThatFit(const wstring& line, int* width) const } Font::Font(): m_iRefCount(1), path(""), m_apPages(), m_pDefault(NULL), - m_iCharToGlyph(), m_bRightToLeft(false), + m_iCharToGlyph(), m_bRightToLeft(false), m_bDistanceField(false), // strokes aren't shown by default, hence the Color. m_DefaultStrokeColor(RageColor(0,0,0,0)), m_sChars("") {} Font::~Font() @@ -785,6 +785,7 @@ void Font::Load( const RString &sIniPath, RString sChars ) ini.RenameKey("Char Widths", "main"); // backward compat ini.GetValue( "common", "CapitalsOnly", bCapitalsOnly ); ini.GetValue( "common", "RightToLeft", m_bRightToLeft ); + ini.GetValue( "common", "DistanceField", m_bDistanceField ); RString s; if( ini.GetValue( "common", "DefaultStrokeColor", s ) ) m_DefaultStrokeColor.FromString( s ); diff --git a/src/Font.h b/src/Font.h index b24faff671..da06841192 100644 --- a/src/Font.h +++ b/src/Font.h @@ -174,6 +174,7 @@ public: void SetDefaultGlyph( FontPage *pPage ); bool IsRightToLeft() const { return m_bRightToLeft; }; + bool IsDistanceField() const { return m_bDistanceField; }; const RageColor &GetDefaultStrokeColor() const { return m_DefaultStrokeColor; }; private: @@ -198,6 +199,8 @@ private: * This will also change the way glyphs from the default FontPage are rendered. * There may be a better way to handle this. */ bool m_bRightToLeft; + + bool m_bDistanceField; RageColor m_DefaultStrokeColor;