From cc0580fe341ccc2afa9bad8610e3f1bc8fe1c676 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sat, 2 May 2009 20:58:24 +0000 Subject: [PATCH] * Small style cleanup and some comments added for clarity. * FontManager::GetFamily() removed second call to _FindFamily() with no action in between -- why would it suddenly work the second time? git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30591 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/FontManager.cpp | 9 ++++----- src/servers/app/FontManager.h | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/servers/app/FontManager.cpp b/src/servers/app/FontManager.cpp index 9e9b7a3ddb..4a81e2cef5 100644 --- a/src/servers/app/FontManager.cpp +++ b/src/servers/app/FontManager.cpp @@ -445,6 +445,7 @@ FontManager::_GetDefaultStyle(const char *familyName, const char *styleName, status_t FontManager::_SetDefaultFonts() { + // plain font FontStyle* style = _GetDefaultStyle(DEFAULT_PLAIN_FONT_FAMILY, DEFAULT_PLAIN_FONT_STYLE, FALLBACK_PLAIN_FONT_FAMILY, DEFAULT_PLAIN_FONT_STYLE, @@ -457,6 +458,7 @@ FontManager::_SetDefaultFonts() if (fDefaultPlainFont == NULL) return B_NO_MEMORY; + // bold font style = _GetDefaultStyle(DEFAULT_BOLD_FONT_FAMILY, DEFAULT_BOLD_FONT_STYLE, FALLBACK_BOLD_FONT_FAMILY, DEFAULT_BOLD_FONT_STYLE, B_BOLD_FACE); @@ -465,6 +467,7 @@ FontManager::_SetDefaultFonts() if (fDefaultBoldFont == NULL) return B_NO_MEMORY; + // fixed font style = _GetDefaultStyle(DEFAULT_FIXED_FONT_FAMILY, DEFAULT_FIXED_FONT_STYLE, FALLBACK_FIXED_FONT_FAMILY, DEFAULT_FIXED_FONT_STYLE, B_REGULAR_FACE); @@ -474,6 +477,7 @@ FontManager::_SetDefaultFonts() return B_NO_MEMORY; fDefaultFixedFont->SetSpacing(B_FIXED_SPACING); + return B_OK; } @@ -918,11 +922,6 @@ FontManager::GetFamily(const char* name) if (fScanned) return NULL; - // try again - family = _FindFamily(name); - if (family != NULL) - return family; - // try font mappings before failing if (_AddMappedFont(name) == B_OK) return _FindFamily(name); diff --git a/src/servers/app/FontManager.h b/src/servers/app/FontManager.h index 9d2010edb7..9ea78a47c1 100644 --- a/src/servers/app/FontManager.h +++ b/src/servers/app/FontManager.h @@ -112,6 +112,6 @@ class FontManager : public BLooper { }; extern FT_Library gFreeTypeLibrary; -extern FontManager *gFontManager; +extern FontManager* gFontManager; #endif /* FONT_MANAGER_H */