[android] Fix font name paths.

This commit is contained in:
vng 2012-06-10 16:14:06 -07:00 committed by Alex Zolotarev
parent 832dc02fd0
commit 52b9c4ff9d
2 changed files with 17 additions and 4 deletions

View file

@ -108,9 +108,18 @@ string Platform::DeviceName() const
void Platform::GetFontNames(FilesList & res) const
{
LOG(LDEBUG, ("searching for fonts in:", WritableDir()));
GetFilesInDir(WritableDir(), "*.ttf", res);
string arr[] = { WritableDir(), ResourcesDir() };
for (size_t i = 0; i < ARRAY_SIZE(arr); ++i)
{
LOG(LDEBUG, ("Searching for fonts in", arr[i]));
GetFilesInDir(arr[i], "*.ttf", res);
}
sort(res.begin(), res.end());
res.erase(unique(res.begin(), res.end()), res.end());
LOG(LDEBUG, ("Font files:", (res)));
}
int Platform::ScaleEtalonSize() const

View file

@ -200,7 +200,8 @@ namespace yg
for (size_t i = 0; i < fontNames.size(); ++i)
addFont(fontNames[i].c_str());
/* LOG(LINFO, ("----------------------------"));
/*
LOG(LINFO, ("----------------------------"));
LOG(LINFO, ("-- Coverage Info -----------"));
LOG(LINFO, ("----------------------------"));
@ -232,13 +233,14 @@ namespace yg
for (unicode_blocks_t::const_iterator it = m_unicodeBlocks.begin(); it != m_unicodeBlocks.end(); ++it)
if (it->m_fonts.empty())
LOG(LINFO, (it->m_name, " unicode block of ", it->m_end + 1 - it->m_start, " symbols is empty"));
*/
*/
}
void GlyphCacheImpl::addFont(char const * fileName)
{
if (m_isDebugging)
return;
ReaderPtr<Reader> reader = GetPlatform().GetReader(fileName);
m_fonts.push_back(make_shared_ptr(new Font(reader)));
@ -384,6 +386,8 @@ namespace yg
if (it->m_fonts.empty())
{
LOG(LDEBUG, ("querying symbol for empty ", it->m_name, " unicode block"));
ASSERT(!m_fonts.empty(), ("Empty fonts container"));
it->m_fonts.push_back(m_fonts.front());
}