add patch
[framework/osp/uifw.git] / src / graphics / FGrp_FontRsrcManager.cpp
index 387a294..6a0ea05 100644 (file)
@@ -72,6 +72,7 @@ const int _DEFAULT_FONT_FACE = 0;
 const char* _DEFAULT_SYSTEM_FONT = "DefaultSystemFont";
 const char* _DEFAULT_SYSTEM_BOLD_FONT = "DefaultSystemBoldFont";
 const _Util::FixedPoint26_6 _SYSTEM_DEFAULT_FONT_SIZE(16);
+const int _BLACK_LIST_MAX_COUNT = 1000;
 
 class _FontNull
        : public Tizen::Graphics::_IFont
@@ -294,7 +295,6 @@ _FontRsrcManager::_FontRsrcManager()
        __appFontMap.Construct(0, 0, fontHashCodeProviderEx, fontComparerEx);
 #endif
 
-
        __defaultSystemFontPath.Clear();
        __defaultSystemBoldFontPath.Clear();
        __pDefaultSystemFont = null;
@@ -549,7 +549,6 @@ _FontRsrcManager::AddFont(const _Util::WString& fontPath, SharedFontResource& ou
        return E_SUCCESS;
 }
 
-
 bool
 _FontRsrcManager::SearchFont(const _Util::WString& fontName)
 {
@@ -558,6 +557,31 @@ _FontRsrcManager::SearchFont(const _Util::WString& fontName)
        return (__SearchFont(fontName, sharedFont) == true);
 }
 
+void
+_FontRsrcManager::AddBlackList(const wchar_t unicode)
+{
+       if (__blackListUnicodeSet.size() > _BLACK_LIST_MAX_COUNT)
+       {
+               this->ClearBlackList();
+       }
+
+       __blackListUnicodeSet.insert(unicode);
+}
+
+bool
+_FontRsrcManager::SearchBlackList(const wchar_t unicode) const
+{
+       BlackListSetT::const_iterator blackListIterator = __blackListUnicodeSet.find(unicode);
+
+       return (blackListIterator != __blackListUnicodeSet.end());
+}
+
+void
+_FontRsrcManager::ClearBlackList()
+{
+       __blackListUnicodeSet.clear();
+}
+
 result
 _FontRsrcManager::GetFont(const byte* pFontData, int fontDataSize, int style, _Util::FixedPoint26_6 size, SharedFontResource& out)
 {
@@ -1082,6 +1106,7 @@ _FontRsrcManager::__ReloadFont(String fontName, bool isBold)
 #endif
 
                pFont->CleanCache();
+               this->ClearBlackList();
        }
 
        return true;