Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file.

### Fixed
- DateTimeAxis converting local time rather than UTC to TimeZone
- Reset PathEffect for GetTextPaint to prevent unnecessary text shaping

### Changed
- Target .NET 10, remove target .NET 6 (out of support and incompatible with nuget updates)
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Elia Herzog
Elmar Strittmatter
episage <tilosag@gmail.com>
eric
erikvdv1
Fabian Nitsche <ifab@freenet.de>
Federico Coppola <fede@silentman.it>
Francois Botha <igitur@gmail.com>
Expand Down
31 changes: 31 additions & 0 deletions Source/OxyPlot.SkiaSharp.Tests/SkiaRenderContextTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,37 @@ public void Setup()
Directory.CreateDirectory(this.outputDirectory);
}

[Test]
public void TestNoSvgTextShaping()
{
static void writeSvg(Stream stream)
{
using var canvas = SKSvgCanvas.Create(new SKRect(0, 0, 100, 100), stream);
var context = new SkiaRenderContext
{
RenderTarget = RenderTarget.VectorGraphic,
SkCanvas = canvas,
UseTextShaping = false,
};

context.DrawLine(
[new ScreenPoint(0, 0), new ScreenPoint(10, 0)],
OxyColors.Black,
1,
EdgeRenderingMode.Automatic,
[1, 2, 1, 2],
LineJoin.Miter);

context.DrawText(new ScreenPoint(0, 0), "ABC", OxyColors.Black);
}

using var svgStream = new MemoryStream();
writeSvg(svgStream);
var svg = System.Text.Encoding.UTF8.GetString(svgStream.ToArray());

Assert.That(svg, Contains.Substring("<text"));
}

[Test]
public void TestDisposal()
{
Expand Down
1 change: 1 addition & 0 deletions Source/OxyPlot.SkiaSharp/SkiaRenderContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,7 @@ private SKPaint GetTextPaint(string fontFamily, double fontSize, double fontWeig
this.paint.Style = SKPaintStyle.Fill;
this.paint.HintingLevel = this.RendersToScreen ? SKPaintHinting.Full : SKPaintHinting.NoHinting;
this.paint.SubpixelText = this.RendersToScreen;
this.paint.PathEffect = null;
return this.paint;
}

Expand Down