From: Chihun Jeong <50663828+ANZ1217@users.noreply.github.com> Date: Tue, 25 Mar 2025 10:03:29 +0000 (+0900) Subject: [NUI] Introduce FONT_VARIATIONS Property (#6772) X-Git-Tag: submit/tizen/20250327.010009~1^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1962edfae75d89c78ad7a5f8a871def91b726280;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Introduce FONT_VARIATIONS Property (#6772) * [NUI] Introduce FONT_VARIATIONS Property * Edit comments and remove Bindable Property. * Add new function SetProperty(int, float) to modify font variations * Modify SetProperty function of TextEditor * Adjust API * Change SetProperty to InternalSetPropertyFloat --------- Co-authored-by: ANZ1217 --- diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.TextEditor.cs b/src/Tizen.NUI/src/internal/Interop/Interop.TextEditor.cs index 6ef685e90..acdf15669 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.TextEditor.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.TextEditor.cs @@ -343,6 +343,10 @@ 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); } } } diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.TextField.cs b/src/Tizen.NUI/src/internal/Interop/Interop.TextField.cs index 41279f8f6..17e8b74a2 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.TextField.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.TextField.cs @@ -305,6 +305,10 @@ 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); } } } diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.TextLabel.cs b/src/Tizen.NUI/src/internal/Interop/Interop.TextLabel.cs index dc45094c5..f2546eee6 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.TextLabel.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.TextLabel.cs @@ -208,6 +208,8 @@ 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); @@ -241,6 +243,8 @@ namespace Tizen.NUI [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_AsyncHeightForWidthComputedSignal_Disconnect")] public static extern void AsyncHeightForWidthComputedDisconnect(HandleRef textLabelRef, HandleRef handler); + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_RegisterFontVariationProperty")] + public static extern int RegisterFontVariationProperty(HandleRef textLabelRef, string pTag); } } } diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs b/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs index 102ede902..10ec4a106 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs @@ -260,6 +260,21 @@ namespace Tizen.NUI.BaseComponents return ThemeManager.GetStyle(this.GetType()) == null ? false : true; } + /// + /// Registers FontVariationsProperty with string tag. + /// + /// The tag of font variations. + /// + /// The returned index can be used with animation. + /// + [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; + } + /// /// The TranslatableText property.
/// The text can set the SID value.
@@ -5047,6 +5062,7 @@ 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() { @@ -5103,6 +5119,15 @@ 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 { diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextField.cs b/src/Tizen.NUI/src/public/BaseComponents/TextField.cs index 531fb9c8a..97ea6cca8 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextField.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextField.cs @@ -332,6 +332,21 @@ namespace Tizen.NUI.BaseComponents return ThemeManager.GetStyle(this.GetType()) == null ? false : true; } + /// + /// Registers FontVariationsProperty with string tag. + /// + /// The tag of font variations. + /// + /// The returned index can be used with animation. + /// + [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; + } + /// /// The TranslatableText property.
/// The text can set the SID value.
@@ -4991,6 +5006,7 @@ 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() { @@ -5054,6 +5070,15 @@ 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 { diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs b/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs index ec605e453..6ab4a9983 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs @@ -411,6 +411,21 @@ namespace Tizen.NUI.BaseComponents if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + /// + /// Registers FontVariationsProperty with string tag. + /// + /// The tag of font variations. + /// + /// The returned index can be used with animation. + /// + [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; + } + /// /// The TranslatableText property.
/// The text can set the SID value.
@@ -3535,6 +3550,7 @@ 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(); @@ -3569,5 +3585,14 @@ 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); + } } }