Rewrote parts of the font loading code and bundled the required fonts with ES instead of relying on the OS providing them. This fixes the display of star symbols for favorites in the gamelists

This commit is contained in:
Leon Styhre 2020-05-15 18:03:42 +02:00
parent f5d3c8ac0b
commit 5f5d12535d
7 changed files with 13 additions and 17 deletions

View file

@ -66,9 +66,7 @@ void BasicGameListView::populateList(const std::vector<FileData*>& files)
continue;
if (showFavoriteIcon)
// mList.add(("\uF006 ") + file->getName(), file, file->getType() == FOLDER);
// Quick fix for now until I've fixed the issue with Unicode rendering (Leon)
mList.add("** " + file->getName(), file, file->getType() == FOLDER);
mList.add(("\uF005 ") + file->getName(), file, file->getType() == FOLDER);
else if (file->getType() == FOLDER)
mList.add(("\uF07C ") + file->getName(), file, true);
else
@ -85,9 +83,7 @@ void BasicGameListView::populateList(const std::vector<FileData*>& files)
if (showFavoriteIcon)
{
// mList.add(("\uF006 ") + file->getName(), file, file->getType() == FOLDER);
// Quick fix for now until I've fixed the issue with Unicode rendering (Leon)
mList.add(("** ") + file->getName(), file, file->getType() == FOLDER);
mList.add(("\uF005 ") + file->getName(), file, file->getType() == FOLDER);
continue;
}
}

View file

@ -248,18 +248,18 @@ std::vector<std::string> getFallbackFontPaths()
#else
// Linux
const char* paths[] = {
"/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf",
"/usr/share/fonts/truetype/freefont/FreeMono.ttf",
"/usr/share/fonts/truetype/droid/DroidSansFallbackFull.ttf" // japanese, chinese, present on Debian
};
std::vector<std::string> fontPaths;
for(unsigned int i = 0; i < sizeof(paths) / sizeof(paths[0]); i++)
{
if(ResourceManager::getInstance()->fileExists(paths[i]))
fontPaths.push_back(paths[i]);
}
// Vera sans Unicode:
fontPaths.push_back(ResourceManager::getInstance()->getResourcePath(":/DejaVuSans.ttf"));
// Freefont monospaced:
fontPaths.push_back(ResourceManager::getInstance()->getResourcePath(":/FreeMono.ttf"));
// Various languages, such as Japanese and Chinese:
fontPaths.push_back(ResourceManager::getInstance()->getResourcePath(":/DroidSansFallbackFull.ttf"));
// Korean:
fontPaths.push_back(ResourceManager::getInstance()->getResourcePath(":/NanumMyeongjo.ttf"));
// Font Awesome icon glyphs, used for star-flagging favorites in the gamelists:
fontPaths.push_back(ResourceManager::getInstance()->getResourcePath(":/fontawesome-webfont.ttf"));
fontPaths.shrink_to_fit();
return fontPaths;

BIN
resources/DejaVuSans.ttf Normal file

Binary file not shown.

Binary file not shown.

BIN
resources/FreeMono.ttf Normal file

Binary file not shown.

BIN
resources/NanumMyeongjo.ttf Normal file

Binary file not shown.

Binary file not shown.