From 1aab2b2717d12f2469594f4d24465db552bf8efd Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Wed, 29 Jul 2009 13:04:08 +0000 Subject: [PATCH] If the font style isn't found, try to scan for fonts as well. The same is done for families. This fixes the bug that when a font family was already loaded, but some of its styles haven't been loaded yet, the app_server would fail to set the system fonts to those styles. Fixes bug #4148. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31904 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/FontManager.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/servers/app/FontManager.cpp b/src/servers/app/FontManager.cpp index f422e9c891..a7335d94e4 100644 --- a/src/servers/app/FontManager.cpp +++ b/src/servers/app/FontManager.cpp @@ -1038,8 +1038,14 @@ FontManager::GetStyle(const char* familyName, const char* styleName, return fontStyle; // before we fail, we try the mappings for a match - if (_AddMappedFont(family->Name(), styleName) == B_OK) - return family->GetStyle(styleName); + if (_AddMappedFont(family->Name(), styleName) == B_OK) { + fontStyle = family->GetStyle(styleName); + if (fontStyle != NULL) + return fontStyle; + } + + _ScanFonts(); + return family->GetStyle(styleName); } if (styleID != 0xffff)