From 99e1657ea3af5ecf5e444aeaa81e0ee2fff3ecdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Wed, 21 Aug 2013 15:58:00 -0300 Subject: [PATCH] Changed cTTFFont::OutlineMethod to cTTFont::OutlineMethods. Changed cTTFFont::DefaultOutlineMethod to cTTFFont::OutlineMethod. --- include/eepp/graphics/cttffont.hpp | 4 ++-- projects/linux/ee.creator.user | 2 +- src/eepp/graphics/cttffont.cpp | 14 +++++++------- src/examples/fonts/fonts.cpp | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/eepp/graphics/cttffont.hpp b/include/eepp/graphics/cttffont.hpp index a6e6c2de0..78424065f 100755 --- a/include/eepp/graphics/cttffont.hpp +++ b/include/eepp/graphics/cttffont.hpp @@ -14,14 +14,14 @@ namespace EE { namespace Graphics { /** @brief This class loads True Type Font and then draw strings to the screen. */ class EE_API cTTFFont : public cFont { public: - enum OutlineMethod + enum OutlineMethods { OutlineEntropia, //! Slow, but better for small fonts OutlineFreetype //! Faster, usually better for big fonts }; //! Let the user select the default method to use for outlining the glyphs - static OutlineMethod DefaultOutlineMethod; + static OutlineMethods OutlineMethod; /** Creates an instance of a true type font */ static cTTFFont * New( const std::string FontName ); diff --git a/projects/linux/ee.creator.user b/projects/linux/ee.creator.user index 28f3086b4..23703bf2e 100644 --- a/projects/linux/ee.creator.user +++ b/projects/linux/ee.creator.user @@ -1,6 +1,6 @@ - + ProjectExplorer.Project.ActiveTarget diff --git a/src/eepp/graphics/cttffont.cpp b/src/eepp/graphics/cttffont.cpp index cebaef84d..3d2cc1db3 100755 --- a/src/eepp/graphics/cttffont.cpp +++ b/src/eepp/graphics/cttffont.cpp @@ -6,7 +6,7 @@ using namespace HaikuTTF; namespace EE { namespace Graphics { -cTTFFont::OutlineMethod cTTFFont::DefaultOutlineMethod = cTTFFont::OutlineEntropia; +cTTFFont::OutlineMethods cTTFFont::OutlineMethod = cTTFFont::OutlineEntropia; cTTFFont * cTTFFont::New( const std::string FontName ) { return eeNew( cTTFFont, ( FontName ) ); @@ -47,7 +47,7 @@ bool cTTFFont::LoadFromMemory( Uint8* TTFData, const eeUint& TTFDataSize, const mFont = hkFontManager::instance()->OpenFromMemory( reinterpret_cast(&TTFData[0]), TTFDataSize, Size, 0, NumCharsToGen ); - if ( OutlineSize && OutlineFreetype == DefaultOutlineMethod ) { + if ( OutlineSize && OutlineFreetype == OutlineMethod ) { mFontOutline = hkFontManager::instance()->OpenFromMemory( reinterpret_cast(&TTFData[0]), TTFDataSize, Size, 0, NumCharsToGen ); mFontOutline->Outline( OutlineSize ); } @@ -63,7 +63,7 @@ bool cTTFFont::Load( const std::string& Filepath, const eeUint& Size, EE_TTF_FON mFont = hkFontManager::instance()->OpenFromFile( Filepath.c_str(), Size, 0, NumCharsToGen ); - if ( OutlineSize && OutlineFreetype == DefaultOutlineMethod ) { + if ( OutlineSize && OutlineFreetype == OutlineMethod ) { mFontOutline = hkFontManager::instance()->OpenFromFile( Filepath.c_str(), Size, 0, NumCharsToGen ); mFontOutline->Outline( OutlineSize ); } @@ -94,8 +94,8 @@ bool cTTFFont::iLoad( const eeUint& Size, EE_TTF_FONT_STYLE Style, const Uint16& PixelSep = 1; Uint32 TexSize; - Uint32 OutSize = ( OutlineFreetype == DefaultOutlineMethod ) ? 0 : OutlineSize; - Uint32 OutTotal = ( OutlineFreetype == DefaultOutlineMethod ) ? 0 : OutlineSize * 2; + Uint32 OutSize = ( OutlineFreetype == OutlineMethod ) ? 0 : OutlineSize; + Uint32 OutTotal = ( OutlineFreetype == OutlineMethod ) ? 0 : OutlineSize * 2; if ( mFont == NULL ) { cLog::instance()->Write( "Failed to load TTF Font " + mFilepath + "." ); @@ -174,7 +174,7 @@ bool cTTFFont::iLoad( const eeUint& Size, EE_TTF_FONT_STYLE Style, const Uint16& GlyphRect.y = mFont->Current()->Pixmap()->rows; // Create the outline for the glyph and copy the outline to the texture - if ( OutlineSize && OutlineFreetype == DefaultOutlineMethod ) { + if ( OutlineSize && OutlineFreetype == OutlineMethod ) { TempOutGlyphSurface = mFontOutline->GlyphRender( i, eeColorA( OutlineColor ).GetValue() ); mFontOutline->GlyphMetrics( i, &TempGlyph.MinX, &TempGlyph.MaxX, &TempGlyph.MinY, &TempGlyph.MaxY, &TempGlyph.Advance ); @@ -244,7 +244,7 @@ bool cTTFFont::iLoad( const eeUint& Size, EE_TTF_FONT_STYLE Style, const Uint16& } // Create the outline for the glyph and copy the outline to the texture - if ( OutlineSize && OutlineEntropia == DefaultOutlineMethod ) { + if ( OutlineSize && OutlineEntropia == OutlineMethod ) { eeRecti nGlyphR( TempGlyph.CurX, TempGlyph.CurY, diff --git a/src/examples/fonts/fonts.cpp b/src/examples/fonts/fonts.cpp index cac244e1c..bf4d5d14e 100644 --- a/src/examples/fonts/fonts.cpp +++ b/src/examples/fonts/fonts.cpp @@ -24,7 +24,7 @@ EE_MAIN_FUNC int main (int argc, char * argv []) TTF->Load( AppPath + "assets/fonts/DejaVuSansMono.ttf", 18, TTF_STYLE_NORMAL, 128, eeColor(255,255,255), 3, eeColor(0,0,0), true ); // Change the default method to use for outlining the font glyphs - cTTFFont::DefaultOutlineMethod = cTTFFont::OutlineFreetype; + cTTFFont::OutlineMethod = cTTFFont::OutlineFreetype; // Create the exact same font than before but using the new outlining method TTFO->Load( AppPath + "assets/fonts/DejaVuSansMono.ttf", 18, TTF_STYLE_NORMAL, 128, eeColor(255,255,255), 3, eeColor(0,0,0), true );