namespace
{
+const std::string DEFAULT_FONT_DIR("/resources/fonts");
+
static int ASYNC_TEXT_THREAD_TIMEOUT = 5;
static bool gAsyncTextRenderedCalled;
// Avoid a crash when core load gl resources.
application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE);
+ char* pathNamePtr = get_current_dir_name();
+ const std::string pathName(pathNamePtr);
+ free(pathNamePtr);
+
+ TextAbstraction::FontDescription fontDescription;
+ std::string fontPath = pathName + DEFAULT_FONT_DIR + "/tizen/BreezeColorEmoji.ttf";
+
+ TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
+ fontClient.AddCustomFontDirectory(fontPath);
+
TextLabel label = TextLabel::New();
DALI_TEST_CHECK(label);
mModule.ClearCache();
}
+void AsyncTextLoader::SetCustomFontDirectories(const TextAbstraction::FontPathList& customFontDirectories)
+{
+ for(auto &path: customFontDirectories)
+ {
+ mModule.GetFontClient().AddCustomFontDirectory(path);
+ }
+}
+
void AsyncTextLoader::SetModuleClearNeeded(bool clear)
{
Dali::Mutex::ScopedLock lock(mMutex);
*/
void ClearModule();
+ /**
+ * @copydoc Dali::AsyncTextLoader::SetCustomFontDirectories()
+ */
+ void SetCustomFontDirectories(const TextAbstraction::FontPathList& customFontDirectories);
+
/**
* @copydoc Dali::AsyncTextLoader::SetModuleClearNeeded()
*/
GetImplementation(*this).ClearModule();
}
+void AsyncTextLoader::SetCustomFontDirectories(const TextAbstraction::FontPathList& customFontDirectories)
+{
+ GetImplementation(*this).SetCustomFontDirectories(customFontDirectories);
+}
+
void AsyncTextLoader::SetModuleClearNeeded(bool clear)
{
GetImplementation(*this).SetModuleClearNeeded(clear);
*/
void ClearModule();
+ /**
+ * @brief Sets custom fonts directories.
+ *
+ * @param[in] customFontDirectories List of the custom font paths.
+ */
+ void SetCustomFontDirectories(const TextAbstraction::FontPathList& customFontDirectories);
+
/**
* @brief Sets a flag indicating that module's cache clearing is needed.
*
mLocale = TextAbstraction::GetLocaleFull();
+ const TextAbstraction::FontPathList& customFonts = TextAbstraction::FontClient::Get().GetCustomFontDirectories();
for(int i = 0; i < numberOfLoader; i++)
{
Text::AsyncTextLoader loader = Text::AsyncTextLoader::New();
+ loader.SetCustomFontDirectories(customFonts);
mAvailableLoaders.push_back(loader);
}
{
Dali::Adaptor::Get().LocaleChangedSignal().Connect(this, &AsyncTextManager::OnLocaleChanged);
}
-
- // This function should be called after all AsyncTextModule(FontClient) are created.
- TextAbstraction::FontClient::Get().ApplyCustomFontDirectories();
- // TODO : In the near future, we may need to address potential thread-safety issues related to the FontConfig handle.
}
AsyncTextManager::~AsyncTextManager()