diff options
Diffstat (limited to 'Xamarin.Forms.Platform.Tizen/Native/Span.cs')
-rw-r--r-- | Xamarin.Forms.Platform.Tizen/Native/Span.cs | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/Native/Span.cs b/Xamarin.Forms.Platform.Tizen/Native/Span.cs index 4a5daf3c..028e9db9 100644 --- a/Xamarin.Forms.Platform.Tizen/Native/Span.cs +++ b/Xamarin.Forms.Platform.Tizen/Native/Span.cs @@ -77,6 +77,11 @@ namespace Xamarin.Forms.Platform.Tizen.Native public double FontSize { get; set; } /// <summary> + /// Gets or sets the font weight for the text. + /// </summary> + public FontWeight FontWeight { get; set; } + + /// <summary> /// Gets or sets the line break mode for the text. /// See <see cref="LineBreakMode"/> for information about LineBreakMode. /// </summary> @@ -112,6 +117,7 @@ namespace Xamarin.Forms.Platform.Tizen.Native Text = ""; FontFamily = ""; FontSize = -1; + FontWeight = FontWeight.None; FontAttributes = FontAttributes.None; ForegroundColor = EColor.Default; BackgroundColor = EColor.Default; @@ -183,6 +189,47 @@ namespace Xamarin.Forms.Platform.Tizen.Native { _formattingString.Append("font_weight=Bold "); } + else + { + // FontWeight is only available in case of FontAttributes.Bold is not used. + switch (FontWeight) + { + case FontWeight.Bold: + _formattingString.Append("font_weight=Bold "); + break; + case FontWeight.SemiBold: + _formattingString.Append("font_weight=SemiBold "); + break; + case FontWeight.UltraBold: + _formattingString.Append("font_weight=UltraBold "); + break; + case FontWeight.Black: + _formattingString.Append("font_weight=Black "); + break; + case FontWeight.ExtraBlack: + _formattingString.Append("font_weight=ExtraBlack "); + break; + case FontWeight.Book: + _formattingString.Append("font_weight=Book "); + break; + case FontWeight.Light: + _formattingString.Append("font_weight=Light "); + break; + case FontWeight.Medium: + _formattingString.Append("font_weight=Medium "); + break; + case FontWeight.Normal: + _formattingString.Append("font_weight=Normal "); + break; + case FontWeight.Thin: + _formattingString.Append("font_weight=Thin "); + break; + case FontWeight.UltraLight: + _formattingString.Append("font_weight=UltraLight "); + break; + } + } + if ((FontAttributes & FontAttributes.Italic) != 0) { _formattingString.Append("font_style=italic "); |