0ea768edbfb720cbad04bc1224565ae6b97394d9
[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 Retrieve the active default font from the system.
288    *
289    * @param[out] fontDescription font structure describing the default font.
290    */
291   void GetDefaultPlatformFontDescription(FontDescription& fontDescription);
292
293   /**
294    * @brief Retrieve the list of fonts supported by the system.
295    *
296    * @param[out] systemFonts A list of font paths, family, width, weight and slant.
297    */
298   void GetSystemFonts(FontList& systemFonts);
299
300   /**
301    * @brief Retrieves the font description of a given font @p fontId.
302    *
303    * @param[in] fontId The font identifier.
304    * @param[out] fontDescription The path, family & style (width, weight and slant) describing the font.
305    */
306   void GetDescription(FontId fontId, FontDescription& fontDescription);
307
308   /**
309    * @brief Retrieves the font point size of a given font @p fontId.
310    *
311    * @param[in] fontId The font identifier.
312    *
313    * @return The point size in 26.6 fractional points.
314    */
315   PointSize26Dot6 GetPointSize(FontId fontId);
316
317   /**
318    * @brief Whether the given @p character is supported by the font.
319    *
320    * @param[in] fontId The id of the font.
321    * @param[in] character The character.
322    *
323    * @return @e true if the character is supported by the font.
324    */
325   bool IsCharacterSupportedByFont(FontId fontId, Character character);
326
327   /**
328    * @brief Find the default font for displaying a UTF-32 character.
329    *
330    * This is useful when localised strings are provided for multiple languages
331    * i.e. when a single default font does not work for all languages.
332    *
333    * @param[in] charcode The character for which a font is needed.
334    * @param[in] requestedPointSize The point size in 26.6 fractional points; the default point size is 12*64.
335    * @param[in] preferColor @e true if a color font is preferred.
336    *
337    * @return A valid font identifier, or zero if the font does not exist.
338    */
339   FontId FindDefaultFont(Character       charcode,
340                          PointSize26Dot6 requestedPointSize = DEFAULT_POINT_SIZE,
341                          bool            preferColor        = false);
342
343   /**
344    * @brief Find a fallback-font for displaying a UTF-32 character.
345    *
346    * This is useful when localised strings are provided for multiple languages
347    * i.e. when a single default font does not work for all languages.
348    *
349    * @param[in] charcode The character for which a font is needed.
350    * @param[in] preferredFontDescription Description of the preferred font which may not provide a glyph for @p charcode.
351    *                                     The fallback-font will be the closest match to @p preferredFontDescription, which does support the required glyph.
352    * @param[in] requestedPointSize The point size in 26.6 fractional points; the default point size is 12*64.
353    * @param[in] preferColor @e true if a color font is preferred.
354    *
355    * @return A valid font identifier, or zero if the font does not exist.
356    */
357   FontId FindFallbackFont(Character              charcode,
358                           const FontDescription& preferredFontDescription,
359                           PointSize26Dot6        requestedPointSize = DEFAULT_POINT_SIZE,
360                           bool                   preferColor        = false);
361
362   /**
363    * @brief Retrieve the unique identifier for a font.
364    *
365    * @param[in] path The path to a font file.
366    * @param[in] requestedPointSize The point size in 26.6 fractional points; the default point size is 12*64.
367    * @param[in] faceIndex The index of the font face (optional).
368    *
369    * @return A valid font identifier, or zero if the font does not exist.
370    */
371   FontId GetFontId(const FontPath& path,
372                    PointSize26Dot6 requestedPointSize = DEFAULT_POINT_SIZE,
373                    FaceIndex       faceIndex          = 0);
374
375   /**
376    * @brief Retrieves a unique font identifier for a given description.
377    *
378    * @param[in] preferredFontDescription Description of the preferred font.
379    *                                     The font will be the closest match to @p preferredFontDescription.
380    * @param[in] requestedPointSize The point size in 26.6 fractional points; the default point size is 12*64.
381    * @param[in] faceIndex The index of the font face (optional).
382    *
383    * @return A valid font identifier, or zero if no font is found.
384    */
385   FontId GetFontId(const FontDescription& preferredFontDescription,
386                    PointSize26Dot6        requestedPointSize = DEFAULT_POINT_SIZE,
387                    FaceIndex              faceIndex          = 0);
388
389   /**
390    * @brief Retrieves a unique font identifier for a given bitmap font.
391    * If the font is not present, it will cache the given font, and give it a new font id.
392    *
393    * @param[in] bitmapFont A bitmap font.
394    *
395    * @return A valid font identifier.
396    */
397   FontId GetFontId(const BitmapFont& bitmapFont);
398
399   /**
400    * @brief Check to see if a font is scalable.
401    *
402    * @param[in] path The path to a font file.
403    * @return true if scalable.
404    */
405   bool IsScalable(const FontPath& path);
406
407   /**
408    * @brief Check to see if a font is scalable.
409    *
410    * @note It the font style is not empty, it will be used instead the font weight and font slant slant.
411    *
412    * @param[in] fontDescription A font description.
413    *
414    * @return true if scalable
415    */
416   bool IsScalable(const FontDescription& fontDescription);
417
418   /**
419    * @brief Get a list of sizes available for a fixed size font.
420    *
421    * @param[in] path The path to a font file.
422    * @param[out] sizes A list of the available sizes, if no sizes available will return empty.
423    */
424   void GetFixedSizes(const FontPath& path, Dali::Vector<PointSize26Dot6>& sizes);
425
426   /**
427    * @brief Get a list of sizes available for a fixed size font.
428    *
429    * @note It the font style is not empty, it will be used instead the font weight and font slant slant.
430    *
431    * @param[in] fontDescription A font description.
432    * @param[out] sizes A list of the available sizes, if no sizes available will return empty.
433    */
434   void GetFixedSizes(const FontDescription&         fontDescription,
435                      Dali::Vector<PointSize26Dot6>& sizes);
436
437   /**
438    * @brief Whether the font has Italic style.
439    *
440    * @param[in] fontId The font identifier.
441    *
442    * @return true if the font has italic style.
443    */
444   bool HasItalicStyle(FontId fontId) const;
445
446   ////////////////////////////////////////
447   // Font metrics, glyphs and bitmaps.
448   ////////////////////////////////////////
449
450   /**
451    * @brief Query the metrics for a font.
452    *
453    * @param[in] fontId The identifier of the font for the required glyph.
454    * @param[out] metrics The font metrics.
455    */
456   void GetFontMetrics(FontId fontId, FontMetrics& metrics);
457
458   /**
459    * @brief Retrieve the glyph index for a UTF-32 character code.
460    *
461    * @param[in] fontId The identifier of the font for the required glyph.
462    * @param[in] charcode The UTF-32 character code.
463    *
464    * @return The glyph index, or zero if the character code is undefined.
465    */
466   GlyphIndex GetGlyphIndex(FontId fontId, Character charcode);
467
468   /**
469    * @brief Return the glyph index of a given character code as modified by the variation selector.
470    *
471    * @param[in] fontId The identifier of the font for the required glyph.
472    * @param[in] charcode The UTF-32 character code.
473    * @param[in] variantSelector The UTF-32 character code point of the variation selector.
474    *
475    * @return The glyph index, or zero if the character code is undefined.
476    */
477   GlyphIndex GetGlyphIndex(FontId fontId, Character charcode, Character variantSelector);
478
479   /**
480    * @brief Retrieve the metrics for a series of glyphs.
481    *
482    * @param[in,out] array An array of glyph-info structures with initialized FontId & GlyphIndex values.
483    *                      It may contain the advance and an offset set into the bearing from the shaping tool.
484    *                      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.
485    * @param[in] size The size of the array.
486    * @param[in] type The type of glyphs used for rendering; either bitmaps or vectors.
487    * @param[in] horizontal True for horizontal layouts (set to false for vertical layouting).
488    *
489    * @return @e true if all of the requested metrics were found.
490    */
491   bool GetGlyphMetrics(GlyphInfo* array, uint32_t size, GlyphType type, bool horizontal = true);
492
493   /**
494    * @brief Create a bitmap representation of a glyph.
495    *
496    * @note The caller is responsible for deallocating the bitmap data @p data.buffer using delete[].
497    *
498    * @param[in]  fontId           The identifier of the font.
499    * @param[in]  glyphIndex       The index of a glyph within the specified font.
500    * @param[in]  isItalicRequired Whether the glyph requires italic style.
501    * @param[in]  isBoldRequired   Whether the glyph requires bold style.
502    * @param[out] data             The bitmap data.
503    * @param[in]  outlineWidth     The width of the glyph outline in pixels.
504    */
505   void CreateBitmap(FontId fontId, GlyphIndex glyphIndex, bool isItalicRequired, bool isBoldRequired, GlyphBufferData& data, int outlineWidth);
506
507   /**
508    * @brief Create a bitmap representation of a glyph.
509    *
510    * @param[in] fontId The identifier of the font.
511    * @param[in] glyphIndex The index of a glyph within the specified font.
512    * @param[in] outlineWidth The width of the glyph outline in pixels.
513    *
514    * @return A valid PixelData, or an empty handle if the glyph could not be rendered.
515    */
516   PixelData CreateBitmap(FontId fontId, GlyphIndex glyphIndex, int outlineWidth);
517
518   /**
519    * @brief Create a vector representation of a glyph.
520    *
521    * @note This feature requires highp shader support and is not available on all platforms
522    * @param[in] fontId The identifier of the font.
523    * @param[in] glyphIndex The index of a glyph within the specified font.
524    * @param[out] blob A blob of data; this is owned by FontClient and should be copied by the caller of CreateVectorData().
525    * @param[out] blobLength The length of the blob data, or zero if the blob creation failed.
526    * @param[out] nominalWidth The width of the blob.
527    * @param[out] nominalHeight The height of the blob.
528    */
529   void CreateVectorBlob(FontId        fontId,
530                         GlyphIndex    glyphIndex,
531                         VectorBlob*&  blob,
532                         unsigned int& blobLength,
533                         unsigned int& nominalWidth,
534                         unsigned int& nominalHeight);
535
536   /**
537    * @brief Retrieves the ellipsis glyph for a requested point size.
538    *
539    * @param[in] requestedPointSize The requested point size.
540    *
541    * @return The ellipsis glyph.
542    */
543   const GlyphInfo& GetEllipsisGlyph(PointSize26Dot6 requestedPointSize);
544
545   /**
546    * @brief Whether the given glyph @p glyphIndex is a color glyph.
547    *
548    * @param[in] fontId The font id.
549    * @param[in] glyphIndex The glyph index.
550    *
551    * @return @e true if the glyph is a color one.
552    */
553   bool IsColorGlyph(FontId fontId, GlyphIndex glyphIndex);
554
555   /**
556    * @brief  Add custom fonts directory
557    *
558    * @param[in] path to the fonts directory
559    *
560    * @return true if the fonts can be added.
561    */
562   bool AddCustomFontDirectory(const FontPath& path);
563
564   /**
565    * @brief Creates and stores an embedded item and it's metrics.
566    *
567    * If in the @p description there is a non empty url, it calls Dali::LoadImageFromFile() internally.
568    * 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.
569    * If the url in the @p description is empty it stores the size.
570    *
571    * @param[in] description The description of the embedded item.
572    * @param[out] pixelFormat The pixel format of the image.
573    *
574    * return The index within the vector of embedded items.
575    */
576   GlyphIndex CreateEmbeddedItem(const EmbeddedItemDescription& description, Pixel::Format& pixelFormat);
577
578   /**
579    * @brief true to enable Atlas-Limitation.
580    *
581    * @note Used default configuration.
582    * @param[in] enabled The on/off value to enable/disable Atlas-Limitation.
583    */
584   void EnableAtlasLimitation(bool enabled);
585
586   /**
587    * @brief Check Atlas-Limitation is enabled or disabled.
588    *
589    * @note Used default configuration.
590    * return true if Atlas-Limitation is enabled, otherwise false.
591    */
592   bool IsAtlasLimitationEnabled() const;
593
594   /**
595    * @brief retrieve the maximum allowed width and height for text-atlas-block.
596    *
597    * @note Used default configuration.
598    * return the maximum width and height of text-atlas-block.
599    */
600   Size GetMaximumTextAtlasSize() const;
601
602   /**
603    * @brief retrieve the default width and height for text-atlas-block.
604    *
605    * @note Used default configuration.
606    * return the default width and height of text-atlas-block.
607    */
608   Size GetDefaultTextAtlasSize() const;
609
610   /**
611    * @brief retrieve the current maximum width and height for text-atlas-block.
612    *
613    * @note Used default configuration.
614    * return the current maximum width and height of text-atlas-block.
615    */
616   Size GetCurrentMaximumBlockSizeFitInAtlas() const;
617
618   /**
619    * @brief set the achieved size (width and height) for text-atlas-block.
620    * If @p currentMaximumBlockSizeFitInAtlas larger than the current maximum text atlas then store, otherwise ignore.
621    *
622    * @note Used default configuration.
623    * return true if the current maximum text atlas size is changed, otherwise false.
624    */
625   bool SetCurrentMaximumBlockSizeFitInAtlas(const Size& currentMaximumBlockSizeFitInAtlas);
626
627   /**
628    * @brief retrieve the number of points to scale-up one unit of point-size.
629    *
630    * @note Used default configuration.
631    * return the number of points per one unit of point-size
632    */
633   uint32_t GetNumberOfPointsPerOneUnitOfPointSize() const;
634
635 public: // Not intended for application developers
636   /**
637    * @brief This constructor is used by FontClient::Get().
638    *
639    * @param[in] fontClient  A pointer to the internal fontClient object.
640    */
641   explicit DALI_INTERNAL FontClient(Internal::FontClient* fontClient);
642 };
643
644 /**
645  * @brief This is used to improve application launch performance
646  *
647  * @return A pre-initialized FontClient
648  */
649 DALI_ADAPTOR_API FontClient FontClientPreInitialize();
650
651 /**
652  * @brief This is used to pre-cache fonts in order to improve the runtime performance of the application.
653  *
654  * @param[in] fallbackFamilyList A list of fallback font families to be pre-cached.
655  * @param[in] extraFamilyList A list of additional font families to be pre-cached.
656  * @param[in] localeFamily A locale font family to be pre-cached.
657  * @param[in] useThread True if the font client should create thread and perform pre-caching, false otherwise.
658  */
659 DALI_ADAPTOR_API void FontClientPreCache(const FontFamilyList& fallbackFamilyList, const FontFamilyList& extraFamilyList, const FontFamily& localeFamily, bool useThread);
660
661 } // namespace TextAbstraction
662
663 } // namespace Dali
664
665 #endif // DALI_PLATFORM_TEXT_ABSTRACTION_FONT_CLIENT_H