diff --git a/src/driver/neutrinofonts.cpp b/src/driver/neutrinofonts.cpp index e7639d2dd..2e582cc78 100644 --- a/src/driver/neutrinofonts.cpp +++ b/src/driver/neutrinofonts.cpp @@ -48,6 +48,19 @@ extern font_sizes_groups_struct font_sizes_groups[]; extern font_sizes_struct neutrino_font[]; extern const char * locale_real_names[]; /* #include */ +font_sizes_struct fixed_font[SNeutrinoSettings::FONT_TYPE_FIXED_COUNT] = +{ + {NONEXISTANT_LOCALE, 30, CNeutrinoFonts::FONT_STYLE_BOLD, 1}, + {NONEXISTANT_LOCALE, 30, CNeutrinoFonts::FONT_STYLE_REGULAR, 1}, + {NONEXISTANT_LOCALE, 30, CNeutrinoFonts::FONT_STYLE_ITALIC, 1}, + {NONEXISTANT_LOCALE, 20, CNeutrinoFonts::FONT_STYLE_BOLD, 1}, + {NONEXISTANT_LOCALE, 20, CNeutrinoFonts::FONT_STYLE_REGULAR, 1}, + {NONEXISTANT_LOCALE, 20, CNeutrinoFonts::FONT_STYLE_ITALIC, 1}, + {NONEXISTANT_LOCALE, 16, CNeutrinoFonts::FONT_STYLE_BOLD, 1}, + {NONEXISTANT_LOCALE, 16, CNeutrinoFonts::FONT_STYLE_REGULAR, 1}, + {NONEXISTANT_LOCALE, 16, CNeutrinoFonts::FONT_STYLE_ITALIC, 1}, +}; + const font_sizes_struct signal_font = {NONEXISTANT_LOCALE, 14, CNeutrinoFonts::FONT_STYLE_REGULAR, 1}; const font_sizes_struct shell_font = {NONEXISTANT_LOCALE, 18, CNeutrinoFonts::FONT_STYLE_REGULAR, 1}; @@ -64,6 +77,8 @@ CNeutrinoFonts::CNeutrinoFonts() for (int i = 0; i < SNeutrinoSettings::FONT_TYPE_COUNT; i++) g_Font[i] = NULL; + for (int i = 0; i < SNeutrinoSettings::FONT_TYPE_FIXED_COUNT; i++) + g_FixedFont[i] = NULL; g_SignalFont = NULL; g_ShellFont = NULL; @@ -180,15 +195,32 @@ void CNeutrinoFonts::SetupNeutrinoFonts(bool initRenderClass/*=true*/) g_fontRenderer->AddFont(fontDescr.filename.c_str(), true); // make italics fontStyle[2] = "Italic"; + + if (g_fixedFontRenderer != NULL) + delete g_fixedFontRenderer; + g_fixedFontRenderer = new FBFontRenderClass(); + + g_fixedFontRenderer->AddFont(fontDescr.filename.c_str()); + g_fixedFontRenderer->AddFont(fontDescr.filename.c_str(), true); // make italics } int fontSize; - for (int i = 0; i < SNeutrinoSettings::FONT_TYPE_COUNT; i++) { - if (g_Font[i]) delete g_Font[i]; + for (int i = 0; i < SNeutrinoSettings::FONT_TYPE_COUNT; i++) + { + if (g_Font[i]) + delete g_Font[i]; fontSize = CFrameBuffer::getInstance()->scale2Res(CNeutrinoApp::getInstance()->getConfigFile()->getInt32(locale_real_names[neutrino_font[i].name], neutrino_font[i].defaultsize)) + neutrino_font[i].size_offset * fontDescr.size_offset; g_Font[i] = g_fontRenderer->getFont(fontDescr.name.c_str(), fontStyle[neutrino_font[i].style].c_str(), fontSize); } - if (g_SignalFont) delete g_SignalFont; + for (int i = 0; i < SNeutrinoSettings::FONT_TYPE_FIXED_COUNT; i++) + { + if (g_FixedFont[i]) + delete g_FixedFont[i]; + fontSize = CFrameBuffer::getInstance()->scale2Res(fixed_font[i].defaultsize) + fixed_font[i].size_offset * fontDescr.size_offset; + g_FixedFont[i] = g_fixedFontRenderer->getFont(fontDescr.name.c_str(), fontStyle[fixed_font[i].style].c_str(), fontSize); + } + if (g_SignalFont) + delete g_SignalFont; fontSize = CFrameBuffer::getInstance()->scale2Res(signal_font.defaultsize) + signal_font.size_offset * fontDescr.size_offset; g_SignalFont = g_fontRenderer->getFont(fontDescr.name.c_str(), fontStyle[signal_font.style].c_str(), fontSize); } diff --git a/src/global.h b/src/global.h index f2af65cce..2f110c279 100644 --- a/src/global.h +++ b/src/global.h @@ -69,11 +69,13 @@ NEUTRINO_CPP CTimerdClient *g_Timerd; class FBFontRenderClass; NEUTRINO_CPP FBFontRenderClass *g_fontRenderer; +NEUTRINO_CPP FBFontRenderClass *g_fixedFontRenderer; NEUTRINO_CPP FBFontRenderClass *g_dynFontRenderer; NEUTRINO_CPP FBFontRenderClass *g_shellFontRenderer; class Font; NEUTRINO_CPP Font * g_Font[SNeutrinoSettings::FONT_TYPE_COUNT]; +NEUTRINO_CPP Font * g_FixedFont[SNeutrinoSettings::FONT_TYPE_FIXED_COUNT]; NEUTRINO_CPP Font * g_SignalFont; NEUTRINO_CPP Font * g_ShellFont; diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 73387c141..61800daef 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -4703,6 +4703,7 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey) delete g_Sectionsd; delete g_RemoteControl; delete g_fontRenderer; + delete g_fixedFontRenderer; delete g_dynFontRenderer; delete g_shellFontRenderer; @@ -5250,6 +5251,7 @@ void CNeutrinoApp::Cleanup() printf("cleanup 11\n");fflush(stdout); delete g_fontRenderer; g_fontRenderer = NULL; + delete g_fixedFontRenderer; g_fixedFontRenderer = NULL; delete g_dynFontRenderer; g_dynFontRenderer = NULL; delete g_shellFontRenderer; g_shellFontRenderer = NULL; printf("cleanup 12\n");fflush(stdout); @@ -5291,20 +5293,25 @@ void CNeutrinoApp::Cleanup() delete RADIOsatList; RADIOsatList = NULL; printf("cleanup 1\n");fflush(stdout); - for (int i = 0; i < SNeutrinoSettings::FONT_TYPE_COUNT; i++) { + for (int i = 0; i < SNeutrinoSettings::FONT_TYPE_COUNT; i++) + { delete g_Font[i]; g_Font[i] = NULL; } + for (int i = 0; i < SNeutrinoSettings::FONT_TYPE_FIXED_COUNT; i++) + { + delete g_FixedFont[i]; + g_FixedFont[i] = NULL; + } + delete g_SignalFont; g_SignalFont = NULL; + delete g_ShellFont; g_ShellFont = NULL; + printf("cleanup 2\n");fflush(stdout); for(unsigned int i=0; i