1484ecfb396d06db0b7e4f211314c663ca19fecc
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / FontClient.cs
1 /*
2  * Copyright(c) 2017 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 namespace Tizen.NUI
18 {
19     /// <summary>
20     /// FontClient provides access to font information and resources.
21     /// </summary>
22     /// <since_tizen> 5 </since_tizen>
23     public class FontClient : BaseHandle
24     {
25
26         private static readonly FontClient instance = FontClient.Get();
27         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
28
29         internal FontClient(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.FontClient.FontClient_SWIGUpcast(cPtr), cMemoryOwn)
30         {
31             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
32         }
33
34         internal FontClient() : this(Interop.FontClient.new_FontClient__SWIG_0(), true)
35         {
36             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
37         }
38
39         internal FontClient(FontClient handle) : this(Interop.FontClient.new_FontClient__SWIG_1(FontClient.getCPtr(handle)), true)
40         {
41             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
42         }
43
44         internal static uint DefaultPointSize
45         {
46             get
47             {
48                 uint ret = Interop.FontClient.FontClient_DEFAULT_POINT_SIZE_get();
49                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
50                 return ret;
51             }
52         }
53
54         /// <summary>
55         /// Gets the singleton pattern of the FontClient object.
56         /// </summary>
57         /// <since_tizen> 5 </since_tizen>
58         public static FontClient Instance
59         {
60             get
61             {
62                 return instance;
63             }
64         }
65
66         /// <summary>
67         /// Called when the user changes the system defaults.
68         /// </summary>
69         /// <since_tizen> 5 </since_tizen>
70         public void ResetSystemDefaults()
71         {
72             Interop.FontClient.FontClient_ResetSystemDefaults(swigCPtr);
73             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
74         }
75
76         /// <summary>
77         /// Retrieves the font point size of a given font id.
78         /// </summary>
79         /// <param name="id">The font identifier.</param>
80         /// <returns>The point size in 26.6 fractional points.</returns>
81         /// <since_tizen> 5 </since_tizen>
82         public uint GetPointSize(uint id)
83         {
84             uint ret = Interop.FontClient.FontClient_GetPointSize(swigCPtr, id);
85             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
86             return ret;
87         }
88
89         /// <summary>
90         /// Whether the given character is supported by the font.
91         /// </summary>
92         /// <param name="fontId">The id of the font.</param>
93         /// <param name="character">The character in a font.</param>
94         /// <returns>True if the character is supported by the font.</returns>
95         /// <since_tizen> 5 </since_tizen>
96         public bool IsCharacterSupportedByFont(uint fontId, uint character)
97         {
98             bool ret = Interop.FontClient.FontClient_IsCharacterSupportedByFont(swigCPtr, fontId, character);
99             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
100             return ret;
101         }
102
103         /// <summary>
104         /// Finds the default font for displaying a UTF-32 character.
105         /// </summary>
106         /// <param name="charcode">The character for which a font is needed.</param>
107         /// <param name="requestedPointSize">The point size in 26.6 fractional points. The default point size is 12*64.</param>
108         /// <param name="preferColor">True if a color font is preferred.</param>
109         /// <returns>A valid font identifier. Zero if the font does not exist.</returns>
110         /// <since_tizen> 5 </since_tizen>
111         public uint FindDefaultFont(uint charcode, uint requestedPointSize, bool preferColor)
112         {
113             uint ret = Interop.FontClient.FontClient_FindDefaultFont__SWIG_0(swigCPtr, charcode, requestedPointSize, preferColor);
114             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
115             return ret;
116         }
117
118         /// <summary>
119         /// Find the default font for displaying a UTF-32 character.
120         /// </summary>
121         /// <param name="charcode">The character for which a font is needed.</param>
122         /// <param name="requestedPointSize">The point size in 26.6 fractional points. The default point size is 12*64.</param>
123         /// <returns>A valid font identifier. Zero if the font does not exist.</returns>
124         /// <since_tizen> 5 </since_tizen>
125         public uint FindDefaultFont(uint charcode, uint requestedPointSize)
126         {
127             uint ret = Interop.FontClient.FontClient_FindDefaultFont__SWIG_1(swigCPtr, charcode, requestedPointSize);
128             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
129             return ret;
130         }
131
132         /// <summary>
133         /// Find the default font for displaying a UTF-32 character.
134         /// </summary>
135         /// <param name="charcode">The character for which a font is needed.</param>
136         /// <returns>A valid font identifier. Zero if the font does not exist.</returns>
137         /// <since_tizen> 5 </since_tizen>
138         public uint FindDefaultFont(uint charcode)
139         {
140             uint ret = Interop.FontClient.FontClient_FindDefaultFont__SWIG_2(swigCPtr, charcode);
141             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
142             return ret;
143         }
144
145         /// <summary>
146         /// Retrieve the unique identifier for a font.
147         /// </summary>
148         /// <param name="path">The path to a font file.</param>
149         /// <param name="requestedPointSize">The point size in 26.6 fractional points. The default point size is 12*64.</param>
150         /// <param name="faceIndex">The index of the font face.</param>
151         /// <returns>A valid font identifier. Zero if the font does not exist.</returns>
152         /// <since_tizen> 5 </since_tizen>
153         public uint GetFontId(string path, uint requestedPointSize, uint faceIndex)
154         {
155             uint ret = Interop.FontClient.FontClient_GetFontId__SWIG_0(swigCPtr, path, requestedPointSize, faceIndex);
156             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
157             return ret;
158         }
159
160         /// <summary>
161         /// Retrieve the unique identifier for a font.
162         /// </summary>
163         /// <param name="path">The path to a font file.</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 GetFontId(string path, uint requestedPointSize)
168         {
169             uint ret = Interop.FontClient.FontClient_GetFontId__SWIG_1(swigCPtr, path, requestedPointSize);
170             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
171             return ret;
172         }
173
174         /// <summary>
175         /// Retrieve the unique identifier for a font.
176         /// </summary>
177         /// <param name="path">The path to a font file.</param>
178         /// <returns>A valid font identifier. Zero if the font does not exist.</returns>
179         /// <since_tizen> 5 </since_tizen>
180         public uint GetFontId(string path)
181         {
182             uint ret = Interop.FontClient.FontClient_GetFontId__SWIG_2(swigCPtr, path);
183             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
184             return ret;
185         }
186
187         /// <summary>
188         /// Check to see if a font is scalable.
189         /// </summary>
190         /// <param name="path">The path where the font file is located.</param>
191         /// <returns>True if scalable.</returns>
192         /// <since_tizen> 5 </since_tizen>
193         public bool IsScalable(string path)
194         {
195             bool ret = Interop.FontClient.FontClient_IsScalable__SWIG_0(swigCPtr, path);
196             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
197             return ret;
198         }
199
200         /// <summary>
201         /// Adds custom fonts directory.
202         /// </summary>
203         /// <param name="path">Path to the fonts directory.</param>
204         /// <returns>True if the fonts can be added.</returns>
205         /// <since_tizen> 5 </since_tizen>
206         public bool AddCustomFontDirectory(string path)
207         {
208             bool ret = Interop.FontClient.FontClient_AddCustomFontDirectory(swigCPtr, path);
209             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
210             return ret;
211         }
212
213         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(FontClient obj)
214         {
215             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
216         }
217
218         internal static FontClient Get()
219         {
220             FontClient ret = new FontClient(Interop.FontClient.FontClient_Get(), true);
221             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
222             return ret;
223         }
224
225         internal FontClient Assign(FontClient handle)
226         {
227             FontClient ret = new FontClient(Interop.FontClient.FontClient_Assign(swigCPtr, FontClient.getCPtr(handle)), false);
228             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
229             return ret;
230         }
231
232         internal void SetDpi(uint horizontalDpi, uint verticalDpi)
233         {
234             Interop.FontClient.FontClient_SetDpi(swigCPtr, horizontalDpi, verticalDpi);
235             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
236         }
237
238         internal void GetDpi(SWIGTYPE_p_unsigned_int horizontalDpi, SWIGTYPE_p_unsigned_int verticalDpi)
239         {
240             Interop.FontClient.FontClient_GetDpi(swigCPtr, SWIGTYPE_p_unsigned_int.getCPtr(horizontalDpi), SWIGTYPE_p_unsigned_int.getCPtr(verticalDpi));
241             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
242         }
243
244         internal int GetDefaultFontSize()
245         {
246             int ret = Interop.FontClient.FontClient_GetDefaultFontSize(swigCPtr);
247             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
248             return ret;
249         }
250
251         internal void GetDefaultFonts(SWIGTYPE_p_std__vectorT_Dali__TextAbstraction__FontDescription_t defaultFonts)
252         {
253             Interop.FontClient.FontClient_GetDefaultFonts(swigCPtr, SWIGTYPE_p_std__vectorT_Dali__TextAbstraction__FontDescription_t.getCPtr(defaultFonts));
254             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
255         }
256
257         internal void GetDefaultPlatformFontDescription(FontDescription fontDescription)
258         {
259             Interop.FontClient.FontClient_GetDefaultPlatformFontDescription(swigCPtr, FontDescription.getCPtr(fontDescription));
260             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
261         }
262
263         internal void GetSystemFonts(SWIGTYPE_p_std__vectorT_Dali__TextAbstraction__FontDescription_t systemFonts)
264         {
265             Interop.FontClient.FontClient_GetSystemFonts(swigCPtr, SWIGTYPE_p_std__vectorT_Dali__TextAbstraction__FontDescription_t.getCPtr(systemFonts));
266             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
267         }
268
269         internal void GetDescription(uint id, FontDescription fontDescription)
270         {
271             Interop.FontClient.FontClient_GetDescription(swigCPtr, id, FontDescription.getCPtr(fontDescription));
272             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
273         }
274
275         internal uint FindFallbackFont(uint charcode, FontDescription preferredFontDescription, uint requestedPointSize, bool preferColor)
276         {
277             uint ret = Interop.FontClient.FontClient_FindFallbackFont__SWIG_0(swigCPtr, charcode, FontDescription.getCPtr(preferredFontDescription), requestedPointSize, preferColor);
278             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
279             return ret;
280         }
281
282         internal uint FindFallbackFont(uint charcode, FontDescription preferredFontDescription, uint requestedPointSize)
283         {
284             uint ret = Interop.FontClient.FontClient_FindFallbackFont__SWIG_1(swigCPtr, charcode, FontDescription.getCPtr(preferredFontDescription), requestedPointSize);
285             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
286             return ret;
287         }
288
289         internal uint FindFallbackFont(uint charcode, FontDescription preferredFontDescription)
290         {
291             uint ret = Interop.FontClient.FontClient_FindFallbackFont__SWIG_2(swigCPtr, charcode, FontDescription.getCPtr(preferredFontDescription));
292             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
293             return ret;
294         }
295
296         internal uint GetFontId(FontDescription preferredFontDescription, uint requestedPointSize, uint faceIndex)
297         {
298             uint ret = Interop.FontClient.FontClient_GetFontId__SWIG_3(swigCPtr, FontDescription.getCPtr(preferredFontDescription), requestedPointSize, faceIndex);
299             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
300             return ret;
301         }
302
303         internal uint GetFontId(FontDescription preferredFontDescription, uint requestedPointSize)
304         {
305             uint ret = Interop.FontClient.FontClient_GetFontId__SWIG_4(swigCPtr, FontDescription.getCPtr(preferredFontDescription), requestedPointSize);
306             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
307             return ret;
308         }
309
310         internal uint GetFontId(FontDescription preferredFontDescription)
311         {
312             uint ret = Interop.FontClient.FontClient_GetFontId__SWIG_5(swigCPtr, FontDescription.getCPtr(preferredFontDescription));
313             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
314             return ret;
315         }
316
317         internal bool IsScalable(FontDescription fontDescription)
318         {
319             bool ret = Interop.FontClient.FontClient_IsScalable__SWIG_1(swigCPtr, FontDescription.getCPtr(fontDescription));
320             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
321             return ret;
322         }
323
324         internal void GetFixedSizes(string path, SWIGTYPE_p_Dali__VectorT_uint32_t_TypeTraitsT_uint32_t_t__IS_TRIVIAL_TYPE__true_t sizes)
325         {
326             Interop.FontClient.FontClient_GetFixedSizes__SWIG_0(swigCPtr, path, SWIGTYPE_p_Dali__VectorT_uint32_t_TypeTraitsT_uint32_t_t__IS_TRIVIAL_TYPE__true_t.getCPtr(sizes));
327             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
328         }
329
330         internal void GetFixedSizes(FontDescription fontDescription, SWIGTYPE_p_Dali__VectorT_uint32_t_TypeTraitsT_uint32_t_t__IS_TRIVIAL_TYPE__true_t sizes)
331         {
332             Interop.FontClient.FontClient_GetFixedSizes__SWIG_1(swigCPtr, FontDescription.getCPtr(fontDescription), SWIGTYPE_p_Dali__VectorT_uint32_t_TypeTraitsT_uint32_t_t__IS_TRIVIAL_TYPE__true_t.getCPtr(sizes));
333             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
334         }
335
336         internal void GetFontMetrics(uint fontId, FontMetrics metrics)
337         {
338             Interop.FontClient.FontClient_GetFontMetrics(swigCPtr, fontId, FontMetrics.getCPtr(metrics));
339             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
340         }
341
342         internal uint GetGlyphIndex(uint fontId, uint charcode)
343         {
344             uint ret = Interop.FontClient.FontClient_GetGlyphIndex(swigCPtr, fontId, charcode);
345             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
346             return ret;
347         }
348
349         internal bool GetGlyphMetrics(GlyphInfo array, uint size, GlyphType type, bool horizontal)
350         {
351             bool ret = Interop.FontClient.FontClient_GetGlyphMetrics__SWIG_0(swigCPtr, GlyphInfo.getCPtr(array), size, (int)type, horizontal);
352             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
353             return ret;
354         }
355
356         internal bool GetGlyphMetrics(GlyphInfo array, uint size, GlyphType type)
357         {
358             bool ret = Interop.FontClient.FontClient_GetGlyphMetrics__SWIG_1(swigCPtr, GlyphInfo.getCPtr(array), size, (int)type);
359             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
360             return ret;
361         }
362
363         internal void CreateBitmap(uint fontId, uint glyphIndex, bool softwareItalic, bool softwareBold, FontClient.GlyphBufferData data, int outlineWidth)
364         {
365             Interop.FontClient.FontClient_CreateBitmap__SWIG_0(swigCPtr, fontId, glyphIndex, softwareItalic, softwareBold, FontClient.GlyphBufferData.getCPtr(data), outlineWidth);
366             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
367         }
368
369         internal PixelData CreateBitmap(uint fontId, uint glyphIndex, int outlineWidth)
370         {
371             PixelData ret = new PixelData(Interop.FontClient.FontClient_CreateBitmap__SWIG_1(swigCPtr, fontId, glyphIndex, outlineWidth), true);
372             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
373             return ret;
374         }
375
376         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)
377         {
378             Interop.FontClient.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));
379             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
380         }
381
382         internal GlyphInfo GetEllipsisGlyph(uint requestedPointSize)
383         {
384             GlyphInfo ret = new GlyphInfo(Interop.FontClient.FontClient_GetEllipsisGlyph(swigCPtr, requestedPointSize), false);
385             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
386             return ret;
387         }
388
389         internal bool IsColorGlyph(uint fontId, uint glyphIndex)
390         {
391             bool ret = Interop.FontClient.FontClient_IsColorGlyph(swigCPtr, fontId, glyphIndex);
392             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
393             return ret;
394         }
395
396         internal class GlyphBufferData : global::System.IDisposable
397         {
398             protected bool swigCMemOwn;
399             /// <summary>
400             /// A Flat to check if it is already disposed.
401             /// </summary>
402             protected bool disposed = false;
403
404             private global::System.Runtime.InteropServices.HandleRef swigCPtr;
405             //A Flag to check who called Dispose(). (By User or DisposeQueue)
406             private bool isDisposeQueued = false;
407
408             public GlyphBufferData() : this(Interop.FontClient.new_FontClient_GlyphBufferData(), true)
409             {
410                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
411             }
412
413             internal GlyphBufferData(global::System.IntPtr cPtr, bool cMemoryOwn)
414             {
415                 swigCMemOwn = cMemoryOwn;
416                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
417             }
418
419             ~GlyphBufferData()
420             {
421                 if (!isDisposeQueued)
422                 {
423                     isDisposeQueued = true;
424                     DisposeQueue.Instance.Add(this);
425                 }
426             }
427
428             /*public byte[] Buffer
429             {
430                 set
431                 {
432                     Interop.FontClient.FontClient_GlyphBufferData_buffer_set(swigCPtr, value);
433                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
434                 }
435                 get
436                 {
437                     global::System.IntPtr cPtr = Interop.FontClient.FontClient_GlyphBufferData_buffer_get(swigCPtr);
438                     SWIGTYPE_p_unsigned_char ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_unsigned_char(cPtr, false);
439                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
440                     return ret;
441                 }
442             }*/
443
444             public uint Width
445             {
446                 set
447                 {
448                     Interop.FontClient.FontClient_GlyphBufferData_width_set(swigCPtr, value);
449                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
450                 }
451                 get
452                 {
453                     uint ret = Interop.FontClient.FontClient_GlyphBufferData_width_get(swigCPtr);
454                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
455                     return ret;
456                 }
457             }
458
459             public uint Height
460             {
461                 set
462                 {
463                     Interop.FontClient.FontClient_GlyphBufferData_height_set(swigCPtr, value);
464                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
465                 }
466                 get
467                 {
468                     uint ret = Interop.FontClient.FontClient_GlyphBufferData_height_get(swigCPtr);
469                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
470                     return ret;
471                 }
472             }
473
474             public PixelFormat Format
475             {
476                 set
477                 {
478                     Interop.FontClient.FontClient_GlyphBufferData_format_set(swigCPtr, (int)value);
479                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
480                 }
481                 get
482                 {
483                     PixelFormat ret = (PixelFormat)Interop.FontClient.FontClient_GlyphBufferData_format_get(swigCPtr);
484                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
485                     return ret;
486                 }
487             }
488
489             public void Dispose()
490             {
491                 //Throw excpetion if Dispose() is called in separate thread.
492                 if (!Window.IsInstalled())
493                 {
494                     throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
495                 }
496
497                 if (isDisposeQueued)
498                 {
499                     Dispose(DisposeTypes.Implicit);
500                 }
501                 else
502                 {
503                     Dispose(DisposeTypes.Explicit);
504                     System.GC.SuppressFinalize(this);
505                 }
506             }
507
508             internal static global::System.Runtime.InteropServices.HandleRef getCPtr(GlyphBufferData obj)
509             {
510                 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
511             }
512
513             protected virtual void Dispose(DisposeTypes type)
514             {
515                 if (disposed)
516                 {
517                     return;
518                 }
519
520                 if (type == DisposeTypes.Explicit)
521                 {
522                     //Called by User.
523                     //Release your own managed resources here.
524                     //You should release all of your own disposable objects here.
525                 }
526
527                 //Release your own unmanaged resources here.
528                 //You should not access any managed member here except static instance.
529                 //Because the execution order of Finalizes is non-deterministic.
530
531                 if (swigCPtr.Handle != global::System.IntPtr.Zero)
532                 {
533                     if (swigCMemOwn)
534                     {
535                         swigCMemOwn = false;
536                         Interop.FontClient.delete_FontClient_GlyphBufferData(swigCPtr);
537                     }
538                     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
539                 }
540                 disposed = true;
541             }
542         }
543     }
544 }