diff --git a/ewol/resource/TexturedFont.cpp b/ewol/resource/TexturedFont.cpp index d02559d3..68223e1f 100644 --- a/ewol/resource/TexturedFont.cpp +++ b/ewol/resource/TexturedFont.cpp @@ -37,7 +37,8 @@ std::ostream& ewol::operator <<(std::ostream& _os, enum ewol::font::mode _obj) { return _os; } -ewol::resource::TexturedFont::TexturedFont() { +ewol::resource::TexturedFont::TexturedFont(): + m_size(10) { addResourceType("ewol::resource::TexturedFont"); } @@ -73,12 +74,12 @@ void ewol::resource::TexturedFont::init(const std::string& _fontName) { if (tmpPos == nullptr) { m_size = 1; - EWOL_CRITICAL("Can not parse the font name : \"" << _fontName << "\" ??? ':' " ); + EWOL_CRITICAL("Can not parse the font name : '" << _fontName << "' ??? ':' " ); return; } else { if (sscanf(tmpPos+1, "%d", &tmpSize)!=1) { m_size = 1; - EWOL_CRITICAL("Can not parse the font name : \"" << _fontName << "\" == > size ???"); + EWOL_CRITICAL("Can not parse the font name : '" << _fontName << "' == > size ???"); return; } } @@ -90,7 +91,7 @@ void ewol::resource::TexturedFont::init(const std::string& _fontName) { m_size = tmpSize; std::vector folderList; - if (true == ewol::getContext().getFontDefault().getUseExternal()) { + if (ewol::getContext().getFontDefault().getUseExternal() == true) { #if defined(__TARGET_OS__Android) folderList.push_back("ROOT:system/fonts"); #elif defined(__TARGET_OS__Linux) @@ -115,45 +116,45 @@ void ewol::resource::TexturedFont::init(const std::string& _fontName) { EWOL_INFO(" try with : '" << split[jjj] << "'"); for (size_t iii=0; iii 0) { return &((m_listElement[_displayMode])[0]); } - return nullptr; + return &m_emptyGlyph; } //EWOL_ERROR(" index=" << index); //EWOL_ERROR(" m_UVal=" << m_listElement[_displayMode][index].m_UVal); diff --git a/ewol/resource/TexturedFont.hpp b/ewol/resource/TexturedFont.hpp index f335a9a9..d9df7901 100644 --- a/ewol/resource/TexturedFont.hpp +++ b/ewol/resource/TexturedFont.hpp @@ -34,6 +34,7 @@ namespace ewol { ememory::SharedPtr m_font[4]; enum ewol::font::mode m_modeWraping[4]; //!< This is a wrapping mode to prevent the fact that no font is define for a specific mode public: + GlyphProperty m_emptyGlyph; std::vector m_listElement[4]; private: // for the texture generation : diff --git a/ewol/resource/font/GlyphProperty.hpp b/ewol/resource/font/GlyphProperty.hpp index 7b2a91e9..5ca68853 100644 --- a/ewol/resource/font/GlyphProperty.hpp +++ b/ewol/resource/font/GlyphProperty.hpp @@ -64,9 +64,9 @@ namespace ewol { m_UVal(0), m_exist(true), m_glyphIndex(0), - m_sizeTexture(0,0), - m_bearing(0,0), - m_advance(0,0), + m_sizeTexture(10,10), + m_bearing(2,2), + m_advance(10,10), m_texturePosStart(0,0), m_texturePosSize(0,0) {