Relocate the function about Font Variations and enhance its explanation (#6780)
authorChihun Jeong <50663828+ANZ1217@users.noreply.github.com>
Wed, 26 Mar 2025 01:53:17 +0000 (10:53 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Thu, 27 Mar 2025 00:43:29 +0000 (09:43 +0900)
Co-authored-by: ANZ1217 <chihun.jeong@samsung.com>
src/Tizen.NUI/src/internal/Interop/Interop.TextEditor.cs
src/Tizen.NUI/src/internal/Interop/Interop.TextField.cs
src/Tizen.NUI/src/internal/Interop/Interop.TextLabel.cs
src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs
src/Tizen.NUI/src/public/BaseComponents/TextField.cs
src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs

index acdf156697297ccf8bede5b14881103cfad18fce..cf5e35e43132d26fb139b01b461ab566376a286d 100755 (executable)
@@ -343,8 +343,6 @@ namespace Tizen.NUI
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextEditor_Property_REMOVE_BACK_INSET_get")]
             public static extern int RemoveBackInsetGet();
-            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextEditor_Property_FONT_VARIATIONS_get")]
-            public static extern int FontVariationsGet();
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextEditor_RegisterFontVariationProperty")]
             public static extern int RegisterFontVariationProperty(global::System.Runtime.InteropServices.HandleRef textEditorRef, string pTag);
         }
index 17e8b74a2d5f1e2b5807988a1e9779919daa2a56..f5b5646d1479bedba7088f25b259842cbe909a1d 100755 (executable)
@@ -305,8 +305,6 @@ namespace Tizen.NUI
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextField_Property_REMOVE_BACK_INSET_get")]
             public static extern int RemoveBackInsetGet();
-            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextField_Property_FONT_VARIATIONS_get")]
-            public static extern int FontVariationsGet();
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextField_RegisterFontVariationProperty")]
             public static extern int RegisterFontVariationProperty(global::System.Runtime.InteropServices.HandleRef textFieldRef, string pTag);
         }
index f2546eee62f5f0d359f563b11139dcb96655f6eb..d33d861481d89053c67c24d315bc858c35c252b3 100755 (executable)
@@ -208,8 +208,6 @@ namespace Tizen.NUI
 
             [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_ASYNC_LINE_COUNT_get")]
             public static extern int AsyncLineCountGet();
-            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_FONT_VARIATIONS_get")]
-            public static extern int FontVariationsGet();
 
             [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_RequestAsyncRenderWithFixedSize")]
             public static extern void RequestAsyncRenderWithFixedSize(HandleRef textLabelRef, float width, float height);
index 10ec4a106836330693e3a48c7181a2bc9050b292..5e23da92ed3a1dbaf20053bd1336889971b554fd 100755 (executable)
@@ -260,21 +260,6 @@ namespace Tizen.NUI.BaseComponents
             return ThemeManager.GetStyle(this.GetType()) == null ? false : true;
         }
 
-        /// <summary>
-        /// Registers FontVariationsProperty with string tag.
-        /// </summary>
-        /// <param name="tag">The tag of font variations.</param>
-        /// <remarks>
-        /// The returned index can be used with animation.
-        /// </remarks>
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public int RegisterFontVariationProperty(string tag)
-        {
-            int index = Interop.TextEditor.RegisterFontVariationProperty(SwigCPtr, tag);
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return index;
-        }
-
         /// <summary>
         /// The TranslatableText property.<br />
         /// The text can set the SID value.<br />
@@ -4748,6 +4733,57 @@ namespace Tizen.NUI.BaseComponents
             return Object.InternalGetPropertyBool(SwigCPtr, Property.RemoveBackInset);
         }
 
+        /// <summary>
+        /// Registers FontVariationsProperty with string tag.
+        /// </summary>
+        /// <param name="tag">The tag of font variation.</param>
+        /// <returns>The index of the font variation.</returns>
+        /// <remarks>
+        /// The returned index can be used with setting property or animations.
+        /// </remarks>
+        /// <example>
+        /// The following example demonstrates how to use the SetFontStyle method.
+        /// <code>
+        /// TextEditor editor = new TextEditor();
+        /// int index = editor.RegisterFontVariationProperty("wght");
+        /// Animation anim = new Animation(1000);
+        /// anim.AnimateTo(editor, "wght", 900.0f);
+        /// </code>
+        /// </example>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public int RegisterFontVariationProperty(string tag)
+        {
+            int index = Interop.TextEditor.RegisterFontVariationProperty(SwigCPtr, tag);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return index;
+        }
+
+        /// <summary>
+        /// Sets Font Variation with string tag.
+        /// </summary>
+        /// <param name="tag">The tag of font variation.</param>
+        /// <param name="value">The value of font variation.</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetFontVariation(string tag, float value)
+        {
+            int index = RegisterFontVariationProperty(tag);
+            Object.InternalSetPropertyFloat(SwigCPtr, index, value);
+        }
+
+        /// <summary>
+        /// Sets Font Variation with index.
+        /// </summary>
+        /// <param name="index">The index of font variation property.</param>
+        /// <param name="value">The value of font variation.</param>
+        /// <remarks>
+        /// To use the index, RegisterFontVariationProperty must precede it.
+        /// </remarks>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetFontVariation(int index, float value)
+        {
+            Object.InternalSetPropertyFloat(SwigCPtr, index, value);
+        }
+
         /// <summary>
         /// Dispose.
         /// Releases unmanaged and optionally managed resources.
