[NUI] Resolve many problems relative with BaseHandle
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Utility / FontClient.cs
1 /*
2  * Copyright(c) 2021 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 using System.ComponentModel;
18 using System.Collections.Generic;
19 using Tizen.NUI.BaseComponents;
20 using Tizen.NUI.Text;
21
22 namespace Tizen.NUI
23 {
24     /// <summary>
25     /// FontClient provides access to font information and resources.
26     /// </summary>
27     /// <since_tizen> 5 </since_tizen>
28     public class FontClient : BaseHandle
29     {
30         private static readonly FontClient instance = FontClient.Get();
31
32         internal FontClient(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
33         {
34         }
35
36         internal FontClient() : this(Interop.FontClient.NewFontClient(), true)
37         {
38             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
39         }
40
41         internal static uint DefaultPointSize
42         {
43             get
44             {
45                 uint ret = Interop.FontClient.DefaultPointSizeGet();
46                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
47                 return ret;
48             }
49         }
50
51         /// <summary>
52         /// Gets the singleton pattern of the FontClient object.
53         /// </summary>
54         /// <since_tizen> 5 </since_tizen>
55         public static FontClient Instance
56         {
57             get
58             {
59                 return instance;
60             }
61         }
62
63         /// <summary>
64         /// This is used to pre-cache FontConfig in order to improve the runtime performance of the application.
65         /// </summary>
66         /// <param name="fallbackFamilyList">A list of fallback font families to be pre-cached.</param>
67         /// <param name="extraFamilyList">A list of additional font families to be pre-cached.</param>
68         /// <param name="localeFamily">A locale font family to be pre-cached.</param>
69         /// <param name="useThread">True if the font client should create thread and perform pre-caching, false otherwise.</param>
70         /// <param name="syncCreation">True if thread creation guarantees syncronization with the main thread, false async creation. Optional, the default value is true.</param>
71         [EditorBrowsable(EditorBrowsableState.Never)]
72         public static void PreCache(List<string> fallbackFamilyList, List<string> extraFamilyList, string localeFamily, bool useThread, bool syncCreation = true)
73         {
74             int fallbackFamilySize = fallbackFamilyList?.Count ?? 0;
75             int extraFamilySize = extraFamilyList?.Count ?? 0;
76             string[] fallbackFamilyArray = fallbackFamilySize > 0 ? fallbackFamilyList.ToArray() : null;
77             string[] extraFamilyArray = extraFamilySize > 0 ? extraFamilyList.ToArray() : null;
78
79             Interop.FontClient.PreCache(fallbackFamilyArray, fallbackFamilySize, extraFamilyArray, extraFamilySize, localeFamily, useThread, syncCreation);
80             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
81         }
82
83         /// <summary>
84         /// This is used to pre-load FreeType font face in order to improve the runtime performance of the application.
85         /// <note>
86         /// The fonts in the fontPathList perform FT_New_Face during pre-loading, which can provide some performace benefits.<br />
87         /// The fonts in the memoryFontPathList read the font file and cache the buffer in memory during pre-load.<br />
88         /// This enables the use of FT_New_Memory_Face during runtime and provides a performance boost.<br />
89         /// It requires memory equivalent to the size of each font file.
90         /// </note>
91         /// </summary>
92         /// <param name="fontPathList">A list of font paths to be pre-loaded.</param>
93         /// <param name="memoryFontPathList">A list of memory font paths to be pre-loaded.</param>
94         /// <param name="useThread">True if the font client should create thread and perform font pre-loading, false otherwise.</param>
95         /// <param name="syncCreation">True if thread creation guarantees syncronization with the main thread, false async creation. Optional, the default value is true.</param>
96         [EditorBrowsable(EditorBrowsableState.Never)]
97         public static void FontPreLoad(List<string> fontPathList, List<string> memoryFontPathList, bool useThread, bool syncCreation = true)
98         {
99             int fontPathSize = fontPathList?.Count ?? 0;
100             int memoryFontPathSize = memoryFontPathList?.Count ?? 0;
101             string[] fontPathArray = fontPathSize > 0 ? fontPathList.ToArray() : null;
102             string[] memoryFontPathArray = memoryFontPathSize > 0 ? memoryFontPathList.ToArray() : null;
103
104             Interop.FontClient.FontPreLoad(fontPathArray, fontPathSize, memoryFontPathArray, memoryFontPathSize, useThread, syncCreation);
105             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
106         }
107
108         /// <summary>
109         /// Called when the user changes the system defaults.
110         /// </summary>
111         /// <since_tizen> 5 </since_tizen>
112         public void ResetSystemDefaults()
113         {
114             Interop.FontClient.ResetSystemDefaults(SwigCPtr);
115             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
116         }
117
118         /// <summary>
119         /// Retrieves the font point size of a given font id.
120         /// </summary>
121         /// <param name="id">The font identifier.</param>
122         /// <returns>The point size in 26.6 fractional points.</returns>
123         /// <since_tizen> 5 </since_tizen>
124         public uint GetPointSize(uint id)
125         {
126             uint ret = Interop.FontClient.GetPointSize(SwigCPtr, id);
127             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
128             return ret;
129         }
130
131         /// <summary>
132         /// Whether the given character is supported by the font.
133         /// </summary>
134         /// <param name="fontId">The id of the font.</param>
135         /// <param name="character">The character in a font.</param>
136         /// <returns>True if the character is supported by the font.</returns>
137         /// <since_tizen> 5 </since_tizen>
138         public bool IsCharacterSupportedByFont(uint fontId, uint character)
139         {
140             bool ret = Interop.FontClient.IsCharacterSupportedByFont(SwigCPtr, fontId, character);
141             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
142             return ret;
143         }
144
145         /// <summary>
146         /// Finds the default font for displaying a UTF-32 character.
147         /// </summary>
148         /// <param name="charcode">The character for which a font is needed.</param>
149         /// <param name="requestedPointSize">The point size in 26.6 fractional points. The default point size is 12*64.</param>
150         /// <param name="preferColor">True if a color font is preferred.</param>
151         /// <returns>A valid font identifier. Zero if the font does not exist.</returns>
152         /// <since_tizen> 5 </since_tizen>
153         public uint FindDefaultFont(uint charcode, uint requestedPointSize, bool preferColor)
154         {
155             uint ret = Interop.FontClient.FindDefaultFont(SwigCPtr, charcode, requestedPointSize, preferColor);
156             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
157             return ret;
158         }
159
160         /// <summary>
161         /// Find the default font for displaying a UTF-32 character.
162         /// </summary>
163         /// <param name="charcode">The character for which a font is needed.</param>
164         /// <param name="requestedPointSize">The point size in 26.6 fractional points. The default point size is 12*64.</param>
165         /// <returns>A valid font identifier. Zero if the font does not exist.</returns>
166         /// <since_tizen> 5 </since_tizen>
167         public uint FindDefaultFont(uint charcode, uint requestedPointSize)
168         {
169             uint ret = Interop.FontClient.FindDefaultFont(SwigCPtr, charcode, requestedPointSize);
170             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
171             return ret;
172         }
173
174         /// <summary>
175         /// Find the default font for displaying a UTF-32 character.
176         /// </summary>
177         /// <param name="charcode">The character for which a font is needed.</param>
178         /// <returns>A valid font identifier. Zero if the font does not exist.</returns>
179         /// <since_tizen> 5 </since_tizen>
180         public uint FindDefaultFont(uint charcode)
181         {
182             uint ret = Interop.FontClient.FindDefaultFont(SwigCPtr, charcode);
183             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
184             return ret;
185         }
186
187         /// <summary>
188         /// Retrieve the unique identifier for a font.
189         /// </summary>
190         /// <param name="path">The path to a font file.</param>
191         /// <param name="requestedPointSize">The point size in 26.6 fractional points. The default point size is 12*64.</param>
192         /// <param name="faceIndex">The index of the font face.</param>
193         /// <returns>A valid font identifier. Zero if the font does not exist.</returns>
194         /// <since_tizen> 5 </since_tizen>
195         public uint GetFontId(string path, uint requestedPointSize, uint faceIndex)
196         {
197             uint ret = Interop.FontClient.GetFontId(SwigCPtr, path, requestedPointSize, faceIndex);
198             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
199             return ret;
200         }
201
202         /// <summary>
203         /// Retrieve the unique identifier for a font.
204         /// </summary>
205         /// <param name="path">The path to a font file.</param>
206         /// <param name="requestedPointSize">The point size in 26.6 fractional points. The default point size is 12*64.</param>
207         /// <returns>A valid font identifier. Zero if the font does not exist.</returns>
208         /// <since_tizen> 5 </since_tizen>
209         public uint GetFontId(string path, uint requestedPointSize)
210         {
211             uint ret = Interop.FontClient.GetFontId(SwigCPtr, path, requestedPointSize);
212             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
213             return ret;
214         }
215
216         /// <summary>
217         /// Retrieve the unique identifier for a font.
218         /// </summary>
219         /// <param name="path">The path to a font file.</param>
220         /// <returns>A valid font identifier. Zero if the font does not exist.</returns>
221         /// <since_tizen> 5 </since_tizen>
222         public uint GetFontId(string path)
223         {
224             uint ret = Interop.FontClient.GetFontId(SwigCPtr, path);
225             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
226             return ret;
227         }
228
229         /// <summary>
230         /// Check to see if a font is scalable.
231         /// </summary>
232         /// <param name="path">The path where the font file is located.</param>
233         /// <returns>True if scalable.</returns>
234         /// <since_tizen> 5 </since_tizen>
235         public bool IsScalable(string path)
236         {
237             bool ret = Interop.FontClient.IsScalable(SwigCPtr, path);
238             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
239             return ret;
240         }
241
242         /// <summary>
243         /// Adds custom fonts directory.
244         /// </summary>
245         /// <param name="path">Path to the fonts directory.</param>
246         /// <returns>True if the fonts can be added.</returns>
247         /// <since_tizen> 5 </since_tizen>
248         public bool AddCustomFontDirectory(string path)
249         {
250             bool ret = Interop.FontClient.AddCustomFontDirectory(SwigCPtr, path);
251             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
252             return ret;
253         }
254
255         /// <summary>
256         /// Retrieve the list of font info supported by the system.
257         /// </summary>
258         /// <returns>The list of FontInfo</returns>
259         /// <remarks>
260         /// <see cref="Tizen.NUI.Text.FontInfo"/>
261         /// </remarks>
262         /// <example>
263         /// The following example demonstrates how to use the GetSystemFonts method.
264         /// <code>
265         /// var fontList = FontClient.Instance.GetSystemFonts();
266         /// foreach(Tizen.NUI.Text.FontInfo fontInfo in fontList)
267         /// {
268         ///    string fontFamily = fontInfo.Family;
269         ///    string fontPath = fontInfo.Path;
270         ///    FontWidthType fontWidth = fontInfo.Style.Width;
271         ///    FontWeightType fontWeight = fontInfo.Style.Weight;
272         ///    FontSlantType fontSlant = fontInfo.Style.Slant;
273         /// }
274         /// </code>
275         /// </example>
276         [EditorBrowsable(EditorBrowsableState.Never)]
277         public List<FontInfo> GetSystemFonts()
278         {
279             using PropertyArray fontArray = new PropertyArray(Interop.FontClient.GetSystemFonts(SwigCPtr), true);
280             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
281
282             List<FontInfo> fontInfoList;
283             fontInfoList = TextUtils.GetFontInfoList(fontArray);
284             return fontInfoList;
285         }
286
287         internal static FontClient Get()
288         {
289             global::System.IntPtr cPtr = Interop.FontClient.Get();
290
291             FontClient ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as FontClient;
292             if (ret != null)
293             {
294                 object dummyObect = new object();
295
296                 global::System.Runtime.InteropServices.HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(dummyObect, cPtr);
297                 Interop.BaseHandle.DeleteBaseHandle(CPtr);
298                 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
299             }
300             else
301             {
302                 ret = new FontClient(cPtr, true);
303             }
304
305             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
306             return ret;
307         }
308
309         internal FontClient Assign(FontClient handle)
310         {
311             FontClient ret = new FontClient(Interop.FontClient.Assign(SwigCPtr, FontClient.getCPtr(handle)), false);
312             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
313             return ret;
314         }
315
316         internal void SetDpi(uint horizontalDpi, uint verticalDpi)
317         {
318             Interop.FontClient.SetDpi(SwigCPtr, horizontalDpi, verticalDpi);
319             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
320         }
321
322         internal void GetDpi(SWIGTYPE_p_unsigned_int horizontalDpi, SWIGTYPE_p_unsigned_int verticalDpi)
323         {
324             Interop.FontClient.GetDpi(SwigCPtr, SWIGTYPE_p_unsigned_int.getCPtr(horizontalDpi), SWIGTYPE_p_unsigned_int.getCPtr(verticalDpi));
325             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
326         }
327
328         internal int GetDefaultFontSize()
329         {
330             int ret = Interop.FontClient.GetDefaultFontSize(SwigCPtr);
331             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
332             return ret;
333         }
334
335         internal void GetDefaultFonts(SWIGTYPE_p_std__vectorT_Dali__TextAbstraction__FontDescription_t defaultFonts)
336         {
337             Interop.FontClient.GetDefaultFonts(SwigCPtr, SWIGTYPE_p_std__vectorT_Dali__TextAbstraction__FontDescription_t.getCPtr(defaultFonts));
338             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
339         }
340
341         internal void GetDefaultPlatformFontDescription(FontDescription fontDescription)
342         {
343             Interop.FontClient.GetDefaultPlatformFontDescription(SwigCPtr, FontDescription.getCPtr(fontDescription));
344             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
345         }
346
347         internal void GetDescription(uint id, FontDescription fontDescription)
348         {
349             Interop.FontClient.GetDescription(SwigCPtr, id, FontDescription.getCPtr(fontDescription));
350             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
351         }
352
353         internal uint FindFallbackFont(uint charcode, FontDescription preferredFontDescription, uint requestedPointSize, bool preferColor)
354         {
355             uint ret = Interop.FontClient.FindFallbackFont(SwigCPtr, charcode, FontDescription.getCPtr(preferredFontDescription), requestedPointSize, preferColor);
356             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
357             return ret;
358         }
359
360         internal uint FindFallbackFont(uint charcode, FontDescription preferredFontDescription, uint requestedPointSize)
361         {
362             uint ret = Interop.FontClient.FindFallbackFont(SwigCPtr, charcode, FontDescription.getCPtr(preferredFontDescription), requestedPointSize);
363             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
364             return ret;
365         }
366
367         internal uint FindFallbackFont(uint charcode, FontDescription preferredFontDescription)
368         {
369             uint ret = Interop.FontClient.FindFallbackFont(SwigCPtr, charcode, FontDescription.getCPtr(preferredFontDescription));
370             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
371             return ret;
372         }
373
374         internal uint GetFontId(FontDescription preferredFontDescription, uint requestedPointSize, uint faceIndex)
375         {
376             uint ret = Interop.FontClient.GetFontId(SwigCPtr, FontDescription.getCPtr(preferredFontDescription), requestedPointSize, faceIndex);
377             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
378             return ret;
379         }
380
381         internal uint GetFontId(FontDescription preferredFontDescription, uint requestedPointSize)
382         {
383             uint ret = Interop.FontClient.GetFontId(SwigCPtr, FontDescription.getCPtr(preferredFontDescription), requestedPointSize);
384             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
385             return ret;
386         }
387
388         internal uint GetFontId(FontDescription preferredFontDescription)
389         {
390             uint ret = Interop.FontClient.GetFontId(SwigCPtr, FontDescription.getCPtr(preferredFontDescription));
391             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
392             return ret;
393         }
394
395         internal bool IsScalable(FontDescription fontDescription)
396         {
397             bool ret = Interop.FontClient.IsScalable(SwigCPtr, FontDescription.getCPtr(fontDescription));
398             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
399             return ret;
400         }
401
402         internal void GetFixedSizes(string path, SWIGTYPE_p_Dali__VectorT_uint32_t_TypeTraitsT_uint32_t_t__IS_TRIVIAL_TYPE__true_t sizes)
403         {
404             Interop.FontClient.GetFixedSizes(SwigCPtr, path, SWIGTYPE_p_Dali__VectorT_uint32_t_TypeTraitsT_uint32_t_t__IS_TRIVIAL_TYPE__true_t.getCPtr(sizes));
405             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
406         }
407
408         internal void GetFixedSizes(FontDescription fontDescription, SWIGTYPE_p_Dali__VectorT_uint32_t_TypeTraitsT_uint32_t_t__IS_TRIVIAL_TYPE__true_t sizes)
409         {
410             Interop.FontClient.GetFixedSizes(SwigCPtr, FontDescription.getCPtr(fontDescription), SWIGTYPE_p_Dali__VectorT_uint32_t_TypeTraitsT_uint32_t_t__IS_TRIVIAL_TYPE__true_t.getCPtr(sizes));
411             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
412         }
413
414         internal void GetFontMetrics(uint fontId, FontMetrics metrics)
415         {
416             Interop.FontClient.GetFontMetrics(SwigCPtr, fontId, FontMetrics.getCPtr(metrics));
417             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
418         }
419
420         internal uint GetGlyphIndex(uint fontId, uint charcode)
421         {
422             uint ret = Interop.FontClient.GetGlyphIndex(SwigCPtr, fontId, charcode);
423             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
424             return ret;
425         }
426
427         internal bool GetGlyphMetrics(GlyphInfo array, uint size, GlyphType type, bool horizontal)
428         {
429             bool ret = Interop.FontClient.GetGlyphMetrics(SwigCPtr, GlyphInfo.getCPtr(array), size, (int)type, horizontal);
430             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
431             return ret;
432         }
433
434         internal bool GetGlyphMetrics(GlyphInfo array, uint size, GlyphType type)
435         {
436             bool ret = Interop.FontClient.GetGlyphMetrics(SwigCPtr, GlyphInfo.getCPtr(array), size, (int)type);
437             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
438             return ret;
439         }
440
441         internal void CreateBitmap(uint fontId, uint glyphIndex, bool softwareItalic, bool softwareBold, FontClient.GlyphBufferData data, int outlineWidth)
442         {
443             Interop.FontClient.CreateBitmap(SwigCPtr, fontId, glyphIndex, softwareItalic, softwareBold, FontClient.GlyphBufferData.getCPtr(data), outlineWidth);
444             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
445         }
446
447         internal PixelData CreateBitmap(uint fontId, uint glyphIndex, int outlineWidth)
448         {
449             PixelData ret = new PixelData(Interop.FontClient.CreateBitmap(SwigCPtr, fontId, glyphIndex, outlineWidth), true);
450             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
451             return ret;
452         }
453
454         internal void CreateVectorBlob(uint fontId, uint glyphIndex, SWIGTYPE_p_p_Dali__TextAbstraction__VectorBlob blob, SWIGTYPE_p_unsigned_int blobLength, SWIGTYPE_p_unsigned_int nominalWidth, SWIGTYPE_p_unsigned_int nominalHeight)
455         {
456             Interop.FontClient.CreateVectorBlob(SwigCPtr, fontId, glyphIndex, SWIGTYPE_p_p_Dali__TextAbstraction__VectorBlob.getCPtr(blob), SWIGTYPE_p_unsigned_int.getCPtr(blobLength), SWIGTYPE_p_unsigned_int.getCPtr(nominalWidth), SWIGTYPE_p_unsigned_int.getCPtr(nominalHeight));
457             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
458         }
459
460         internal GlyphInfo GetEllipsisGlyph(uint requestedPointSize)
461         {
462             GlyphInfo ret = new GlyphInfo(Interop.FontClient.GetEllipsisGlyph(SwigCPtr, requestedPointSize), false);
463             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
464             return ret;
465         }
466
467         internal bool IsColorGlyph(uint fontId, uint glyphIndex)
468         {
469             bool ret = Interop.FontClient.IsColorGlyph(SwigCPtr, fontId, glyphIndex);
470             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
471             return ret;
472         }
473
474         internal class GlyphBufferData : Disposable
475         {
476             public GlyphBufferData() : this(Interop.FontClient.NewFontClientGlyphBufferData(), true)
477             {
478                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
479             }
480
481             internal GlyphBufferData(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
482             {
483             }
484
485             /*public byte[] Buffer
486             {
487                 set
488                 {
489                     Interop.FontClient.GlyphBufferDataBufferSet(swigCPtr, value);
490                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
491                 }
492                 get
493                 {
494                     global::System.IntPtr cPtr = Interop.FontClient.GlyphBufferDataBufferGet(swigCPtr);
495                     SWIGTYPE_p_unsigned_char ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_unsigned_char(cPtr, false);
496                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
497                     return ret;
498                 }
499             }*/
500
501             public uint Width
502             {
503                 set
504                 {
505                     Interop.FontClient.GlyphBufferDataWidthSet(SwigCPtr, value);
506                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
507                 }
508                 get
509                 {
510                     uint ret = Interop.FontClient.GlyphBufferDataWidthGet(SwigCPtr);
511                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
512                     return ret;
513                 }
514             }
515
516             public uint Height
517             {
518                 set
519                 {
520                     Interop.FontClient.GlyphBufferDataHeightSet(SwigCPtr, value);
521                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
522                 }
523                 get
524                 {
525                     uint ret = Interop.FontClient.GlyphBufferDataHeightGet(SwigCPtr);
526                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
527                     return ret;
528                 }
529             }
530
531             public PixelFormat Format
532             {
533                 set
534                 {
535                     Interop.FontClient.GlyphBufferDataFormatSet(SwigCPtr, (int)value);
536                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
537                 }
538                 get
539                 {
540                     PixelFormat ret = (PixelFormat)Interop.FontClient.GlyphBufferDataFormatGet(SwigCPtr);
541                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
542                     return ret;
543                 }
544             }
545
546             /// This will not be public opened.
547             [EditorBrowsable(EditorBrowsableState.Never)]
548             protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
549             {
550                 Interop.FontClient.DeleteFontClientGlyphBufferData(swigCPtr);
551             }
552         }
553     }
554 }