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