@@ -5062,7 +5098,6 @@ namespace Tizen.NUI.BaseComponents
             internal static readonly int CharacterSpacing = Interop.TextEditor.CharacterSpacingGet();
             internal static readonly int RemoveFrontInset = Interop.TextEditor.RemoveFrontInsetGet();
             internal static readonly int RemoveBackInset = Interop.TextEditor.RemoveBackInsetGet();
-            internal static readonly int FontVariations = Interop.TextEditor.FontVariationsGet();
 
             internal static void Preload()
             {
@@ -5119,15 +5154,6 @@ namespace Tizen.NUI.BaseComponents
         {
             GrabHandleColor = new Color(r, g, b, a);
         }
-        public void SetFontVariation(string axis, float value)
-        {
-            int index = RegisterFontVariationProperty(axis);
-            Object.InternalSetPropertyFloat(SwigCPtr, index, value);
-        }
-        public void SetFontVariation(int index, float value)
-        {
-            Object.InternalSetPropertyFloat(SwigCPtr, index, value);
-        }
 
         internal class TextEditorLayout : LayoutItem
         {
index 97ea6cca8ac413c59cc7596f69f31478200cf220..e1c1e24180238b2994e3be2af842914298289b7f 100755 (executable)
@@ -332,21 +332,6 @@ namespace Tizen.NUI.BaseComponents
             return ThemeManager.GetStyle(this.GetType()) == null ? false : true;
         }
 
-        /// <summary>
-        /// Registers FontVariationsProperty with string tag.
-        /// </summary>
-        /// <param name="tag">The tag of font variations.</param>
-        /// <remarks>
-        /// The returned index can be used with animation.
-        /// </remarks>
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public int RegisterFontVariationProperty(string tag)
-        {
-            int index = Interop.TextField.RegisterFontVariationProperty(SwigCPtr, tag);
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return index;
-        }
-
         /// <summary>
         /// The TranslatableText property.<br />
         /// The text can set the SID value.<br />
@@ -4692,6 +4677,57 @@ namespace Tizen.NUI.BaseComponents
             return Object.InternalGetPropertyBool(SwigCPtr, Property.RemoveBackInset);
         }
 
+        /// <summary>
+        /// Registers FontVariationsProperty with string tag.
+        /// </summary>
+        /// <param name="tag">The tag of font variation.</param>
+        /// <returns>The index of the font variation.</returns>
+        /// <remarks>
+        /// The returned index can be used with setting property or animations.
+        /// </remarks>
+        /// <example>
+        /// The following example demonstrates how to use the SetFontStyle method.
+        /// <code>
+        /// TextField field = new TextField();
+        /// int index = field.RegisterFontVariationProperty("wght");
+        /// Animation anim = new Animation(1000);
+        /// anim.AnimateTo(field, "wght", 900.0f);
+        /// </code>
+        /// </example>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public int RegisterFontVariationProperty(string tag)
+        {
+            int index = Interop.TextField.RegisterFontVariationProperty(SwigCPtr, tag);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return index;
+        }
+
+        /// <summary>
+        /// Sets Font Variation with string tag.
+        /// </summary>
+        /// <param name="tag">The tag of font variation.</param>
+        /// <param name="value">The value of font variation.</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetFontVariation(string tag, float value)
+        {
+            int index = RegisterFontVariationProperty(tag);
+            Object.InternalSetPropertyFloat(SwigCPtr, index, value);
+        }
+
+        /// <summary>
+        /// Sets Font Variation with index.
+        /// </summary>
+        /// <param name="index">The index of font variation property.</param>
+        /// <param name="value">The value of font variation.</param>
+        /// <remarks>
+        /// To use the index, RegisterFontVariationProperty must precede it.
+        /// </remarks>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetFontVariation(int index, float value)
+        {
+            Object.InternalSetPropertyFloat(SwigCPtr, index, value);
+        }
+
         /// <summary>
         /// Dispose.
         /// Releases unmanaged and optionally managed resources.
@@ -5006,7 +5042,6 @@ namespace Tizen.NUI.BaseComponents
             internal static readonly int CharacterSpacing = Interop.TextField.CharacterSpacingGet();
             internal static readonly int RemoveFrontInset = Interop.TextField.RemoveFrontInsetGet();
             internal static readonly int RemoveBackInset = Interop.TextField.RemoveBackInsetGet();
