From 7b9520a8cc0bda8e28012d72f532db486cf45a21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Jensen?= Date: Wed, 5 Dec 2018 14:53:08 +0100 Subject: [PATCH] Application. Use the new FontCache for applicationwide font creation --- .../Application/RiaApplication.cpp | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/ApplicationCode/Application/RiaApplication.cpp b/ApplicationCode/Application/RiaApplication.cpp index 99fc51b5e7..62dc7fb914 100644 --- a/ApplicationCode/Application/RiaApplication.cpp +++ b/ApplicationCode/Application/RiaApplication.cpp @@ -23,6 +23,7 @@ #include "RiaArgumentParser.h" #include "RiaBaseDefs.h" #include "RiaFilePathTools.h" +#include "RiaFontCache.h" #include "RiaImportEclipseCaseTools.h" #include "RiaLogging.h" #include "RiaPreferences.h" @@ -219,7 +220,7 @@ RiaApplication::RiaApplication(int& argc, char** argv) // The creation of a font is time consuming, so make sure you really need your own font // instead of using the application font - m_standardFont = new caf::FixedAtlasFont(caf::FixedAtlasFont::POINT_SIZE_8); + m_standardFont = RiaFontCache::getFont(RiaFontCache::FONT_SIZE_8); m_runningWorkerProcess = false; @@ -1827,37 +1828,37 @@ void RiaApplication::applyPreferences() if (mainPlotWindow()) mainPlotWindow()->projectTreeView()->enableAppendOfClassNameToUiItemText(m_preferences->appendClassNameToUiText()); } - caf::FixedAtlasFont::FontSize fontSizeType = caf::FixedAtlasFont::POINT_SIZE_16; + RiaFontCache::FontSize fontSizeType = RiaFontCache::FONT_SIZE_16; if (m_preferences->fontSizeInScene() == "8") { - fontSizeType = caf::FixedAtlasFont::POINT_SIZE_8; + fontSizeType = RiaFontCache::FONT_SIZE_8; } else if (m_preferences->fontSizeInScene() == "10") { - fontSizeType = caf::FixedAtlasFont::POINT_SIZE_10; + fontSizeType = RiaFontCache::FONT_SIZE_10; } else if (m_preferences->fontSizeInScene() == "12") { - fontSizeType = caf::FixedAtlasFont::POINT_SIZE_12; + fontSizeType = RiaFontCache::FONT_SIZE_12; } else if (m_preferences->fontSizeInScene() == "14") { - fontSizeType = caf::FixedAtlasFont::POINT_SIZE_14; + fontSizeType = RiaFontCache::FONT_SIZE_14; } else if (m_preferences->fontSizeInScene() == "16") { - fontSizeType = caf::FixedAtlasFont::POINT_SIZE_16; + fontSizeType = RiaFontCache::FONT_SIZE_16; } else if (m_preferences->fontSizeInScene() == "24") { - fontSizeType = caf::FixedAtlasFont::POINT_SIZE_24; + fontSizeType = RiaFontCache::FONT_SIZE_24; } else if (m_preferences->fontSizeInScene() == "32") { - fontSizeType = caf::FixedAtlasFont::POINT_SIZE_32; + fontSizeType = RiaFontCache::FONT_SIZE_32; } - m_customFont = new caf::FixedAtlasFont(fontSizeType); + m_customFont = RiaFontCache::getFont(fontSizeType); if (this->project()) {