[DEBUG] try a better bug management of no font
This commit is contained in:
parent
0b0cbfc30d
commit
0275a524b2
@ -37,7 +37,8 @@ std::ostream& ewol::operator <<(std::ostream& _os, enum ewol::font::mode _obj) {
|
|||||||
return _os;
|
return _os;
|
||||||
}
|
}
|
||||||
|
|
||||||
ewol::resource::TexturedFont::TexturedFont() {
|
ewol::resource::TexturedFont::TexturedFont():
|
||||||
|
m_size(10) {
|
||||||
addResourceType("ewol::resource::TexturedFont");
|
addResourceType("ewol::resource::TexturedFont");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,12 +74,12 @@ void ewol::resource::TexturedFont::init(const std::string& _fontName) {
|
|||||||
|
|
||||||
if (tmpPos == nullptr) {
|
if (tmpPos == nullptr) {
|
||||||
m_size = 1;
|
m_size = 1;
|
||||||
EWOL_CRITICAL("Can not parse the font name : \"" << _fontName << "\" ??? ':' " );
|
EWOL_CRITICAL("Can not parse the font name : '" << _fontName << "' ??? ':' " );
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
if (sscanf(tmpPos+1, "%d", &tmpSize)!=1) {
|
if (sscanf(tmpPos+1, "%d", &tmpSize)!=1) {
|
||||||
m_size = 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;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -90,7 +91,7 @@ void ewol::resource::TexturedFont::init(const std::string& _fontName) {
|
|||||||
m_size = tmpSize;
|
m_size = tmpSize;
|
||||||
|
|
||||||
std::vector<std::string> folderList;
|
std::vector<std::string> folderList;
|
||||||
if (true == ewol::getContext().getFontDefault().getUseExternal()) {
|
if (ewol::getContext().getFontDefault().getUseExternal() == true) {
|
||||||
#if defined(__TARGET_OS__Android)
|
#if defined(__TARGET_OS__Android)
|
||||||
folderList.push_back("ROOT:system/fonts");
|
folderList.push_back("ROOT:system/fonts");
|
||||||
#elif defined(__TARGET_OS__Linux)
|
#elif defined(__TARGET_OS__Linux)
|
||||||
@ -115,42 +116,42 @@ void ewol::resource::TexturedFont::init(const std::string& _fontName) {
|
|||||||
EWOL_INFO(" try with : '" << split[jjj] << "'");
|
EWOL_INFO(" try with : '" << split[jjj] << "'");
|
||||||
for (size_t iii=0; iii<output.size(); iii++) {
|
for (size_t iii=0; iii<output.size(); iii++) {
|
||||||
//EWOL_DEBUG(" file : " << output[iii]);
|
//EWOL_DEBUG(" file : " << output[iii]);
|
||||||
if( true == etk::end_with(output[iii], split[jjj]+"-"+"bold"+".ttf", false)
|
if( etk::end_with(output[iii], split[jjj]+"-"+"bold"+".ttf", false) == true
|
||||||
|| true == etk::end_with(output[iii], split[jjj]+"-"+"b"+".ttf", false)
|
|| etk::end_with(output[iii], split[jjj]+"-"+"b"+".ttf", false) == true
|
||||||
|| true == etk::end_with(output[iii], split[jjj]+"-"+"bd"+".ttf", false)
|
|| etk::end_with(output[iii], split[jjj]+"-"+"bd"+".ttf", false) == true
|
||||||
|| true == etk::end_with(output[iii], split[jjj]+"bold"+".ttf", false)
|
|| etk::end_with(output[iii], split[jjj]+"bold"+".ttf", false) == true
|
||||||
|| true == etk::end_with(output[iii], split[jjj]+"bd"+".ttf", false)
|
|| etk::end_with(output[iii], split[jjj]+"bd"+".ttf", false) == true
|
||||||
|| true == etk::end_with(output[iii], split[jjj]+"b"+".ttf", false)) {
|
|| etk::end_with(output[iii], split[jjj]+"b"+".ttf", false) == true) {
|
||||||
EWOL_INFO(" find Font [Bold] : " << output[iii]);
|
EWOL_INFO(" find Font [Bold] : " << output[iii]);
|
||||||
m_fileName[ewol::font::Bold] = output[iii];
|
m_fileName[ewol::font::Bold] = output[iii];
|
||||||
hasFindAFont = true;
|
hasFindAFont = true;
|
||||||
} else if( true == etk::end_with(output[iii], split[jjj]+"-"+"oblique"+".ttf", false)
|
} else if( etk::end_with(output[iii], split[jjj]+"-"+"oblique"+".ttf", false) == true
|
||||||
|| true == etk::end_with(output[iii], split[jjj]+"-"+"italic"+".ttf", false)
|
|| etk::end_with(output[iii], split[jjj]+"-"+"italic"+".ttf", false) == true
|
||||||
|| true == etk::end_with(output[iii], split[jjj]+"-"+"Light"+".ttf", false)
|
|| etk::end_with(output[iii], split[jjj]+"-"+"Light"+".ttf", false) == true
|
||||||
|| true == etk::end_with(output[iii], split[jjj]+"-"+"i"+".ttf", false)
|
|| etk::end_with(output[iii], split[jjj]+"-"+"i"+".ttf", false) == true
|
||||||
|| true == etk::end_with(output[iii], split[jjj]+"oblique"+".ttf", false)
|
|| etk::end_with(output[iii], split[jjj]+"oblique"+".ttf", false) == true
|
||||||
|| true == etk::end_with(output[iii], split[jjj]+"italic"+".ttf", false)
|
|| etk::end_with(output[iii], split[jjj]+"italic"+".ttf", false) == true
|
||||||
|| true == etk::end_with(output[iii], split[jjj]+"light"+".ttf", false)
|
|| etk::end_with(output[iii], split[jjj]+"light"+".ttf", false) == true
|
||||||
|| true == etk::end_with(output[iii], split[jjj]+"i"+".ttf", false)) {
|
|| etk::end_with(output[iii], split[jjj]+"i"+".ttf", false) == true) {
|
||||||
EWOL_INFO(" find Font [Italic] : " << output[iii]);
|
EWOL_INFO(" find Font [Italic] : " << output[iii]);
|
||||||
m_fileName[ewol::font::Italic] = output[iii];
|
m_fileName[ewol::font::Italic] = output[iii];
|
||||||
hasFindAFont = true;
|
hasFindAFont = true;
|
||||||
} else if( true == etk::end_with(output[iii], split[jjj]+"-"+"bolditalic"+".ttf", false)
|
} else if( etk::end_with(output[iii], split[jjj]+"-"+"bolditalic"+".ttf", false) == true
|
||||||
|| true == etk::end_with(output[iii], split[jjj]+"-"+"boldoblique"+".ttf", false)
|
|| etk::end_with(output[iii], split[jjj]+"-"+"boldoblique"+".ttf", false) == true
|
||||||
|| true == etk::end_with(output[iii], split[jjj]+"-"+"bi"+".ttf", false)
|
|| etk::end_with(output[iii], split[jjj]+"-"+"bi"+".ttf", false) == true
|
||||||
|| true == etk::end_with(output[iii], split[jjj]+"-"+"z"+".ttf", false)
|
|| etk::end_with(output[iii], split[jjj]+"-"+"z"+".ttf", false) == true
|
||||||
|| true == etk::end_with(output[iii], split[jjj]+"bolditalic"+".ttf", false)
|
|| etk::end_with(output[iii], split[jjj]+"bolditalic"+".ttf", false) == true
|
||||||
|| true == etk::end_with(output[iii], split[jjj]+"boldoblique"+".ttf", false)
|
|| etk::end_with(output[iii], split[jjj]+"boldoblique"+".ttf", false) == true
|
||||||
|| true == etk::end_with(output[iii], split[jjj]+"bi"+".ttf", false)
|
|| etk::end_with(output[iii], split[jjj]+"bi"+".ttf", false) == true
|
||||||
|| true == etk::end_with(output[iii], split[jjj]+"z"+".ttf", false)) {
|
|| etk::end_with(output[iii], split[jjj]+"z"+".ttf", false) == true) {
|
||||||
EWOL_INFO(" find Font [Bold-Italic] : " << output[iii]);
|
EWOL_INFO(" find Font [Bold-Italic] : " << output[iii]);
|
||||||
m_fileName[ewol::font::BoldItalic] = output[iii];
|
m_fileName[ewol::font::BoldItalic] = output[iii];
|
||||||
hasFindAFont = true;
|
hasFindAFont = true;
|
||||||
} else if( true == etk::end_with(output[iii], split[jjj]+"-"+"regular"+".ttf", false)
|
} else if( etk::end_with(output[iii], split[jjj]+"-"+"regular"+".ttf", false) == true
|
||||||
|| true == etk::end_with(output[iii], split[jjj]+"-"+"r"+".ttf", false)
|
|| etk::end_with(output[iii], split[jjj]+"-"+"r"+".ttf", false) == true
|
||||||
|| true == etk::end_with(output[iii], split[jjj]+"regular"+".ttf", false)
|
|| etk::end_with(output[iii], split[jjj]+"regular"+".ttf", false) == true
|
||||||
|| true == etk::end_with(output[iii], split[jjj]+"r"+".ttf", false)
|
|| etk::end_with(output[iii], split[jjj]+"r"+".ttf", false) == true
|
||||||
|| true == etk::end_with(output[iii], split[jjj]+".ttf", false)) {
|
|| etk::end_with(output[iii], split[jjj]+".ttf", false) == true) {
|
||||||
EWOL_INFO(" find Font [Regular] : " << output[iii]);
|
EWOL_INFO(" find Font [Regular] : " << output[iii]);
|
||||||
m_fileName[ewol::font::Regular] = output[iii];
|
m_fileName[ewol::font::Regular] = output[iii];
|
||||||
hasFindAFont = true;
|
hasFindAFont = true;
|
||||||
@ -338,7 +339,7 @@ ewol::GlyphProperty* ewol::resource::TexturedFont::getGlyphPointer(const char32_
|
|||||||
if (m_listElement[_displayMode].size() > 0) {
|
if (m_listElement[_displayMode].size() > 0) {
|
||||||
return &((m_listElement[_displayMode])[0]);
|
return &((m_listElement[_displayMode])[0]);
|
||||||
}
|
}
|
||||||
return nullptr;
|
return &m_emptyGlyph;
|
||||||
}
|
}
|
||||||
//EWOL_ERROR(" index=" << index);
|
//EWOL_ERROR(" index=" << index);
|
||||||
//EWOL_ERROR(" m_UVal=" << m_listElement[_displayMode][index].m_UVal);
|
//EWOL_ERROR(" m_UVal=" << m_listElement[_displayMode][index].m_UVal);
|
||||||
|
@ -34,6 +34,7 @@ namespace ewol {
|
|||||||
ememory::SharedPtr<ewol::resource::FontBase> m_font[4];
|
ememory::SharedPtr<ewol::resource::FontBase> 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
|
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:
|
public:
|
||||||
|
GlyphProperty m_emptyGlyph;
|
||||||
std::vector<GlyphProperty> m_listElement[4];
|
std::vector<GlyphProperty> m_listElement[4];
|
||||||
private:
|
private:
|
||||||
// for the texture generation :
|
// for the texture generation :
|
||||||
|
@ -64,9 +64,9 @@ namespace ewol {
|
|||||||
m_UVal(0),
|
m_UVal(0),
|
||||||
m_exist(true),
|
m_exist(true),
|
||||||
m_glyphIndex(0),
|
m_glyphIndex(0),
|
||||||
m_sizeTexture(0,0),
|
m_sizeTexture(10,10),
|
||||||
m_bearing(0,0),
|
m_bearing(2,2),
|
||||||
m_advance(0,0),
|
m_advance(10,10),
|
||||||
m_texturePosStart(0,0),
|
m_texturePosStart(0,0),
|
||||||
m_texturePosSize(0,0) {
|
m_texturePosSize(0,0) {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user