-            internal static readonly int FontVariations = Interop.TextField.FontVariationsGet();
 
             internal static void Preload()
             {
@@ -5070,15 +5105,6 @@ namespace Tizen.NUI.BaseComponents
         {
             GrabHandleColor = new Color(r, g, b, a);
         }
-        public void SetFontVariation(string axis, float value)
-        {
-            int index = RegisterFontVariationProperty(axis);
-            Object.InternalSetPropertyFloat(SwigCPtr, index, value);
-        }
-        public void SetFontVariation(int index, float value)
-        {
-            Object.InternalSetPropertyFloat(SwigCPtr, index, value);
-        }
 
         internal class TextFieldLayout : LayoutItem
         {
index 6ab4a99835100aecff258e54381b380af1f700b7..9e68b390ed3b583b2f0218e60a3bf70486013589 100755 (executable)
@@ -411,21 +411,6 @@ namespace Tizen.NUI.BaseComponents
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
-        /// <summary>
-        /// Registers FontVariationsProperty with string tag.
-        /// </summary>
-        /// <param name="tag">The tag of font variations.</param>
-        /// <remarks>
-        /// The returned index can be used with animation.
-        /// </remarks>
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public int RegisterFontVariationProperty(string tag)
-        {
-            int index = Interop.TextLabel.RegisterFontVariationProperty(SwigCPtr, tag);
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return index;
-        }
-
         /// <summary>
         /// The TranslatableText property.<br />
         /// The text can set the SID value.<br />
@@ -3300,6 +3285,57 @@ namespace Tizen.NUI.BaseComponents
             return ret;
         }
 
+        /// <summary>
+        /// Registers FontVariationsProperty with string tag.
+        /// </summary>
+        /// <param name="tag">The tag of font variation.</param>
+        /// <returns>The index of the font variation.</returns>
+        /// <remarks>
+        /// The returned index can be used with setting property or animations.
+        /// </remarks>
+        /// <example>
+        /// The following example demonstrates how to use the SetFontStyle method.
+        /// <code>
+        /// TextLabel label = new TextLabel();
+        /// int index = label.RegisterFontVariationProperty("wght");
+        /// Animation anim = new Animation(1000);
+        /// anim.AnimateTo(label, "wght", 900.0f);
+        /// </code>
+        /// </example>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public int RegisterFontVariationProperty(string tag)
+        {
+            int index = Interop.TextLabel.RegisterFontVariationProperty(SwigCPtr, tag);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return index;
+        }
+
+        /// <summary>
+        /// Sets Font Variation with string tag.
+        /// </summary>
+        /// <param name="tag">The tag of font variation.</param>
+        /// <param name="value">The value of font variation.</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetFontVariation(string tag, float value)
+        {
+            int index = RegisterFontVariationProperty(tag);
+            Object.InternalSetPropertyFloat(SwigCPtr, index, value);
+        }
+
+        /// <summary>
+        /// Sets Font Variation with index.
+        /// </summary>
+        /// <param name="index">The index of font variation property.</param>
+        /// <param name="value">The value of font variation.</param>
+        /// <remarks>
+        /// To use the index, RegisterFontVariationProperty must precede it.
+        /// </remarks>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetFontVariation(int index, float value)
+        {
+            Object.InternalSetPropertyFloat(SwigCPtr, index, value);
+        }
+
         /// <inheritdoc/>
         [EditorBrowsable(EditorBrowsableState.Never)]
         protected override void Dispose(DisposeTypes type)
@@ -3550,7 +3586,6 @@ namespace Tizen.NUI.BaseComponents
             internal static readonly int RenderMode = Interop.TextLabel.RenderModeGet();
             internal static readonly int ManualRendered = Interop.TextLabel.ManualRenderedGet();
             internal static readonly int AsyncLineCount = Interop.TextLabel.AsyncLineCountGet();
-            internal static readonly int FontVariations = Interop.TextLabel.FontVariationsGet();
             internal static readonly int EllipsisMode = Interop.TextLabel.EllipsisModeGet();
             internal static readonly int IsScrolling = Interop.TextLabel.IsScrollingGet();
 
@@ -3585,14 +3620,5 @@ namespace Tizen.NUI.BaseComponents
         {
             AnchorClickedColor = new Color(r, g, b, a);
         }
-        public void SetFontVariation(string axis, float value)
-        {
-            int index = RegisterFontVariationProperty(axis);
-            Object.InternalSetPropertyFloat(SwigCPtr, index, value);
-        }
-        public void SetFontVariation(int index, float value)
-        {
-            Object.InternalSetPropertyFloat(SwigCPtr, index, value);
-        }
     }
 }