mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-01 01:41:23 +02:00
- yaft: allow new shell.ttf in yaft-widget too
Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
@@ -193,6 +193,17 @@ void CNeutrinoFonts::SetupNeutrinoFonts(bool initRenderClass/*=true*/)
|
||||
g_SignalFont = g_fontRenderer->getFont(fontDescr.name.c_str(), fontStyle[signal_font.style].c_str(), fontSize);
|
||||
}
|
||||
|
||||
std::string CNeutrinoFonts::getShellTTF()
|
||||
{
|
||||
const char *shell_ttf[2] = { FONTDIR_VAR "/shell.ttf", FONTDIR "/shell.ttf" };
|
||||
for (unsigned int i = 0; i < 2; i++)
|
||||
{
|
||||
if (access(shell_ttf[i], F_OK) == 0)
|
||||
return (std::string)shell_ttf[i];
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
void CNeutrinoFonts::SetupShellFont()
|
||||
{
|
||||
if (g_ShellFont)
|
||||
@@ -201,10 +212,8 @@ void CNeutrinoFonts::SetupShellFont()
|
||||
g_ShellFont = NULL;
|
||||
}
|
||||
|
||||
std::string shell_ttf = FONTDIR_VAR "/shell.ttf";
|
||||
if (access(shell_ttf.c_str(), F_OK) != 0)
|
||||
shell_ttf = FONTDIR "/shell.ttf";
|
||||
if (access(shell_ttf.c_str(), F_OK) != 0)
|
||||
std::string shell_ttf = getShellTTF();
|
||||
if (shell_ttf.empty())
|
||||
return;
|
||||
|
||||
if (g_shellFontRenderer != NULL)
|
||||
|
@@ -131,6 +131,7 @@ class CNeutrinoFonts
|
||||
void SetupNeutrinoFonts(bool initRenderClass = true);
|
||||
void SetupDynamicFonts(bool initRenderClass = true);
|
||||
void SetupShellFont();
|
||||
std::string getShellTTF();
|
||||
void refreshDynFonts();
|
||||
Font **getDynFont(int &dx, int &dy, std::string text="", int style=FONT_STYLE_REGULAR, int share=FONT_ID_SHARE);
|
||||
void setFontUseDigitHeight(bool set=true) {useDigitOffset = set;}
|
||||
|
Reference in New Issue
Block a user