Add support for FontClientFontPreLoad API
[platform/core/uifw/dali-adaptor.git] / dali / internal / text / text-abstraction / plugin / font-client-plugin-impl.h
index d9c9ed0..172b247 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_TEXT_ABSTRACTION_FONT_CLIENT_PLUGIN_IMPL_H
 
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -105,6 +105,11 @@ public: // Dali::TextAbstraction::FontClient
   void ResetSystemDefaults() const;
 
   /**
+   * @copydoc Dali::TextAbstraction::FontClient::InitDefaultFontDescription()
+   */
+  void InitDefaultFontDescription() const;
+
+  /**
    * @copydoc Dali::TextAbstraction::FontClient::GetDefaultPlatformFontDescription()
    */
   void GetDefaultPlatformFontDescription(FontDescription& fontDescription) const;
@@ -318,6 +323,11 @@ public: // Dali::TextAbstraction::Internal::FontClient
    */
   void FontPreCache(const FontFamilyList& fallbackFamilyList, const FontFamilyList& extraFamilyList, const FontFamily& localeFamily) const;
 
+  /**
+   * @copydoc Dali::TextAbstraction::Internal::FontClient::FontPreLoad()
+   */
+  void FontPreLoad(const FontPathList& fontPathList, const FontPathList& memoryFontPathList) const;
+
 private:
   /**
    * Get the cached font item for the given font
@@ -358,6 +368,27 @@ private:
                     FaceIndex       faceIndex,
                     bool            cacheDescription) const;
 
+
+  /**
+   * @brief Caches font data for the specified font path if it is not already cached.
+   *
+   * If the font data is not already cached, this function will load the font file
+   * from disk and cache the data for future use.
+   *
+   * @param[in] fontPath The font path to cache the data for.
+   */
+  void CacheFontDataFromFile(const std::string& fontPath) const;
+
+  /**
+   * @brief Caches FreeType face for the specified font path if it is not already cached.
+   *
+   * If the font face is not already cached, this function will perform the new face
+   * from font file and cache the face for future use.
+   *
+   * @param[in] fontPath The font path to cache the face for.
+   */
+  void CacheFontFaceFromFile(const std::string& fontPath) const;
+
 private:
   Plugin(const Plugin&) = delete;
   Plugin& operator=(const Plugin&) = delete;