[4.0] Support custom fonts registration 77/155677/1
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Mon, 16 Oct 2017 02:27:05 +0000 (11:27 +0900)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Mon, 16 Oct 2017 02:27:13 +0000 (11:27 +0900)
This reverts commit 30e952ebef7228c18f2812663071511dcd8b7838.

Change-Id: I783a3ea4c8d4b0e0f47afa2c6940a4deabf675f0

text/dali/devel-api/text-abstraction/font-client.cpp
text/dali/devel-api/text-abstraction/font-client.h
text/dali/internal/text-abstraction/font-client-impl.cpp
text/dali/internal/text-abstraction/font-client-impl.h
text/dali/internal/text-abstraction/font-client-plugin-impl.cpp
text/dali/internal/text-abstraction/font-client-plugin-impl.h

index 90470d2..d15cc57 100644 (file)
@@ -207,6 +207,11 @@ bool FontClient::IsColorGlyph( FontId fontId, GlyphIndex glyphIndex )
   return GetImplementation(*this).IsColorGlyph( fontId, glyphIndex );
 }
 
+bool FontClient::AddCustomFontDirectory( const char* path )
+{
+  return GetImplementation(*this).AddCustomFontDirectory( path );
+}
+
 FontClient::FontClient( Internal::FontClient* internal )
 : BaseHandle( internal )
 {
index 8c8cfca..cf0c0b1 100644 (file)
@@ -405,6 +405,15 @@ public:
    */
   bool IsColorGlyph( FontId fontId, GlyphIndex glyphIndex );
 
+  /**
+   * @brief  Add custom fonts directory
+   *
+   * @param[in] path to the fonts directory
+   *
+   * @return true if the fonts can be added.
+   */
+  bool AddCustomFontDirectory( const char* path );
+
 public: // Not intended for application developers
   /**
    * @brief This constructor is used by FontClient::Get().
index 4ab90bf..1bed788 100644 (file)
@@ -281,6 +281,13 @@ bool FontClient::IsColorGlyph( FontId fontId, GlyphIndex glyphIndex )
   return mPlugin->IsColorGlyph( fontId, glyphIndex );
 }
 
+bool FontClient::AddCustomFontDirectory( const char* path )
+{
+  CreatePlugin();
+
+  return mPlugin->AddCustomFontDirectory( path );
+}
+
 void FontClient::CreatePlugin()
 {
   if( !mPlugin )
index cfa3a20..9637531 100644 (file)
@@ -193,6 +193,11 @@ public:
    */
   bool IsColorGlyph( FontId fontId, GlyphIndex glyphIndex );
 
+  /**
+   * @copydoc Dali::TextAbstraction::FontClient::AddCustomFontDirectory()
+   */
+  bool AddCustomFontDirectory( const char* path );
+
 private:
 
   /**
index a1e4cc6..b7055c1 100644 (file)
@@ -1274,6 +1274,12 @@ bool FontClient::Plugin::IsColorGlyph( FontId fontId, GlyphIndex glyphIndex )
   return FT_Err_Ok == error;
 }
 
+bool FontClient::Plugin::AddCustomFontDirectory( const char* path )
+{
+  // NULL as first parameter means the current configuration is used.
+  return FcConfigAppFontAddDir( NULL, reinterpret_cast<const FcChar8 *>( path ) );
+}
+
 void FontClient::Plugin::InitSystemFonts()
 {
   DALI_LOG_INFO( gLogFilter, Debug::General, "-->FontClient::Plugin::InitSystemFonts\n" );
index c1e158f..936a159 100644 (file)
@@ -321,6 +321,11 @@ struct FontClient::Plugin
    */
   bool IsColorGlyph( FontId fontId, GlyphIndex glyphIndex );
 
+  /**
+   * @copydoc Dali::TextAbstraction::FontClient::AddCustomFontDirectory()
+   */
+  bool AddCustomFontDirectory( const char* path );
+
 private:
 
   /**