[Tizen] Ensure join of font thread
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / text-abstraction / font-client.h
1 #ifndef DALI_PLATFORM_TEXT_ABSTRACTION_FONT_CLIENT_H
2 #define DALI_PLATFORM_TEXT_ABSTRACTION_FONT_CLIENT_H
3
4 /*
5  * Copyright (c) 2022 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali/devel-api/text-abstraction/font-list.h>
23 #include <dali/devel-api/text-abstraction/text-abstraction-definitions.h>
24 #include <dali/public-api/common/dali-vector.h>
25 #include <dali/public-api/dali-adaptor-common.h>
26 #include <dali/public-api/images/pixel-data.h>
27 #include <dali/public-api/object/base-handle.h>
28
29 namespace Dali
30 {
31 namespace TextAbstraction
32 {
33 struct FontMetrics;
34 struct GlyphInfo;
35 struct BitmapFont;
36
37 namespace Internal DALI_INTERNAL
38 {
39 class FontClient;
40 }
41
42 /**
43  * @brief FontClient provides access to font information and resources.
44  *
45  * <h3>Querying the System Fonts</h3>
46  *
47  * A "system font" is described by a "path" to a font file on the native filesystem, along with a "family" and "style".
48  * For example on the Ubuntu system a "Regular" style font from the "Ubuntu Mono" family can be accessed from "/usr/share/fonts/truetype/ubuntu-font-family/UbuntuMono-R.ttf".
49  *
50  * <h3>Accessing Fonts</h3>
51  *
52  * A "font" is created from the system for a specific point size in 26.6 fractional points. A "FontId" is used to identify each font.
53  * For example two different fonts with point sizes 10 & 12 can be created from the "Ubuntu Mono" family:
54  * @code
55  * FontClient fontClient   = FontClient::Get();
56  * FontId ubuntuMonoTen    = fontClient.GetFontId( "/usr/share/fonts/truetype/ubuntu-font-family/UbuntuMono-R.ttf", 10*64 );
57  * FontId ubuntuMonoTwelve = fontClient.GetFontId( "/usr/share/fonts/truetype/ubuntu-font-family/UbuntuMono-R.ttf", 12*64 );
58  * @endcode
59  * Glyph metrics and bitmap resources can then be retrieved using the FontId.
60  */
61 class DALI_ADAPTOR_API FontClient : public BaseHandle
62 {
63 public:
64   static const PointSize26Dot6 DEFAULT_POINT_SIZE;   ///< The default point size.
65   static const float           DEFAULT_ITALIC_ANGLE; ///< The default software italic angle in radians.
66
67   static const bool     DEFAULT_ATLAS_LIMITATION_ENABLED; ///< The default behavior of whether atlas limitation is enabled in dali.
68   static const uint32_t DEFAULT_TEXT_ATLAS_WIDTH;         ///< The default width of text-atlas-block.
69   static const uint32_t DEFAULT_TEXT_ATLAS_HEIGHT;        ///< The default height of text-atlas-block.
70   static const Size     DEFAULT_TEXT_ATLAS_SIZE;          ///< The default size(width, height) of text-atlas-block.
71
72   static const uint32_t MAX_TEXT_ATLAS_WIDTH;  ///< The maximum width of text-atlas-block.
73   static const uint32_t MAX_TEXT_ATLAS_HEIGHT; ///< The maximum height of text-atlas-block.
74   static const Size     MAX_TEXT_ATLAS_SIZE;   ///< The maximum height of text-atlas-block.
75
76   static const uint16_t PADDING_TEXT_ATLAS_BLOCK; ///< Padding per edge. How much the block size (width, height) less than the text-atlas-block size (width, height).
77   static const Size     MAX_SIZE_FIT_IN_ATLAS;    ///< The maximum block's size fit into text-atlas-block.
78
79   static const uint32_t NUMBER_OF_POINTS_PER_ONE_UNIT_OF_POINT_SIZE; ///< Factor multiply point-size in toolkit.
80
81   /**
82    * @brief Struct used to retrieve the glyph's bitmap.
83    */
84   struct DALI_ADAPTOR_API GlyphBufferData
85   {
86     /**
87      * @brief Constructor.
88      *
89      * Initializes struct members to their defaults.
90      */
91     GlyphBufferData();
92
93     /**
94      * @brief Destructor.
95      */
96     ~GlyphBufferData();
97
98     /**
99      * @brief Move constructor.
100      *
101      * @param[in] rhs moved data.
102      */
103     GlyphBufferData(GlyphBufferData&& rhs) noexcept;
104
105     /**
106      * @brief Move assign operator.
107      *
108      * @param[in] rhs moved data.
109      * @return A reference to this.
110      */
111     GlyphBufferData& operator=(GlyphBufferData&& rhs) noexcept;
112
113     // Compression method of buffer. Each buffer compressed line by line
114     enum class CompressionType
115     {
116       NO_COMPRESSION = 0, // No compression
117       BPP_4          = 1, // Compress as 4 bit. Color become value * 17 (0x00, 0x11, 0x22, ... 0xee, 0xff).
118                           // Only works for Pixel::L8 format
119       RLE_4 = 2,          // Compress as 4 bit, and Run-Length-Encode. For more high compress rate, we store difference between previous scanline.
120                           // Only works for Pixel::L8 format
121     };
122
123     /**
124      * @brief Helper static function to compress raw buffer from inBuffer to outBufferData.buffer.
125      * outBufferData will have it's own buffer.
126      *
127      * @pre outBufferData must not have it's own buffer.
128      * @param[in] inBuffer The input raw data.
129      * @param[in, out] outBufferData The output glyph buffer data.
130      * @return Size of compressed out buffer, Or 0 if compress failed.
131      */
132     static size_t Compress(const uint8_t* const inBuffer, GlyphBufferData& outBufferData);
133
134     /**
135      * @brief Helper static function to decompress raw buffer from inBuffer to outBufferPtr.
136      * If outBuffer is nullptr, Do nothing.
137      *
138      * @pre outBuffer memory should be allocated.
139      * @param[in] inBufferData The input glyph buffer data.
140      * @param[in, out] outBuffer The output pointer of raw buffer data.
141      */
142     static void Decompress(const GlyphBufferData& inBufferData, uint8_t* outBuffer);
143
144     /**
145      * @brief Special Helper static function to decompress raw buffer from inBuffer to outBuffer one scanline.
146      * After decompress one scanline successed, offset will be changed.
147      *
148      * @pre outBuffer memory should be allocated.
149      * @pre if inBufferData's compression type is RLE4, outBuffer memory should store the previous scanline data.
150      * @param[in] inBufferData The input glyph buffer data.
151      * @param[in, out] outBuffer The output pointer of raw buffer data.
152      * @param[in, out] offset The offset of input. It will be changed as next scanline's offset.
153      */
154     static void DecompressScanline(const GlyphBufferData& inBufferData, uint8_t* outBuffer, uint32_t& offset);
155
156   private:
157     // Delete copy operation.
158     GlyphBufferData(const GlyphBufferData& rhs) = delete;
159     GlyphBufferData& operator=(const GlyphBufferData& rhs) = delete;
160
161   public:
162     uint8_t*        buffer;            ///< The glyph's bitmap buffer data.
163     uint32_t        width;             ///< The width of the bitmap.
164     uint32_t        height;            ///< The height of the bitmap.
165     int             outlineOffsetX;    ///< The additional horizontal offset to be added for the glyph's position for outline.
166     int             outlineOffsetY;    ///< The additional vertical offset to be added for the glyph's position for outline.
167     Pixel::Format   format;            ///< The pixel's format of the bitmap.
168     CompressionType compressionType;   ///< The type of buffer compression.
169     bool            isColorEmoji : 1;  ///< Whether the glyph is an emoji.
170     bool            isColorBitmap : 1; ///< Whether the glyph is a color bitmap.
171     bool            isBufferOwned : 1; ///< Whether the glyph's bitmap buffer data owned by this class or not. Becareful when you use non-owned buffer data.
172   };
173
174   /**
175    * @brief Used to load an embedded item into the font client.
176    */
177   struct EmbeddedItemDescription
178   {
179     std::string       url;               ///< The url path of the image.
180     unsigned int      width;             ///< The width of the item.
181     unsigned int      height;            ///< The height of the item.
182     ColorBlendingMode colorblendingMode; ///< Whether the color of the image is multiplied by the color of the text.
183   };
184
185 public:
186   /**
187    * @brief Retrieve a handle to the FontClient instance.
188    *
189    * @return A handle to the FontClient
190    */
191   static FontClient Get();
192
193   /**
194    * @brief Create an uninitialized TextAbstraction handle.
195    */
196   FontClient();
197
198   /**
199    * @brief Destructor
200    *
201    * This is non-virtual since derived Handle types must not contain data or virtual methods.
202    */
203   ~FontClient();
204
205   /**
206    * @brief This copy constructor is required for (smart) pointer semantics.
207    *
208    * @param[in] handle A reference to the copied handle.
209    */
210   FontClient(const FontClient& handle);
211
212   /**
213    * @brief This assignment operator is required for (smart) pointer semantics.
214    *
215    * @param [in] handle  A reference to the copied handle.
216    * @return A reference to this.
217    */
218   FontClient& operator=(const FontClient& handle);
219
220   /**
221    * @brief This move constructor is required for (smart) pointer semantics.
222    *
223    * @param[in] handle A reference to the moved handle.
224    */
225   FontClient(FontClient&& handle);
226
227   /**
228    * @brief This move assignment operator is required for (smart) pointer semantics.
229    *
230    * @param [in] handle  A reference to the moved handle.
231    * @return A reference to this.
232    */
233   FontClient& operator=(FontClient&& handle);
234
235   ////////////////////////////////////////
236   // Font management and validation.
237   ////////////////////////////////////////
238
239   /**
240    * @brief Clear all caches in FontClient
241    *
242    */
243   void ClearCache();
244
245   /**
246    * @brief Set the DPI of the target window.
247    *
248    * @note Multiple windows are not currently supported.
249    * @param[in] horizontalDpi The horizontal resolution in DPI.
250    * @param[in] verticalDpi The vertical resolution in DPI.
251    */
252   void SetDpi(unsigned int horizontalDpi, unsigned int verticalDpi);
253
254   /**
255    * @brief Retrieves the DPI previously set to the target window.
256    *
257    * @note Multiple windows are not currently supported.
258    * @param[out] horizontalDpi The horizontal resolution in DPI.
259    * @param[out] verticalDpi The vertical resolution in DPI.
260    */
261   void GetDpi(unsigned int& horizontalDpi, unsigned int& verticalDpi);
262
263   /**
264    * @brief Called by Dali to retrieve the default font size for the platform.
265    *
266    * This is an accessibility size, which is mapped to a UI Control specific point-size in stylesheets.
267    * For example if zero the smallest size, this could potentially map to TextLabel point-size 8.
268    * @return The default font size.
269    */
270   int GetDefaultFontSize();
271
272   /**
273    * @brief Called when the user changes the system defaults.
274    *
275    * @post Previously cached system defaults are removed.
276    */
277   void ResetSystemDefaults();
278
279   /**
280    * @brief Retrieve the list of default fonts supported by the system.
281    *
282    * @param[out] defaultFonts A list of default font paths, family, width, weight and slant.
283    */
284   void GetDefaultFonts(FontList& defaultFonts);
285
286   /**
287    * @brief Initializes and caches default font from the system.
288    */
289   void InitDefaultFontDescription();
290
291   /**
292    * @brief Retrieve the active default font from the system.
293    *
294    * @param[out] fontDescription font structure describing the default font.
295    */
296   void GetDefaultPlatformFontDescription(FontDescription& fontDescription);
297
298   /**
299    * @brief Retrieve the list of fonts supported by the system.
300    *
301    * @param[out] systemFonts A list of font paths, family, width, weight and slant.
302    */
303   void GetSystemFonts(FontList& systemFonts);
304
305   /**
306    * @brief Retrieves the font description of a given font @p fontId.
307    *
308    * @param[in] fontId The font identifier.
309    * @param[out] fontDescription The path, family & style (width, weight and slant) describing the font.
310    */
311   void GetDescription(FontId fontId, FontDescription& fontDescription);
312
313   /**
314    * @brief Retrieves the font point size of a given font @p fontId.
315    *
316    * @param[in] fontId The font identifier.
317    *
318    * @return The point size in 26.6 fractional points.
319    */
320   PointSize26Dot6 GetPointSize(FontId fontId);
321
322   /**
323    * @brief Whether the given @p character is supported by the font.
324    *
325    * @param[in] fontId The id of the font.
326    * @param[in] character The character.
327    *
328    * @return @e true if the character is supported by the font.
329    */
330   bool IsCharacterSupportedByFont(FontId fontId, Character character);
331
332   /**
333    * @brief Find the default font for displaying a UTF-32 character.
334    *
335    * This is useful when localised strings are provided for multiple languages
336    * i.e. when a single default font does not work for all languages.
337    *
338    * @param[in] charcode The character for which a font is needed.
339    * @param[in] requestedPointSize The point size in 26.6 fractional points; the default point size is 12*64.
340    * @param[in] preferColor @e true if a color font is preferred.
341    *
342    * @return A valid font identifier, or zero if the font does not exist.
343    */
344   FontId FindDefaultFont(Character       charcode,
345                          PointSize26Dot6 requestedPointSize = DEFAULT_POINT_SIZE,
346                          bool            preferColor        = false);
347
348   /**
349    * @brief Find a fallback-font for displaying a UTF-32 character.
350    *
351    * This is useful when localised strings are provided for multiple languages
352    * i.e. when a single default font does not work for all languages.
353    *
354    * @param[in] charcode The character for which a font is needed.
355    * @param[in] preferredFontDescription Description of the preferred font which may not provide a glyph for @p charcode.
356    *                                     The fallback-font will be the closest match to @p preferredFontDescription, which does support the required glyph.
357    * @param[in] requestedPointSize The point size in 26.6 fractional points; the default point size is 12*64.
358    * @param[in] preferColor @e true if a color font is preferred.
359    *
360    * @return A valid font identifier, or zero if the font does not exist.
361    */
362   FontId FindFallbackFont(Character              charcode,
363                           const FontDescription& preferredFontDescription,
364                           PointSize26Dot6        requestedPointSize = DEFAULT_POINT_SIZE,
365                           bool                   preferColor        = false);
366
367   /**
368    * @brief Retrieve the unique identifier for a font.
369    *
370    * @param[in] path The path to a font file.
371    * @param[in] requestedPointSize The point size in 26.6 fractional points; the default point size is 12*64.
372    * @param[in] faceIndex The index of the font face (optional).
373    *
374    * @return A valid font identifier, or zero if the font does not exist.
375    */
376   FontId GetFontId(const FontPath& path,
377                    PointSize26Dot6 requestedPointSize = DEFAULT_POINT_SIZE,
378                    FaceIndex       faceIndex          = 0);
379
380   /**
381    * @brief Retrieves a unique font identifier for a given description.
382    *
383    * @param[in] preferredFontDescription Description of the preferred font.
384    *                                     The font will be the closest match to @p preferredFontDescription.
385    * @param[in] requestedPointSize The point size in 26.6 fractional points; the default point size is 12*64.
386    * @param[in] faceIndex The index of the font face (optional).
387    *
388    * @return A valid font identifier, or zero if no font is found.
389    */
390   FontId GetFontId(const FontDescription& preferredFontDescription,
391                    PointSize26Dot6        requestedPointSize = DEFAULT_POINT_SIZE,
392                    FaceIndex              faceIndex          = 0);
393
394   /**
395    * @brief Retrieves a unique font identifier for a given bitmap font.
396    * If the font is not present, it will cache the given font, and give it a new font id.
397    *
398    * @param[in] bitmapFont A bitmap font.
399    *
400    * @return A valid font identifier.
401    */
402   FontId GetFontId(const BitmapFont& bitmapFont);
403
404   /**
405    * @brief Check to see if a font is scalable.
406    *
407    * @param[in] path The path to a font file.
408    * @return true if scalable.
409    */
410   bool IsScalable(const FontPath& path);
411
412   /**
413    * @brief Check to see if a font is scalable.
414    *
415    * @note It the font style is not empty, it will be used instead the font weight and font slant slant.
416    *
417    * @param[in] fontDescription A font description.
418    *
419    * @return true if scalable
420    */
421   bool IsScalable(const FontDescription& fontDescription);
422
423   /**
424    * @brief Get a list of sizes available for a fixed size font.
425    *
426    * @param[in] path The path to a font file.
427    * @param[out] sizes A list of the available sizes, if no sizes available will return empty.
428    */
429   void GetFixedSizes(const FontPath& path, Dali::Vector<PointSize26Dot6>& sizes);
430
431   /**
432    * @brief Get a list of sizes available for a fixed size font.
433    *
434    * @note It the font style is not empty, it will be used instead the font weight and font slant slant.
435    *
436    * @param[in] fontDescription A font description.
437    * @param[out] sizes A list of the available sizes, if no sizes available will return empty.
438    */
439   void GetFixedSizes(const FontDescription&         fontDescription,
440                      Dali::Vector<PointSize26Dot6>& sizes);
441
442   /**
443    * @brief Whether the font has Italic style.
444    *
445    * @param[in] fontId The font identifier.
446    *
447    * @return true if the font has italic style.
448    */
449   bool HasItalicStyle(FontId fontId) const;
450
451   ////////////////////////////////////////
452   // Font metrics, glyphs and bitmaps.
453   ////////////////////////////////////////
454
455   /**
456    * @brief Query the metrics for a font.
457    *
458    * @param[in] fontId The identifier of the font for the required glyph.
459    * @param[out] metrics The font metrics.
460    */
461   void GetFontMetrics(FontId fontId, FontMetrics& metrics);
462
463   /**
464    * @brief Retrieve the glyph index for a UTF-32 character code.
465    *
466    * @param[in] fontId The identifier of the font for the required glyph.
467    * @param[in] charcode The UTF-32 character code.
468    *
469    * @return The glyph index, or zero if the character code is undefined.
470    */
471   GlyphIndex GetGlyphIndex(FontId fontId, Character charcode);
472
473   /**
474    * @brief Return the glyph index of a given character code as modified by the variation selector.
475    *
476    * @param[in] fontId The identifier of the font for the required glyph.
477    * @param[in] charcode The UTF-32 character code.
478    * @param[in] variantSelector The UTF-32 character code point of the variation selector.
479    *
480    * @return The glyph index, or zero if the character code is undefined.
481    */
482   GlyphIndex GetGlyphIndex(FontId fontId, Character charcode, Character variantSelector);
483
484   /**
485    * @brief Retrieve the metrics for a series of glyphs.
486    *
487    * @param[in,out] array An array of glyph-info structures with initialized FontId & GlyphIndex values.
488    *                      It may contain the advance and an offset set into the bearing from the shaping tool.
489    *                      On return, the glyph's size value will be initialized. The bearing value will be updated by adding the font's glyph bearing to the one set by the shaping tool.
490    * @param[in] size The size of the array.
491    * @param[in] type The type of glyphs used for rendering; either bitmaps or vectors.
492    * @param[in] horizontal True for horizontal layouts (set to false for vertical layouting).
493    *
494    * @return @e true if all of the requested metrics were found.
495    */
496   bool GetGlyphMetrics(GlyphInfo* array, uint32_t size, GlyphType type, bool horizontal = true);
497
498   /**
499    * @brief Create a bitmap representation of a glyph.
500    *
501    * @note The caller is responsible for deallocating the bitmap data @p data.buffer using delete[].
502    *
503    * @param[in]  fontId           The identifier of the font.
504    * @param[in]  glyphIndex       The index of a glyph within the specified font.
505    * @param[in]  isItalicRequired Whether the glyph requires italic style.
506    * @param[in]  isBoldRequired   Whether the glyph requires bold style.
507    * @param[out] data             The bitmap data.
508    * @param[in]  outlineWidth     The width of the glyph outline in pixels.
509    */
510   void CreateBitmap(FontId fontId, GlyphIndex glyphIndex, bool isItalicRequired, bool isBoldRequired, GlyphBufferData& data, int outlineWidth);
511
512   /**
513    * @brief Create a bitmap representation of a glyph.
514    *
515    * @param[in] fontId The identifier of the font.
516    * @param[in] glyphIndex The index of a glyph within the specified font.
517    * @param[in] outlineWidth The width of the glyph outline in pixels.
518    *
519    * @return A valid PixelData, or an empty handle if the glyph could not be rendered.
520    */
521   PixelData CreateBitmap(FontId fontId, GlyphIndex glyphIndex, int outlineWidth);
522
523   /**
524    * @brief Create a vector representation of a glyph.
525    *
526    * @note This feature requires highp shader support and is not available on all platforms
527    * @param[in] fontId The identifier of the font.
528    * @param[in] glyphIndex The index of a glyph within the specified font.
529    * @param[out] blob A blob of data; this is owned by FontClient and should be copied by the caller of CreateVectorData().
530    * @param[out] blobLength The length of the blob data, or zero if the blob creation failed.
531    * @param[out] nominalWidth The width of the blob.
532    * @param[out] nominalHeight The height of the blob.
533    */
534   void CreateVectorBlob(FontId        fontId,
535                         GlyphIndex    glyphIndex,
536                         VectorBlob*&  blob,
537                         unsigned int& blobLength,
538                         unsigned int& nominalWidth,
539                         unsigned int& nominalHeight);
540
541   /**
542    * @brief Retrieves the ellipsis glyph for a requested point size.
543    *
544    * @param[in] requestedPointSize The requested point size.
545    *
546    * @return The ellipsis glyph.
547    */
548   const GlyphInfo& GetEllipsisGlyph(PointSize26Dot6 requestedPointSize);
549
550   /**
551    * @brief Whether the given glyph @p glyphIndex is a color glyph.
552    *
553    * @param[in] fontId The font id.
554    * @param[in] glyphIndex The glyph index.
555    *
556    * @return @e true if the glyph is a color one.
557    */
558   bool IsColorGlyph(FontId fontId, GlyphIndex glyphIndex);
559
560   /**
561    * @brief  Add custom fonts directory
562    *
563    * @param[in] path to the fonts directory
564    *
565    * @return true if the fonts can be added.
566    */
567   bool AddCustomFontDirectory(const FontPath& path);
568
569   /**
570    * @brief Creates and stores an embedded item and it's metrics.
571    *
572    * If in the @p description there is a non empty url, it calls Dali::LoadImageFromFile() internally.
573    * If in the @p description there is a url and @e width or @e height are zero it stores the default size. Otherwise the image is resized.
574    * If the url in the @p description is empty it stores the size.
575    *
576    * @param[in] description The description of the embedded item.
577    * @param[out] pixelFormat The pixel format of the image.
578    *
579    * return The index within the vector of embedded items.
580    */
581   GlyphIndex CreateEmbeddedItem(const EmbeddedItemDescription& description, Pixel::Format& pixelFormat);
582
583   /**
584    * @brief true to enable Atlas-Limitation.
585    *
586    * @note Used default configuration.
587    * @param[in] enabled The on/off value to enable/disable Atlas-Limitation.
588    */
589   void EnableAtlasLimitation(bool enabled);
590
591   /**
592    * @brief Check Atlas-Limitation is enabled or disabled.
593    *
594    * @note Used default configuration.
595    * return true if Atlas-Limitation is enabled, otherwise false.
596    */
597   bool IsAtlasLimitationEnabled() const;
598
599   /**
600    * @brief retrieve the maximum allowed width and height for text-atlas-block.
601    *
602    * @note Used default configuration.
603    * return the maximum width and height of text-atlas-block.
604    */
605   Size GetMaximumTextAtlasSize() const;
606
607   /**
608    * @brief retrieve the default width and height for text-atlas-block.
609    *
610    * @note Used default configuration.
611    * return the default width and height of text-atlas-block.
612    */
613   Size GetDefaultTextAtlasSize() const;
614
615   /**
616    * @brief retrieve the current maximum width and height for text-atlas-block.
617    *
618    * @note Used default configuration.
619    * return the current maximum width and height of text-atlas-block.
620    */
621   Size GetCurrentMaximumBlockSizeFitInAtlas() const;
622
623   /**
624    * @brief set the achieved size (width and height) for text-atlas-block.
625    * If @p currentMaximumBlockSizeFitInAtlas larger than the current maximum text atlas then store, otherwise ignore.
626    *
627    * @note Used default configuration.
628    * return true if the current maximum text atlas size is changed, otherwise false.
629    */
630   bool SetCurrentMaximumBlockSizeFitInAtlas(const Size& currentMaximumBlockSizeFitInAtlas);
631
632   /**
633    * @brief retrieve the number of points to scale-up one unit of point-size.
634    *
635    * @note Used default configuration.
636    * return the number of points per one unit of point-size
637    */
638   uint32_t GetNumberOfPointsPerOneUnitOfPointSize() const;
639
640 public: // Not intended for application developers
641   /**
642    * @brief This constructor is used by FontClient::Get().
643    *
644    * @param[in] fontClient  A pointer to the internal fontClient object.
645    */
646   explicit DALI_INTERNAL FontClient(Internal::FontClient* fontClient);
647 };
648
649 /**
650  * @brief This is used to improve application launch performance
651  *
652  * @return A pre-initialized FontClient
653  */
654 DALI_ADAPTOR_API FontClient FontClientPreInitialize();
655
656 /**
657  * @brief This is used to pre-cache FontConfig in order to improve the runtime performance of the application.
658  *
659  * @param[in] fallbackFamilyList A list of fallback font families to be pre-cached.
660  * @param[in] extraFamilyList A list of additional font families to be pre-cached.
661  * @param[in] localeFamily A locale font family to be pre-cached.
662  * @param[in] useThread True if the font client should create thread and perform pre-caching, false otherwise.
663  * @param[in] syncCreation True if thread creation guarantees syncronization with the main thread, false async creation.
664  */
665 DALI_ADAPTOR_API void FontClientPreCache(const FontFamilyList& fallbackFamilyList, const FontFamilyList& extraFamilyList, const FontFamily& localeFamily, bool useThread, bool syncCreation);
666
667 /**
668  * @brief This is used to pre-load FreeType font face in order to improve the runtime performance of the application.
669  *
670  * @param[in] fontPathList A list of font paths to be pre-loaded.
671  * @param[in] memoryFontPathList A list of memory font paths to be pre-loaded.
672  * @param[in] useThread True if the font client should create thread and perform font pre-loading, false otherwise.
673  * @param[in] syncCreation True if thread creation guarantees syncronization with the main thread, false async creation.
674  *
675  * @note
676  * The fonts in the fontPathList perform FT_New_Face during pre-loading,
677  * which can provide some performace benefits.
678  *
679  * The fonts in the memoryFontPathList read the font file and cache the buffer in memory during pre-load.
680  * This enables the use of FT_New_Memory_Face during runtime and provides a performance boost.
681  * It requires memory equivalent to the size of each font file.
682  */
683 DALI_ADAPTOR_API void FontClientFontPreLoad(const FontPathList& fontPathList, const FontPathList& memoryFontPathList, bool useThread, bool syncCreation);
684
685 /**
686   * @brief Joins font threads, waiting for their execution to complete.
687   */
688 DALI_ADAPTOR_API void FontClientJoinFontThreads();
689
690 } // namespace TextAbstraction
691
692 } // namespace Dali
693
694 #endif // DALI_PLATFORM_TEXT_ABSTRACTION_FONT_CLIENT_H