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