mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-29 19:55:37 +00:00
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:
parent
f5d3c8ac0b
commit
5f5d12535d
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
BIN
resources/DejaVuSans.ttf
Normal file
Binary file not shown.
BIN
resources/DroidSansFallbackFull.ttf
Normal file
BIN
resources/DroidSansFallbackFull.ttf
Normal file
Binary file not shown.
BIN
resources/FreeMono.ttf
Normal file
BIN
resources/FreeMono.ttf
Normal file
Binary file not shown.
BIN
resources/NanumMyeongjo.ttf
Normal file
BIN
resources/NanumMyeongjo.ttf
Normal file
Binary file not shown.
BIN
resources/fontawesome-webfont.ttf
Normal file
BIN
resources/fontawesome-webfont.ttf
Normal file
Binary file not shown.
Loading…
Reference in a new issue