2 * Copyright(c) 2019 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 internal class FontMetrics : Disposable
21 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
22 protected bool swigCMemOwn;
24 internal FontMetrics(global::System.IntPtr cPtr, bool cMemoryOwn)
26 swigCMemOwn = cMemoryOwn;
27 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
30 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(FontMetrics obj)
32 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
35 protected override void Dispose(DisposeTypes type)
42 //Release your own unmanaged resources here.
43 //You should not access any managed member here except static instance.
44 //because the execution order of Finalizes is non-deterministic.
46 if (swigCPtr.Handle != global::System.IntPtr.Zero)
51 Interop.FontClient.delete_FontMetrics(swigCPtr);
53 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
58 public FontMetrics() : this(Interop.FontClient.new_FontMetrics__SWIG_0(), true)
60 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
63 public FontMetrics(float ascenderPixels, float descenderPixels, float heightPixels, float underlinePositionPixels, float underlinePositionThickness) : this(Interop.FontClient.new_FontMetrics__SWIG_1(ascenderPixels, descenderPixels, heightPixels, underlinePositionPixels, underlinePositionThickness), true)
65 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
72 Interop.FontClient.FontMetrics_ascender_set(swigCPtr, value);
73 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
77 float ret = Interop.FontClient.FontMetrics_ascender_get(swigCPtr);
78 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
83 public float Descender
87 Interop.FontClient.FontMetrics_descender_set(swigCPtr, value);
88 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
92 float ret = Interop.FontClient.FontMetrics_descender_get(swigCPtr);
93 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
102 Interop.FontClient.FontMetrics_height_set(swigCPtr, value);
103 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
107 float ret = Interop.FontClient.FontMetrics_height_get(swigCPtr);
108 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
113 public float UnderlinePosition
117 Interop.FontClient.FontMetrics_underlinePosition_set(swigCPtr, value);
118 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
122 float ret = Interop.FontClient.FontMetrics_underlinePosition_get(swigCPtr);
123 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
128 public float UnderlineThickness
132 Interop.FontClient.FontMetrics_underlineThickness_set(swigCPtr, value);
133 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
137 float ret = Interop.FontClient.FontMetrics_underlineThickness_get(swigCPtr);
138 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();