diff --git a/src/driver/neutrinofonts.cpp b/src/driver/neutrinofonts.cpp index 80b40377e..6bbe1e912 100644 --- a/src/driver/neutrinofonts.cpp +++ b/src/driver/neutrinofonts.cpp @@ -176,12 +176,23 @@ void CNeutrinoFonts::SetupNeutrinoFonts(bool initRenderClass/*=true*/) fontStyle[2] = "Italic"; } + int fontSize; for (int i = 0; i < SNeutrinoSettings::FONT_TYPE_COUNT; i++) { if (g_Font[i]) delete g_Font[i]; - g_Font[i] = g_fontRenderer->getFont(fontDescr.name.c_str(), fontStyle[neutrino_font[i].style].c_str(), CNeutrinoApp::getInstance()->getConfigFile()->getInt32(locale_real_names[neutrino_font[i].name], neutrino_font[i].defaultsize) + neutrino_font[i].size_offset * fontDescr.size_offset); +#ifdef ENABLE_CHANGE_OSD_RESOLUTION + fontSize = CFrameBuffer::getInstance()->scaleFont(CNeutrinoApp::getInstance()->getConfigFile()->getInt32(locale_real_names[neutrino_font[i].name], neutrino_font[i].defaultsize)) + neutrino_font[i].size_offset * fontDescr.size_offset; +#else + fontSize = CNeutrinoApp::getInstance()->getConfigFile()->getInt32(locale_real_names[neutrino_font[i].name], neutrino_font[i].defaultsize) + neutrino_font[i].size_offset * fontDescr.size_offset; +#endif + g_Font[i] = g_fontRenderer->getFont(fontDescr.name.c_str(), fontStyle[neutrino_font[i].style].c_str(), fontSize); } if (g_SignalFont) delete g_SignalFont; - g_SignalFont = g_fontRenderer->getFont(fontDescr.name.c_str(), fontStyle[signal_font.style].c_str(), signal_font.defaultsize + signal_font.size_offset * fontDescr.size_offset); +#ifdef ENABLE_CHANGE_OSD_RESOLUTION + fontSize = CFrameBuffer::getInstance()->scaleFont(signal_font.defaultsize) + signal_font.size_offset * fontDescr.size_offset; +#else + fontSize = signal_font.defaultsize + signal_font.size_offset * fontDescr.size_offset; +#endif + g_SignalFont = g_fontRenderer->getFont(fontDescr.name.c_str(), fontStyle[signal_font.style].c_str(), fontSize); } void CNeutrinoFonts::refreshDynFonts() @@ -242,7 +253,7 @@ int CNeutrinoFonts::getFontHeight(Font* fnt) int CNeutrinoFonts::getDynFontSize(int dx, int dy, std::string text, int style) { int dynSize = dy/1.6; - if (dx == 0) dx = 1280; + if (dx == 0) dx = CFrameBuffer::getInstance()->getScreenWidth(true); if (!vDynSize.empty()) { for (size_t i = 0; i < vDynSize.size(); i++) { diff --git a/src/gui/infoclock.cpp b/src/gui/infoclock.cpp index 54b485b09..a5c75b7fc 100644 --- a/src/gui/infoclock.cpp +++ b/src/gui/infoclock.cpp @@ -76,6 +76,9 @@ void CInfoClock::initCCLockItems() //set height, NOTE: height is strictly bound to settings height = g_settings.infoClockFontSize; +#ifdef ENABLE_CHANGE_OSD_RESOLUTION + height = CFrameBuffer::getInstance()->scaleFont(height); +#endif initClockFont(0, height); // set corner radius depending on clock height diff --git a/src/gui/volumebar.cpp b/src/gui/volumebar.cpp index 9f9921ad6..6ba244f27 100644 --- a/src/gui/volumebar.cpp +++ b/src/gui/volumebar.cpp @@ -54,6 +54,9 @@ void CVolumeBar::initVarVolumeBar() corner_rad = CORNER_RADIUS_MID; vb_item_offset = OFFSET_INNER_SMALL; height = g_settings.volume_size; //default height +#ifdef ENABLE_CHANGE_OSD_RESOLUTION + height = CFrameBuffer::getInstance()->scaleFont(height); +#endif //assume volume value as pointer to global setting vb_vol = &g_settings.current_volume; @@ -92,6 +95,9 @@ void CVolumeBar::initVolumeBarSize() //scale vb_pbw = 200; +#ifdef ENABLE_CHANGE_OSD_RESOLUTION + vb_pbw = CFrameBuffer::getInstance()->scaleFont(vb_pbw); +#endif vb_pbh = height-4*vb_item_offset; //result for width @@ -363,6 +369,9 @@ void CVolumeHelper::initVolBarSize() icon_width += 8; g_settings.volume_size = max(g_settings.volume_size, icon_height); vol_height = g_settings.volume_size; +#ifdef ENABLE_CHANGE_OSD_RESOLUTION + vol_height = CFrameBuffer::getInstance()->scaleFont(vol_height); +#endif if (g_settings.volume_digits) { CNeutrinoFonts *cnf = CNeutrinoFonts::getInstance();