diff --git a/src/Core/src/ImageSources/FontImageSourceService/FontImageSourceService.Windows.cs b/src/Core/src/ImageSources/FontImageSourceService/FontImageSourceService.Windows.cs index 43e818f42102..22cf4c44159f 100644 --- a/src/Core/src/ImageSources/FontImageSourceService/FontImageSourceService.Windows.cs +++ b/src/Core/src/ImageSources/FontImageSourceService/FontImageSourceService.Windows.cs @@ -86,9 +86,8 @@ internal CanvasImageSource RenderImageSource(IFontImageSource imageSource, float var canvasImageSource = new CanvasImageSource(device, canvasWidth, canvasHeight, dpi); using (var ds = canvasImageSource.CreateDrawingSession(UI.Colors.Transparent)) { - // offset by 1px as we added a 1px padding - var x = (layout.DrawBounds.X * -1) + 1; - var y = (layout.DrawBounds.Y * -1) + 1; + var x = (canvasWidth / 2d + (layout.LayoutBounds.Left + layout.DefaultFontSize / 2)); + var y = (canvasHeight / 2d + (layout.LayoutBounds.Top + layout.DefaultFontSize / 2)); ds.DrawTextLayout(layout, (float)x, (float)y, color); } @@ -149,4 +148,4 @@ string GetFontSource(IFontImageSource imageSource) return fontSource; } } -} \ No newline at end of file +}