-
Notifications
You must be signed in to change notification settings - Fork 730
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Support for more Font properties in Skia Overlay TextBox
- Loading branch information
1 parent
1593db7
commit e6976b1
Showing
6 changed files
with
110 additions
and
72 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
src/Uno.UI.Runtime.Skia.Gtk/Extensions/TypeConversionExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#nullable enable | ||
|
||
using Silk.NET.OpenGL; | ||
|
||
namespace Uno.UI.Runtime.Skia.GTK.Extensions; | ||
|
||
internal static class TypeConversionExtensions | ||
{ | ||
public static Pango.Stretch ToGtkFontStretch(this Windows.UI.Text.FontStretch fontStretch) => | ||
fontStretch switch | ||
{ | ||
Windows.UI.Text.FontStretch.UltraCondensed => Pango.Stretch.UltraCondensed, | ||
Windows.UI.Text.FontStretch.ExtraCondensed => Pango.Stretch.ExtraCondensed, | ||
Windows.UI.Text.FontStretch.Condensed => Pango.Stretch.Condensed, | ||
Windows.UI.Text.FontStretch.SemiCondensed => Pango.Stretch.SemiCondensed, | ||
Windows.UI.Text.FontStretch.SemiExpanded => Pango.Stretch.SemiExpanded, | ||
Windows.UI.Text.FontStretch.Expanded => Pango.Stretch.Expanded, | ||
Windows.UI.Text.FontStretch.ExtraExpanded => Pango.Stretch.ExtraExpanded, | ||
Windows.UI.Text.FontStretch.UltraExpanded => Pango.Stretch.UltraExpanded, | ||
_ => Pango.Stretch.Normal | ||
}; | ||
|
||
public static Pango.Style ToGtkFontStyle(this Windows.UI.Text.FontStyle fontStyle) => | ||
fontStyle switch | ||
{ | ||
Windows.UI.Text.FontStyle.Normal => Pango.Style.Normal, | ||
Windows.UI.Text.FontStyle.Italic => Pango.Style.Italic, | ||
Windows.UI.Text.FontStyle.Oblique => Pango.Style.Oblique, | ||
_ => Pango.Style.Normal | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters