diff --git a/src/Windows/Avalonia.Direct2D1/Media/FormattedTextImpl.cs b/src/Windows/Avalonia.Direct2D1/Media/FormattedTextImpl.cs index 57beac652c..c7356fde1f 100644 --- a/src/Windows/Avalonia.Direct2D1/Media/FormattedTextImpl.cs +++ b/src/Windows/Avalonia.Direct2D1/Media/FormattedTextImpl.cs @@ -51,12 +51,8 @@ namespace Avalonia.Direct2D1.Media (float)typeface.FontSize); } - textFormat.TextAlignment = DWrite.TextAlignment.Center; - textFormat.ParagraphAlignment = DWrite.ParagraphAlignment.Center; - - textFormat.WordWrapping = wrapping == TextWrapping.Wrap ? - DWrite.WordWrapping.Wrap : - DWrite.WordWrapping.NoWrap; + textFormat.WordWrapping = + wrapping == TextWrapping.Wrap ? DWrite.WordWrapping.Wrap : DWrite.WordWrapping.NoWrap; TextLayout = new DWrite.TextLayout(factory, Text ?? string.Empty, textFormat, (float)constraint.Width, (float)constraint.Height) diff --git a/tests/Avalonia.RenderTests/Controls/BorderTests.cs b/tests/Avalonia.RenderTests/Controls/BorderTests.cs index 7d2e40c3b4..c82d616094 100644 --- a/tests/Avalonia.RenderTests/Controls/BorderTests.cs +++ b/tests/Avalonia.RenderTests/Controls/BorderTests.cs @@ -204,7 +204,7 @@ namespace Avalonia.Direct2D1.RenderTests.Controls { Text = "Foo", Background = Brushes.Red, - FontFamily = "Segoe UI", + FontFamily = new FontFamily("Segoe UI"), FontSize = 12, HorizontalAlignment = HorizontalAlignment.Center, } @@ -231,7 +231,7 @@ namespace Avalonia.Direct2D1.RenderTests.Controls { Text = "Foo", Background = Brushes.Red, - FontFamily = "Segoe UI", + FontFamily = new FontFamily("Segoe UI"), FontSize = 12, VerticalAlignment = VerticalAlignment.Center, } @@ -258,7 +258,7 @@ namespace Avalonia.Direct2D1.RenderTests.Controls { Text = "Foo", Background = Brushes.Red, - FontFamily = "Segoe UI", + FontFamily = new FontFamily("Segoe UI"), FontSize = 12, HorizontalAlignment = HorizontalAlignment.Stretch, } @@ -285,7 +285,7 @@ namespace Avalonia.Direct2D1.RenderTests.Controls { Text = "Foo", Background = Brushes.Red, - FontFamily = "Segoe UI", + FontFamily = new FontFamily("Segoe UI"), FontSize = 12, VerticalAlignment = VerticalAlignment.Stretch, } @@ -312,7 +312,7 @@ namespace Avalonia.Direct2D1.RenderTests.Controls { Text = "Foo", Background = Brushes.Red, - FontFamily = "Segoe UI", + FontFamily = new FontFamily("Segoe UI"), FontSize = 12, HorizontalAlignment = HorizontalAlignment.Left, } @@ -339,7 +339,7 @@ namespace Avalonia.Direct2D1.RenderTests.Controls { Text = "Foo", Background = Brushes.Red, - FontFamily = "Segoe UI", + FontFamily = new FontFamily("Segoe UI"), FontSize = 12, HorizontalAlignment = HorizontalAlignment.Right, } @@ -366,7 +366,7 @@ namespace Avalonia.Direct2D1.RenderTests.Controls { Text = "Foo", Background = Brushes.Red, - FontFamily = "Segoe UI", + FontFamily = new FontFamily("Segoe UI"), FontSize = 12, VerticalAlignment = VerticalAlignment.Top, } @@ -393,7 +393,7 @@ namespace Avalonia.Direct2D1.RenderTests.Controls { Text = "Foo", Background = Brushes.Red, - FontFamily = "Segoe UI", + FontFamily = new FontFamily("Segoe UI"), FontSize = 12, VerticalAlignment = VerticalAlignment.Bottom, } diff --git a/tests/Avalonia.RenderTests/Media/VisualBrushTests.cs b/tests/Avalonia.RenderTests/Media/VisualBrushTests.cs index cfa15ae304..f69d336271 100644 --- a/tests/Avalonia.RenderTests/Media/VisualBrushTests.cs +++ b/tests/Avalonia.RenderTests/Media/VisualBrushTests.cs @@ -48,7 +48,7 @@ namespace Avalonia.Direct2D1.RenderTests.Media Child = new TextBlock { FontSize = 24, - FontFamily = "Arial", + FontFamily = new FontFamily("Arial"), Background = Brushes.Green, Foreground = Brushes.Yellow, Text = "VisualBrush",